📄 cgameframework.h
字号:
// Copyright 2002 Kenneth Guy,
//
// CGameFramework.h
#ifndef _CGAMEFRAMEWORK_H_
#define _CGAMEFRAMEWORK_H_
/** \file CGameFramework.h
defines class CGameFramework */
#include <e32std.h>
#include <e32base.h>
#include <w32std.h>
#include "TGameData.h"
/** Provides UI with access to CGame, and CGame access to the UI.
Loads levels, starts/suspends the thread that owns the CGame
object, talks direct to the window server to collect key presses
and focus change events.
*/
class CGameFramework : public CBase {
public:
/** Current state of the game */
enum TGameState {
EDied, ///< No game running, thread exited because player died
ELevelCompleted, ///< No game running, thread exited because player finished a level
EPaused, ///< Game paused, game thread is suspended
};
public:
static CGameFramework* NewL();
~CGameFramework();
TGameState RunL(TBool aReset);
void LoadLevelL(const TDesC& aLevelName,const TDesC& aMapName, TBool aResetShip);
TInt Score();
void CancelL();
private:
static TInt GameThread(TAny* aGameData);
TBool Play(RWsSession &aWindSession);
private:
TGameData iData; ///< Game data, key presses level information etc.
RThread iGameThread; ///< Thread within which the CGame object runs
TRequestStatus iGameStatus; ///< Status of game thread.
HBufC8* iLevel; ///< Sprite, background and status sprites for level.
HBufC8* iMap; ///< Map and path data for game.
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -