imported patch gamestate_to_model
This commit is contained in:
		
							parent
							
								
									710d3e2509
								
							
						
					
					
						commit
						54e14b41af
					
				| @ -14,12 +14,6 @@ class Model : public Engine::ModelBase { | ||||
| 		int DoSaveLevel (const char* filename); | ||||
| 		bool OnLevelComplete(); | ||||
| 
 | ||||
| 		void SetGameState (const GameState &state) { | ||||
| 			mLastGameState = mGameState; | ||||
| 			mGameState = state; | ||||
| 		}; | ||||
| 		GameState GetGameState () { return mGameState; }; | ||||
| 
 | ||||
| 		int GetPlayerLives () { return mPlayerLives; }; | ||||
| 		unsigned int GetPoints () { return mPoints; }; | ||||
| 
 | ||||
| @ -46,9 +40,6 @@ class Model : public Engine::ModelBase { | ||||
| 		/** \brief Keeps a list of all asteroids */ | ||||
| 		std::vector<unsigned int> mAsteroids; | ||||
| 
 | ||||
| 		GameState mGameState; | ||||
| 		GameState mLastGameState; | ||||
| 
 | ||||
| 		int mPlayerLives; | ||||
| 		unsigned int mPoints; | ||||
| 		std::vector<std::string> mLevelList; | ||||
|  | ||||
| @ -23,10 +23,13 @@ | ||||
|     #define DECL_ENUM_ELEMENT( element ) element | ||||
|     #define BEGIN_ENUM( ENUM_NAME ) typedef enum tag##ENUM_NAME | ||||
|     #define END_ENUM( ENUM_NAME ) ENUM_NAME; \ | ||||
|             const char* GetString##ENUM_NAME(enum tag##ENUM_NAME index); | ||||
|             const char* GetString##ENUM_NAME(enum tag##ENUM_NAME index); \ | ||||
|             const char* GetString##ENUM_NAME(unsigned int index); | ||||
| #else | ||||
| 		#define DECL_ENUM_ELEMENT( element ) #element | ||||
|     #define BEGIN_ENUM( ENUM_NAME ) const char* gs_##ENUM_NAME [] = | ||||
|     #define END_ENUM( ENUM_NAME ) ; const char* GetString##ENUM_NAME(enum \ | ||||
|             tag##ENUM_NAME index){ return gs_##ENUM_NAME [index]; } | ||||
|     #define END_ENUM( ENUM_NAME ) ; \ | ||||
|             const char* GetString##ENUM_NAME(enum \ | ||||
| 								tag##ENUM_NAME index){ return gs_##ENUM_NAME [index]; } \ | ||||
|             const char* GetString##ENUM_NAME(unsigned int index){ return gs_##ENUM_NAME [index]; } | ||||
| #endif | ||||
|  | ||||
| @ -72,6 +72,12 @@ class ModelBase : public Module { | ||||
| 		void SendEntityCollisionEvent (const unsigned int reference_entity_id, | ||||
| 				const unsigned int incidence_entity_id, float collision_time, vector3d normal); | ||||
| 
 | ||||
| 		void SetGameState (const unsigned int &state) { | ||||
| 			mLastGameState = mGameState; | ||||
| 			mGameState = state; | ||||
| 		}; | ||||
| 		unsigned int GetGameState () { return mGameState; }; | ||||
| 
 | ||||
| 	protected: | ||||
| 		/** \brief Initializes the system */ | ||||
| 		virtual int OnInit (int argc, char* argv[]); | ||||
| @ -98,6 +104,9 @@ class ModelBase : public Module { | ||||
| 		unsigned int mEntityIdCounter; | ||||
| 		unsigned int mPlayerEntityId; | ||||
| 
 | ||||
| 		unsigned int mGameState; | ||||
| 		unsigned int mLastGameState; | ||||
| 
 | ||||
| 		float mDeltaSec; | ||||
| 
 | ||||
| 	friend class ViewBase; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user