1 // Description: 2 // Controller 3 // 4 // Copyright (C) 2003 Frank Becker 5 // 6 // This program is free software; you can redistribute it and/or modify it under 7 // the terms of the GNU General Public License as published by the Free Software 8 // Foundation; either version 2 of the License, or (at your option) any later 9 // version. 10 // 11 // This program is distributed in the hope that it will be useful, but WITHOUT 12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details 14 // 15 #ifndef __BLockController_hpp__ 16 #define __BLockController_hpp__ 17 18 #include "EventWatcher.hpp" 19 #include "EventInjector.hpp" 20 21 #include "BlockModel.hpp" 22 #include "BlockViewBase.hpp" 23 24 class BlockController 25 { 26 public: 27 BlockController( BlockModel &model, BlockViewBase &view); 28 ~BlockController(); 29 30 bool update( void); 31 setEventWatcher(EventWatcher * ev)32 void setEventWatcher( EventWatcher *ev) 33 { 34 _eventWatcher = ev; 35 } 36 setEventInjector(EventInjector * inj)37 void setEventInjector( EventInjector *inj) 38 { 39 _eventInjector = inj; 40 } 41 42 private: 43 bool hasEvent( SDL_Event &event); 44 45 BlockModel &_model; 46 BlockViewBase &_view; 47 EventWatcher *_eventWatcher; 48 EventInjector *_eventInjector; 49 }; 50 51 #endif 52