|
0 A.D. | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
boost::noncopyable
|
+--CGame
in Game.hThe container that holds the rules, resources and attributes of the game. The CGame object is responsible for creating a game that is defined by a set of attributes provided. The CGame object is also responsible for maintaining the relations between CPlayer and CWorld, CSimulation and CWorld.
Inner Classes, Typedefs, and Enums | |
enum |
CGame::EOG
enumerated values for game status. |
Field Summary | |
private bool |
m_GameStarted
the game has been initialized and ready for use if true. |
private CGameView* |
m_GameView
pointer to the CGameView object representing the view into the game world. |
private uint |
m_NumPlayers
number of players operating on the game world(not including gaia). |
bool |
m_Paused
the game is paused and no updates will be performed if true. |
private std::vector< CPlayer* > |
m_Players
STL vectors of pointers to all CPlayer objects(including gaia) operating on the game world. |
private CPlayer* |
m_pLocalPlayer
pointer to the local CPlayer object operating on the game world. |
private float |
m_SimRate
scale multiplier for simulation rate. |
private CSimulation* |
m_Simulation
pointer to the CSimulation object operating on the game world. |
private double |
m_Time
total elapsed game time in seconds. |
private CWorld* |
m_World
pointer to the CWorld object representing the game world. |
Constructor Summary | |
CGame()
Constructor |
|
~CGame()
Destructor |
Method Summary | |
void |
EndGame()
End of game console message creation. |
inline CPlayer* |
GetLocalPlayer()
Get pointer to the local player object. |
inline uint |
GetNumPlayers() const
Get m_NumPlayers. |
CPlayer* |
GetPlayer( uint idx )
Get the player object from the players list at the provided index. |
inline std::vector< CPlayer* >* |
GetPlayers()
Get a reference to the m_Players vector. |
inline float |
GetSimRate() const
Get the simulation scale multiplier. |
inline CSimulation* |
GetSimulation()
Get the pointer to the simulation object. |
inline double |
GetTime() const
Get the current game elapsed time. |
inline CGameView* |
GetView()
Get the pointer to the game view object. |
inline CWorld* |
GetWorld()
Get the pointer to the game world object. |
inline bool |
IsGameStarted() const
Get m_GameStarted. |
PSRETURN |
ReallyStartGame()
Game initialization has been completed. |
private PSRETURN |
RegisterInit( CGameAttributes* pAttribs )
Initializes the game with the set of attributes provided. |
inline void |
SetLocalPlayer( CPlayer* pLocalPlayer )
Change the pointer to the local player object. |
inline void |
SetSimRate( float simRate )
Set the simulation scale multiplier. |
PSRETURN |
StartGame( CGameAttributes* pGameAttributes )
Prepare to start the game. |
bool |
Update( double deltaTime, bool doInterpolate = true )
Periodic heartbeat that controls the process. |
void |
UpdateGameStatus()
|
Field Detail |
private bool m_GameStarted;
private CGameView* m_GameView;
private uint m_NumPlayers;
public bool m_Paused;
private std::vector< CPlayer* > m_Players;
private CPlayer* m_pLocalPlayer;
private float m_SimRate;
private CSimulation* m_Simulation;
private double m_Time;
private CWorld* m_World;
Constructor Detail |
public CGame();
public ~CGame();
Method Detail |
public void EndGame();
public inline CPlayer* GetLocalPlayer();
public inline uint GetNumPlayers() const;
public CPlayer* GetPlayer( uint idx );
PS_uint
- idx sequential position in the list.public inline std::vector< CPlayer* >* GetPlayers();
public inline float GetSimRate() const;
public inline CSimulation* GetSimulation();
public inline double GetTime() const;
public inline CGameView* GetView();
public inline CWorld* GetWorld();
public inline bool IsGameStarted() const;
public PSRETURN ReallyStartGame();
private PSRETURN RegisterInit( CGameAttributes* pAttribs );
CGameAttributes
- * pAttribs pointer to the game attribute valuespublic inline void SetLocalPlayer( CPlayer* pLocalPlayer );
CPlayer
- * pLocalPlayer pointer to a valid player object.public inline void SetSimRate( float simRate );
float
- simRate value to set m_SimRate to.
Because m_SimRate is also used to
scale TimeSinceLastFrame it must be
clamped to 0.0f.public PSRETURN StartGame( CGameAttributes* pGameAttributes );
CGameAttributes
- * pGameAttributes game attributes for initialization.public bool Update( double deltaTime, bool doInterpolate = true );
double
- deltaTime elapsed time since last beat in seconds.
bool
- doInterpolate perform interpolation if true.public void UpdateGameStatus();
|
0 A.D.
Generated on September 04, 2007 at 18:13 CppDoc v2.4.0 |
|||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |