00001 // ///////////////////////////////////////////////////////////////////////////// 00002 // 00003 // Name: GameState.h 00004 // Author: Michael Bartsch (ZCCdark203) 00005 // 00006 // Desc : Declaration of the GameState class. 00007 // 00008 // License: Copyright (C) 2009 Michael Bartsch and Contributors 00009 // 00010 // This program is free software: you can redistribute it 00011 // and/or modify it under the terms of the zlib/libpng License. 00012 // See main.cpp for conditions of distribution and use. 00013 // 00014 // ///////////////////////////////////////////////////////////////////////////// 00015 00016 #ifndef __GAMESTATE_H__ 00017 #define __GAMESTATE_H__ 00018 00019 // Include files 00020 #include "GameManager.h" 00021 00022 // Forward declarations 00023 class GameManager; 00024 00025 00026 // GameState class 00028 class GameState : public ReferenceCounted 00029 { 00030 friend class ScriptedGameState; 00031 00032 public: 00033 00034 // Initialisation, deinitialisation and control... 00036 GameState(); 00038 virtual ~GameState(); 00039 00041 virtual void init(); 00043 virtual void clear(); 00044 00047 virtual void update(f32 deltaTime); 00049 virtual void render(); 00050 00051 // Public functions 00053 const Entity* getBaseEntity() const; 00054 00055 // Event functions 00058 void onUpdate(f32 deltaTime); 00061 void onRender(); 00064 void onPause(); 00067 void onUnPause(); 00068 00069 protected: 00070 00071 // Protected members 00072 Entity *mBaseEntity; 00073 00074 private: 00075 00076 // Static members 00077 static u32 mIDCount; 00078 00079 // Angelscript members 00080 s32 mRefCount; 00081 00082 // Private members 00083 u32 mID; 00084 }; 00085 00086 #endif