1 // Description: 2 // High level infrastructure for game. 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 _Game_hpp_ 16 #define _Game_hpp_ 17 18 #include <Singleton.hpp> 19 20 #include "BlockModel.hpp" 21 #include "BlockController.hpp" 22 #include "BlockViewBase.hpp" 23 24 class Game 25 { 26 friend class Singleton<Game>; 27 public: 28 bool init( void); 29 void run( void); 30 void reset( void); 31 32 private: 33 ~Game(); 34 Game( void); 35 Game( const Game&); 36 Game &operator=(const Game&); 37 38 void updateOtherLogic( void); 39 void updateInGameLogic( void); 40 41 BlockModel *_model; 42 BlockController *_controller; 43 BlockViewBase *_view; 44 45 ostream *_zo; 46 ofstream *_oStream; 47 48 istream *_zi; 49 ifstream *_iStream; 50 }; 51 52 typedef Singleton<Game> GameS; 53 54 #endif 55