Emergency 20 Dokumentation  4.2.0
em5::Game Class Reference

EMERGENCY 5 game class. More...

#include <Game.h>

Inheritance diagram for em5::Game:
qsf::game::Game qsf::UniqueInstance< Game >

Public Member Functions

 Game ()
 Default constructor. More...
 
virtual ~Game ()
 Destructor. More...
 
void prepareMap (qsf::Map &map, bool wasLoadedBefore)
 
void onLoadComplete ()
 
GameSimulationgetSimulation () const
 Return the game simulation instance. More...
 
const qsf::ClockgetSimulationClock () const
 Shortcut method to return the game simulation clock. More...
 
GameAnimationgetAnimation () const
 Return the game animation instance. More...
 
MiniMapIconRegistrationLogicgetMiniMapIconRegistrationLogic () const
 Return the game mini map registration logic instance. More...
 
qsf::SoundTrackManagergetSoundTrackManager () const
 Return sound track manager instance. More...
 
GameSessionConfigurationgetGameSessionConfiguration () const
 Return the game session configuration. More...
 
const CampaignDefinitiongetCampaignDefinitionByIndex (uint32 campaignIndex)
 Return a campaign definition. More...
 
const std::vector< CampaignDefinition * > & getCampaignDefinitions () const
 Return campaign definitions. More...
 
uint32 getCampaignIndexByMainEventNumber (uint32 mainEventNumber) const
 Return a campaign index by using a given main event number. More...
 
bool getMapAndCampaignInfoByMainEventNumber (uint32 mainEventNumber, MapIdentifier &outMapIdentifier, uint32 &outCampaignIndex, uint32 &outCampaignPhaseIndex) const
 Return all data needed to directly launch a main event. More...
 
PlayerManagergetPlayerManager () const
 Return the player manager. More...
 
const RightsManagergetRightsManager () const
 Return the rights manager. More...
 
SelectionManagergetSelectionManager () const
 Return the game's selection manager. More...
 
qsf::game::GameCounterManagergetGameCounterManager () const
 Return the game counter manager. More...
 
qsf::game::GameTimerManagergetGameTimerManager () const
 Return the game timer manager. More...
 
qsf::logic::TargetPointManagergetTargetPointManager () const
 Return the target point manager. More...
 
CutscenePlayergetCutscenePlayer () const
 Return the cutscene player. More...
 
OverlayManagergetOverlayManager () const
 Return the overlay manager. More...
 
OrderInfoManagergetOrderInfoManager () const
 Returns the order info manager. More...
 
GangsterTypeManagergetGangsterTypeManager () const
 Returns the gangster type manager. More...
 
SpecsGroupManagergetSpecsGroupManager () const
 Returns the specs group manager. More...
 
HintSystemgetHintSystem () const
 Returns the hint system. More...
 
qsf::CameraComponentgetMainCamera () const
 Get the main camera. More...
 
void setMainCamera (qsf::CameraComponent *cameraComponent)
 Set the main camera. More...
 
void serialize (qsf::BinarySerializer &serializer)
 Serialization of the whole game. More...
 
bool loadGame (const std::string &filename)
 Load the game from the given file. More...
 
bool saveGame (const std::string &filename)
 Save the game to the given file. More...
 
bool isGameInteractionBlocked () const
 Returns whether the game interaction (camera movement, selection, commands, most of in-game GUI) is blocked. More...
 
- Public Member Functions inherited from qsf::game::Game
 Game ()
 Default constructor. More...
 
bool isRunning () const
 Check whether or not the game is currently running. More...
 
void startup ()
 Startup the game instance. More...
 
void shutdown ()
 Shutdown the game instance. More...
 
float getGameSpeed () const
 Get the current game speed. More...
 
void setGameSpeed (float gameSpeed)
 Set the game speed; default is 1.0f, pause the game with 0.0f. More...
 
void setGameSpeed (float gameSpeed, bool force)
 Set the game speed. More...
 
void pauseGame (bool multiplayerClientStarvationPause=false)
 Pauses the game (stores the current game speed) More...
 
void resumeGame ()
 Resumes the game (restores the game speed) More...
 
bool isMultiplayerClientStarvationPause () const
 Is this a game pause due to multiplayer client starvation? More...
 

Static Public Attributes

static const uint32 FIRE_SIMULATION_INPUT_HANDLER_ID
 
- Static Public Attributes inherited from qsf::game::Game
static const uint32 GAME_SPEED_CHANGE_MESSAGE_ID
 
static const uint32 GAME_INPUT_HANDLER_ID
 
static const uint32 DEBUG_INPUT_HANDLER
 

Protected Member Functions

virtual void onStartup () override
 
virtual void onShutdown () override
 
virtual void onUpdateGame (const qsf::Clock &realtimeClock) override
 
virtual void onGameSpeedChange (float newGameSpeed, float oldGameSpeed) override
 
- Protected Member Functions inherited from qsf::UniqueInstance< Game >
 UniqueInstance ()
 Default constructor. More...
 
virtual ~UniqueInstance ()
 Destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from qsf::UniqueInstance< Game >
static Game * getInstance ()
 Return the global unique instance. More...
 
static Game & getInstanceSafe ()
 Return the global unique instance. More...
 
- Protected Attributes inherited from qsf::game::Game
float mGameSpeed
 Game speed: a multiplier for game time progress relative to real-time progress; default is 1.0f for "normal" game speed. More...
 

Detailed Description

EMERGENCY 5 game class.

Constructor & Destructor Documentation

em5::Game::Game ( )

Default constructor.

virtual em5::Game::~Game ( )
virtual

Destructor.

Reimplemented from qsf::game::Game.

Member Function Documentation

GameAnimation & em5::Game::getAnimation ( ) const
inline

Return the game animation instance.

const CampaignDefinition& em5::Game::getCampaignDefinitionByIndex ( uint32  campaignIndex)

Return a campaign definition.

const std::vector<CampaignDefinition*>& em5::Game::getCampaignDefinitions ( ) const

Return campaign definitions.

uint32 em5::Game::getCampaignIndexByMainEventNumber ( uint32  mainEventNumber) const

Return a campaign index by using a given main event number.

Remarks
Campaign index 0: ME01 ... ME15 Campaign index 1: ME100 ... ME104 Campaign index 2: ME200 ... ME204 Campaign index 3: ME301 ... ME310
CutscenePlayer & em5::Game::getCutscenePlayer ( ) const
inline

Return the cutscene player.

qsf::game::GameCounterManager & em5::Game::getGameCounterManager ( ) const
inline

Return the game counter manager.

GameSessionConfiguration & em5::Game::getGameSessionConfiguration ( ) const
inline

Return the game session configuration.

qsf::game::GameTimerManager & em5::Game::getGameTimerManager ( ) const
inline

Return the game timer manager.

GangsterTypeManager & em5::Game::getGangsterTypeManager ( ) const
inline

Returns the gangster type manager.

HintSystem & em5::Game::getHintSystem ( ) const
inline

Returns the hint system.

qsf::CameraComponent* em5::Game::getMainCamera ( ) const

Get the main camera.

bool em5::Game::getMapAndCampaignInfoByMainEventNumber ( uint32  mainEventNumber,
MapIdentifier outMapIdentifier,
uint32 outCampaignIndex,
uint32 outCampaignPhaseIndex 
) const

Return all data needed to directly launch a main event.

See also
"getCampaignIndexByMainEventNumber"
MiniMapIconRegistrationLogic& em5::Game::getMiniMapIconRegistrationLogic ( ) const

Return the game mini map registration logic instance.

OrderInfoManager & em5::Game::getOrderInfoManager ( ) const
inline

Returns the order info manager.

OverlayManager & em5::Game::getOverlayManager ( ) const
inline

Return the overlay manager.

PlayerManager & em5::Game::getPlayerManager ( ) const
inline

Return the player manager.

const RightsManager & em5::Game::getRightsManager ( ) const
inline

Return the rights manager.

Returns
The rights manager
SelectionManager & em5::Game::getSelectionManager ( ) const
inline

Return the game's selection manager.

GameSimulation & em5::Game::getSimulation ( ) const
inline

Return the game simulation instance.

const qsf::Clock& em5::Game::getSimulationClock ( ) const

Shortcut method to return the game simulation clock.

qsf::SoundTrackManager & em5::Game::getSoundTrackManager ( ) const
inline

Return sound track manager instance.

SpecsGroupManager & em5::Game::getSpecsGroupManager ( ) const
inline

Returns the specs group manager.

qsf::logic::TargetPointManager & em5::Game::getTargetPointManager ( ) const
inline

Return the target point manager.

bool em5::Game::isGameInteractionBlocked ( ) const

Returns whether the game interaction (camera movement, selection, commands, most of in-game GUI) is blocked.

Note
  • This is the case when pausing the game in EM20 missions (to stay consistent with old EM titles)
bool em5::Game::loadGame ( const std::string &  filename)

Load the game from the given file.

virtual void em5::Game::onGameSpeedChange ( float  newGameSpeed,
float  oldGameSpeed 
)
overrideprotectedvirtual

Reimplemented from qsf::game::Game.

void em5::Game::onLoadComplete ( )
virtual void em5::Game::onShutdown ( )
overrideprotectedvirtual

Reimplemented from qsf::game::Game.

virtual void em5::Game::onStartup ( )
overrideprotectedvirtual

Reimplemented from qsf::game::Game.

virtual void em5::Game::onUpdateGame ( const qsf::Clock realtimeClock)
overrideprotectedvirtual

Reimplemented from qsf::game::Game.

void em5::Game::prepareMap ( qsf::Map map,
bool  wasLoadedBefore 
)
bool em5::Game::saveGame ( const std::string &  filename)

Save the game to the given file.

void em5::Game::serialize ( qsf::BinarySerializer serializer)

Serialization of the whole game.

void em5::Game::setMainCamera ( qsf::CameraComponent cameraComponent)

Set the main camera.

Member Data Documentation

const uint32 em5::Game::FIRE_SIMULATION_INPUT_HANDLER_ID
static

The documentation for this class was generated from the following files: