"L. Spiro Engine"
|
00001 00026 #ifndef __LSE_STATE_H__ 00027 #define __LSE_STATE_H__ 00028 00029 #include "../LSEEngine.h" 00030 #include "Allocators/LSAStdAllocator.h" 00031 #include "SoundCore/LSSSoundManagerEx.h" 00032 #include "Time/LSSTDTime.h" 00033 00034 namespace lse { 00035 00036 // We need to know what a game class is. This creates a small circular dependancy but 00037 // is really no problem since there is no default implementation here. 00038 class CGame; 00039 00043 enum LSE_GAMESTATES { 00044 LSE_GS_INVALID = -1, 00045 LSE_GS_DEFAULT = -2, 00046 }; 00047 00064 class CState { 00065 // Also, the state manager needs to have access to our private parts. 00066 friend class CStateMachine; 00067 00068 public : 00069 // == Various constructors. 00070 LSE_CALL CState(); 00071 virtual LSE_CALL ~CState(); 00072 00073 00074 // == Functions. 00090 virtual LSVOID LSE_CALL Init( CGame * _pgGame, LSINT32 _ui32State, LSINT32 _ui32PrevState, LSUINTPTR _uptrUser ); 00091 00098 virtual LSVOID LSE_CALL Destroy( CGame * _pgGame, LSINT32 _ui32NextState ); 00099 00109 virtual LSBOOL LSE_CALL Tick( CGame * _pgGame ); 00110 00118 virtual LSBOOL LSE_CALL Draw( CGame * _pgGame ); 00119 00128 virtual LSBOOL LSE_CALL Interruptable() const; 00129 00139 virtual LSA_SIZE LSE_CALL GetHeapSize( CGame * _pgGame, LSINT32 _ui32State, LSUINTPTR _uptrUser ) const; 00140 00146 const CTime & LSE_CALL GetTimeMan() const; 00147 00157 virtual LSVOID LSE_CALL EventSound( CGame * _pgGame, 00158 CSoundSource * _pssSource, 00159 LSUINT32 _ui32EventType, CSoundManagerEx * _psmManager ); 00160 00165 virtual LSVOID LSE_CALL EventTouch( const CVector2 &_vPos ); 00166 00167 protected : 00168 // == Members. 00178 CTime m_tLocalTime; 00179 00184 CTime m_tRenderTime; 00185 00194 CStdAllocator * m_psaAllocator; 00195 00199 LSUINT32 m_ui32StateId; 00200 }; 00201 00202 } // namespace lse 00203 00204 #endif // __LSE_STATE_H__