68 CGame(
bool disableGraphics =
false);
88 bool Update(
const double deltaRealTime,
bool doInterpolate =
true);
90 void Interpolate(
float simFrameLength,
float realFrameLength);
The container that holds the rules, resources and attributes of the game.
void CachePlayerColours()
Retrieving player colours from scripts is slow, so this updates an internal cache of all players' col...
CWorld * m_World
pointer to the CWorld object representing the game world.
Replay log recorder interface.
CGameView * m_GameView
pointer to the CGameView object representing the view into the game world.
Public API for simulation system.
void Interpolate(float simFrameLength, float realFrameLength)
CWorld is a general data class containing whatever is needed to accurately represent the world...
void SetPlayerID(int playerID)
bool Update(const double deltaRealTime, bool doInterpolate=true)
Periodic heartbeat that controls the process.
void SetTurnManager(CNetTurnManager *turnManager)
Replace the current turn manager.
void StartGame(const CScriptValRooted &attribs, const std::string &savedState)
CNetTurnManager * GetTurnManager() const
bool m_Paused
the game is paused and no updates will be performed if true.
std::string m_InitialSavedState
Common network turn system (used by clients and offline games).
CGame * g_Game
Globally accessible pointer to the CGame object.
void SetSimRate(float simRate)
Set the simulation scale multiplier.
void RegisterInit(const CScriptValRooted &attribs, const std::string &savedState)
Initializes the game with the set of attributes provided.
CNetTurnManager * m_TurnManager
CSimulation2 * GetSimulation2()
Get the pointer to the simulation2 object.
std::vector< CColor > m_PlayerColours
CGameView * GetView()
Get the pointer to the game view object.
CGame(bool disableGraphics=false)
Constructor.
bool IsGameStarted() const
Get m_GameStarted.
CColor GetPlayerColour(int player) const
CWorld * GetWorld()
Get the pointer to the game world object.
float m_SimRate
Timescale multiplier for simulation rate.
PSRETURN ReallyStartGame()
Game initialization has been completed.
IReplayLogger * m_ReplayLogger
bool m_GameStarted
the game has been initialized and ready for use if true.
IReplayLogger & GetReplayLogger() const
CSimulation2 * m_Simulation2
pointer to the CSimulation2 object operating on the game world.