view states are now managed by a stack + bugfixing

- when one defines DECL_ENUM_LAST it is possible to check whether a string for
	a give enum exists
- making sure ships are alive when they are spawned
- added warning concerning QueueEvent and TriggerEvent (one shall avoid the
	latter)
This commit is contained in:
2010-11-27 20:56:38 +01:00
parent f8e5b7e873
commit 3340471c61
15 changed files with 114 additions and 55 deletions
+10 -7
View File
@@ -10,16 +10,22 @@ class Model : public Engine::ModelBase {
public:
virtual ~Model() {};
virtual void Process();
int DoLoadLevel (const char* filename);
int DoSaveLevel (const char* filename);
virtual void SetGameState (const unsigned int &state);
float GetWorldWidth ();
float GetWorldHeight ();
/* Event handler */
bool OnLevelComplete();
bool OnGameOver();
/** \brief Resets values from a previous game */
void OnNewGame ();
void OnShipExplode ();
virtual void SetGameState (const unsigned int &state);
/* Level loading etc. */
int DoLoadLevel (const char* filename);
int DoSaveLevel (const char* filename);
void ProceedToNextLevel ();
int GetPlayerLives () { return mPlayerLives; };
unsigned int GetPoints () { return mPoints; };
std::string GetPlayerName() { return mPlayerName; };
@@ -28,9 +34,7 @@ class Model : public Engine::ModelBase {
mPlayerName = name;
};
float GetWorldWidth ();
float GetWorldHeight ();
/* Highscore */
struct HighscoreEntry {
HighscoreEntry(): name ("unknown"), points (0) { };
HighscoreEntry (const char *e_name, const unsigned int e_points):
@@ -40,7 +44,6 @@ class Model : public Engine::ModelBase {
unsigned int points;
};
/* Highscore */
void LoadHighscoreList ();
void SaveHighscoreList ();
unsigned int AddHighscoreEntry(const std::string &name, const unsigned int points);