Emergency 20 Dokumentation  4.2.0
em5::GameSessionConfiguration Class Reference

EMERGENCY 5 game session configuration. More...

#include <GameSessionConfiguration.h>

Classes

struct  PlayerMetadata
 

Public Types

enum  CampaignIndex { EMERGENCY_5_CAMPAIGN = 0, EMERGENCY_2016_CAMPAIGN = 1, EMERGENCY_2017_CAMPAIGN = 2, EMERGENCY_20YEARS_MISSIONS = 3 }
 
typedef std::vector< PlayerMetadataPlayerArray
 

Public Member Functions

 GameSessionConfiguration ()
 Default constructor. More...
 
 ~GameSessionConfiguration ()
 Destructor. More...
 
const std::string & getGameModeClassName () const
 Return the game mode CAMP class name. More...
 
gamemode::Type getGameModeType () const
 Return the game mode type; multiple game mode class implementations can use the same game mode type. More...
 
bool isGameModeCampaign () const
 Returns "true" if the game is running in campaign mode. More...
 
bool isGameModeFreeplay () const
 Returns "true" if the game is running in freeplay mode. More...
 
bool isGameModeMultiplay () const
 Returns "true" if the game is running in multiplayer mode. More...
 
bool isTutorialActive () const
 Returns "true" if tutorial should be active (ignored depending on game mode and map) More...
 
const MapIdentifiergetMapIdentifier () const
 Return the map identifier. More...
 
uint32 getCampaignPhaseIndex () const
 Return the campaign phase index inside the map. More...
 
const PlayerArraygetPlayers () const
 Return the list of players. More...
 
bool isSingleMainEvent () const
 Return whether or not a single main event is played exclusively. More...
 
uint32 getSingleMainEventNumber () const
 Return the number of the single main event (0 for tutorial, 1..15 for EM5 main events, 100..104 for EM2016, etc.) More...
 
uint32 getSingleMainEventPhaseIndex () const
 Return the index of the single main event campaign phase. More...
 
void reset ()
 Reset to defaults. More...
 
void setupForCampaign (CampaignProgress *campaignProgress, uint32 campaignIndex, bool tutorialActive, const std::string &gameModeClassName="")
 Setup for campaign mode. More...
 
void setupForSingleMainEvent (uint32 mainEventNumber, const MapIdentifier &mapIdentifier, uint32 campaignIndex, uint32 campaignPhaseIndex, bool tutorialActive, const std::string &gameModeClassName="")
 Setup for single main event. More...
 
void setupForFreeplay (const MapIdentifier &mapIdentifier, const std::string &gameModeClassName="")
 Setup for freeplay mode. More...
 
void setupForChallengeFreeplay (const MapIdentifier &mapIdentifier, const std::string &gameModeClassName="")
 Setup for challenge freeplay mode. More...
 
void setupForMultiplayCoop (const MapIdentifier &mapIdentifier, uint32 durationInMinutes, const std::string &gameModeClassName="")
 Setup for multiplay coop mode. More...
 
void setupForMultiplayPvp (const MapIdentifier &mapIdentifier, uint32 durationInMinutes, const std::string &gameModeClassName="")
 Setup for multiplay pvp mode. More...
 
void setupForBenchmark (const std::string &gameModeClassName="")
 Setup for benchmark mode. More...
 
PlayerMetadataaddPlayer (bool local=true)
 Add a new player. More...
 

Static Public Member Functions

static gamemode::Type getGameModeTypeByClassName (const std::string &className)
 Return the game mode type by using a given CAMP class name; multiple game mode class implementations can use the same game mode type. More...
 

Public Attributes

std::string mGameModeClassName
 Game mode CAMP class name: one of campaign, freeplay, multiplay. More...
 
bool mTutorialActive
 "true" if tutorial should be active (ignored depending on game mode and map) More...
 
uint32 mCampaignIndex
 Index of campaign to play (only campaign game mode) More...
 
MapIdentifier mMapIdentifier
 Map identifier for the selected map. More...
 
PlayerArray mPlayers
 Players. More...
 
std::shared_ptr< CampaignProgressmCampaignProgress
 The campaign progress to be used, only valid when game mode is campaign. More...
 
uint32 mSingleMainEventNumber
 Single main event only: Number of main event (e.g. 302 for EM20 mission "Street Race") More...
 
uint32 mSingleMainEventPhaseIndex
 Single main event only: Index of the campaign phase to start. More...
 
uint32 mGameDurationInMinutes
 Duration of the game session in minutes, 0 for endless mode. More...
 

Static Public Attributes

static const uint32 MAXIMUM_NUMBER_OF_CAMPAIGNS = 4
 Maximum number of possible campaigns, use the dynamic "em5::VersionSwitch::getNumberOfCampaigns()" whenever possible instead. More...
 

Detailed Description

EMERGENCY 5 game session configuration.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
EMERGENCY_5_CAMPAIGN 
EMERGENCY_2016_CAMPAIGN 
EMERGENCY_2017_CAMPAIGN 
EMERGENCY_20YEARS_MISSIONS 

Constructor & Destructor Documentation

em5::GameSessionConfiguration::GameSessionConfiguration ( )

Default constructor.

em5::GameSessionConfiguration::~GameSessionConfiguration ( )

Destructor.

Member Function Documentation

PlayerMetadata& em5::GameSessionConfiguration::addPlayer ( bool  local = true)

Add a new player.

uint32 em5::GameSessionConfiguration::getCampaignPhaseIndex ( ) const

Return the campaign phase index inside the map.

const std::string& em5::GameSessionConfiguration::getGameModeClassName ( ) const

Return the game mode CAMP class name.

gamemode::Type em5::GameSessionConfiguration::getGameModeType ( ) const

Return the game mode type; multiple game mode class implementations can use the same game mode type.

static gamemode::Type em5::GameSessionConfiguration::getGameModeTypeByClassName ( const std::string &  className)
static

Return the game mode type by using a given CAMP class name; multiple game mode class implementations can use the same game mode type.

const MapIdentifier& em5::GameSessionConfiguration::getMapIdentifier ( ) const

Return the map identifier.

const PlayerArray& em5::GameSessionConfiguration::getPlayers ( ) const

Return the list of players.

uint32 em5::GameSessionConfiguration::getSingleMainEventNumber ( ) const

Return the number of the single main event (0 for tutorial, 1..15 for EM5 main events, 100..104 for EM2016, etc.)

uint32 em5::GameSessionConfiguration::getSingleMainEventPhaseIndex ( ) const

Return the index of the single main event campaign phase.

bool em5::GameSessionConfiguration::isGameModeCampaign ( ) const

Returns "true" if the game is running in campaign mode.

bool em5::GameSessionConfiguration::isGameModeFreeplay ( ) const

Returns "true" if the game is running in freeplay mode.

bool em5::GameSessionConfiguration::isGameModeMultiplay ( ) const

Returns "true" if the game is running in multiplayer mode.

bool em5::GameSessionConfiguration::isSingleMainEvent ( ) const

Return whether or not a single main event is played exclusively.

bool em5::GameSessionConfiguration::isTutorialActive ( ) const

Returns "true" if tutorial should be active (ignored depending on game mode and map)

void em5::GameSessionConfiguration::reset ( )

Reset to defaults.

void em5::GameSessionConfiguration::setupForBenchmark ( const std::string &  gameModeClassName = "")

Setup for benchmark mode.

void em5::GameSessionConfiguration::setupForCampaign ( CampaignProgress campaignProgress,
uint32  campaignIndex,
bool  tutorialActive,
const std::string &  gameModeClassName = "" 
)

Setup for campaign mode.

Parameters
[in]campaignProgressThe campaign progress instance to be used. When a nullptr is given then a new campaign is started (on map Munich with first phase) Note: The game session configuration takes ownership of this instance
[in]campaignIndexIndex of the campaign to play
[in]valueIndicates of the tutorial is active
void em5::GameSessionConfiguration::setupForChallengeFreeplay ( const MapIdentifier mapIdentifier,
const std::string &  gameModeClassName = "" 
)

Setup for challenge freeplay mode.

void em5::GameSessionConfiguration::setupForFreeplay ( const MapIdentifier mapIdentifier,
const std::string &  gameModeClassName = "" 
)

Setup for freeplay mode.

void em5::GameSessionConfiguration::setupForMultiplayCoop ( const MapIdentifier mapIdentifier,
uint32  durationInMinutes,
const std::string &  gameModeClassName = "" 
)

Setup for multiplay coop mode.

Parameters
[in]durationInMinutesDuration of the game session in minutes, 0 for endless mode
Remarks
There are no players added, you have to do this afterwards.
void em5::GameSessionConfiguration::setupForMultiplayPvp ( const MapIdentifier mapIdentifier,
uint32  durationInMinutes,
const std::string &  gameModeClassName = "" 
)

Setup for multiplay pvp mode.

Parameters
[in]durationInMinutesDuration of the game session in minutes, 0 for endless mode
Remarks
There are no players added, you have to do this afterwards.
void em5::GameSessionConfiguration::setupForSingleMainEvent ( uint32  mainEventNumber,
const MapIdentifier mapIdentifier,
uint32  campaignIndex,
uint32  campaignPhaseIndex,
bool  tutorialActive,
const std::string &  gameModeClassName = "" 
)

Setup for single main event.

Member Data Documentation

const uint32 em5::GameSessionConfiguration::MAXIMUM_NUMBER_OF_CAMPAIGNS = 4
static

Maximum number of possible campaigns, use the dynamic "em5::VersionSwitch::getNumberOfCampaigns()" whenever possible instead.

uint32 em5::GameSessionConfiguration::mCampaignIndex

Index of campaign to play (only campaign game mode)

std::shared_ptr<CampaignProgress> em5::GameSessionConfiguration::mCampaignProgress

The campaign progress to be used, only valid when game mode is campaign.

uint32 em5::GameSessionConfiguration::mGameDurationInMinutes

Duration of the game session in minutes, 0 for endless mode.

std::string em5::GameSessionConfiguration::mGameModeClassName

Game mode CAMP class name: one of campaign, freeplay, multiplay.

MapIdentifier em5::GameSessionConfiguration::mMapIdentifier

Map identifier for the selected map.

PlayerArray em5::GameSessionConfiguration::mPlayers

Players.

uint32 em5::GameSessionConfiguration::mSingleMainEventNumber

Single main event only: Number of main event (e.g. 302 for EM20 mission "Street Race")

uint32 em5::GameSessionConfiguration::mSingleMainEventPhaseIndex

Single main event only: Index of the campaign phase to start.

bool em5::GameSessionConfiguration::mTutorialActive

"true" if tutorial should be active (ignored depending on game mode and map)


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