#include <CGameState.h>
Collaboration diagram for CGameState:

Public Types | |
| enum | TState { ENoGame, EPaused, ENextLevel } |
| Game state. More... | |
Public Methods | |
| TState | State () |
| get game state. More... | |
| void | SetState (TState aState) |
| set game state. More... | |
| ~CGameState () | |
| destructor. More... | |
| CHighScores & | HighScores () |
| access high score table. More... | |
Static Public Methods | |
| CGameState * | NewL (const TDesC &aFileName) |
| Leave safe construction. More... | |
Private Methods | |
| CGameState () | |
| constructor. More... | |
| void | ConstructL (const TDesC &aFileName) |
| 2nd phase construction. More... | |
Private Attributes | |
| CHighScores * | iHighScores |
| High score table. More... | |
| TState | iState |
| Game state. More... | |
This contains the current game state and the high score table.
Definition at line 29 of file CGameState.h.
|
|
Game state.
Definition at line 32 of file CGameState.h. Referenced by SetState(), and State().
00032 {
00033 ENoGame,
00034 EPaused,
00035 ENextLevel
00036 };
|
|
|
destructor.
Definition at line 95 of file CGameState.cpp. References iHighScores.
00095 {
00096 delete iHighScores;
00097 }
|
|
|
constructor.
Definition at line 54 of file CGameState.cpp.
|
|
|
Leave safe construction.
Definition at line 34 of file CGameState.cpp. References ConstructL(). Referenced by CGameDocument::ConstructL().
00034 {
00035 CGameState* self= new (ELeave) CGameState;
00036 CleanupStack::PushL(self);
00037 self->ConstructL(aFileName);
00038 CleanupStack::Pop(self);
00039 return(self);
00040 }
|
|
|
get game state.
Definition at line 66 of file CGameState.cpp. References iState, and TState. Referenced by CGameAppView::Draw(), CGameAppUi::DynInitMenuPaneL(), CGameAppUi::HandleCommandL(), and CGameAppUi::LoadLevelL().
00066 {
00067 return iState;
00068 }
|
|
|
set game state. Update the Cba buttons as nessesary Definition at line 74 of file CGameState.cpp. References ECmdCancelGame, ECmdContinueGame, ECmdStartGame, ENextLevel, ENoGame, EPaused, iState, and TState. Referenced by CGameAppUi::ConstructL(), and CGameAppUi::HandleCommandL().
00074 {
00075 iState=aState;
00076 CEikButtonGroupContainer* cba=CEikonEnv::Static()->AppUiFactory()->ToolBar();
00077 switch(iState) {
00078 case ENoGame:
00079 cba->DimCommand(ECmdCancelGame,ETrue);
00080 cba->DimCommand(ECmdContinueGame,ETrue);
00081 cba->DimCommand(ECmdStartGame,EFalse);
00082 break;
00083 case EPaused:
00084 case ENextLevel:
00085 cba->DimCommand(ECmdCancelGame,EFalse);
00086 cba->DimCommand(ECmdContinueGame,EFalse);
00087 cba->DimCommand(ECmdStartGame,ETrue);
00088 break;
00089 }
00090 cba->DrawNow();
00091 }
|
|
|
access high score table.
Definition at line 59 of file CGameState.cpp. References iHighScores. Referenced by CGameAppView::DrawHighScores(), and CGameAppUi::HandleCommandL().
00059 {
00060 return *iHighScores;
00061 }
|
|
|
2nd phase construction. Construct high score table
Definition at line 49 of file CGameState.cpp. References iHighScores, and CHighScores::NewL(). Referenced by NewL().
00049 {
00050 iHighScores=CHighScores::NewL(aFileName);
00051 }
|
|
|
High score table.
Definition at line 51 of file CGameState.h. Referenced by ConstructL(), HighScores(), and ~CGameState(). |
|
|
Game state.
Definition at line 52 of file CGameState.h. |