00001 // Copyright 2002 Kenneth Guy, 00002 // 00003 // You are free to take the source and do as you wish with it. 00004 // However it would be nice if you let me know if the code was useful 00005 // to you and give me an acknowledgement if you use a significant portion 00006 // of the code in an application. 00007 // 00008 // CGameFramework.h 00009 00010 #ifndef _CGAMEFRAMEWORK_H_ 00011 #define _CGAMEFRAMEWORK_H_ 00012 00017 #include <e32std.h> 00018 #include <e32base.h> 00019 #include <w32std.h> 00020 00021 #include "TGameData.h" 00022 00030 class CGameFramework : public CBase { 00031 public: 00033 enum TGameState { 00034 EDied, 00035 ELevelCompleted, 00036 EPaused, 00037 }; 00038 00039 public: 00040 static CGameFramework* NewL(); 00041 ~CGameFramework(); 00042 00043 TGameState RunL(TBool aReset); 00044 void LoadLevelL(const TDesC& aLevelName,const TDesC& aMapName, TBool aResetShip); 00045 TInt Score(); 00046 void CancelL(); 00047 00048 private: 00049 static TInt GameThread(TAny* aGameData); 00050 TBool Play(RWsSession &aWindSession); 00051 private: 00052 00053 TGameData iData; 00054 RThread iGameThread; 00055 TRequestStatus iGameStatus; 00056 00057 HBufC8* iLevel; 00058 HBufC8* iMap; 00059 }; 00060 00061 #endif