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