Emergency 20 Dokumentation  4.2.0
GameSessionConfiguration.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 #include "em5/map/MapIdentifier.h"
15 
16 #include <qsf/math/Color4.h>
17 
18 #include <vector>
19 
20 
21 //[-------------------------------------------------------]
22 //[ Forward declarations ]
23 //[-------------------------------------------------------]
24 namespace em5
25 {
26  class CampaignProgress;
27 }
28 
29 
30 //[-------------------------------------------------------]
31 //[ Namespace ]
32 //[-------------------------------------------------------]
33 namespace em5
34 {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Classes ]
39  //[-------------------------------------------------------]
45  {
46 
47 
48  //[-------------------------------------------------------]
49  //[ Public definitions ]
50  //[-------------------------------------------------------]
51  public:
53  {
54  EMERGENCY_5_CAMPAIGN = 0,
55  EMERGENCY_2016_CAMPAIGN = 1,
56  EMERGENCY_2017_CAMPAIGN = 2,
57  EMERGENCY_20YEARS_MISSIONS = 3
58  };
59 
61  {
62  std::string mName;
63  bool mIsLocal;
69 
70  PlayerMetadata() : mIsLocal(false), mEdition(0), mPlayerIndex(0), mTeamId(qsf::getUninitialized<uint16>()), mUserData(qsf::getUninitialized<uint32>()){}
71  };
72  typedef std::vector<PlayerMetadata> PlayerArray;
73 
74  static const uint32 MAXIMUM_NUMBER_OF_CAMPAIGNS = 4;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Public static methods ]
79  //[-------------------------------------------------------]
80  public:
85  static gamemode::Type getGameModeTypeByClassName(const std::string& className);
86 
87 
88  //[-------------------------------------------------------]
89  //[ Public methods ]
90  //[-------------------------------------------------------]
91  public:
97 
103 
108  const std::string& getGameModeClassName() const;
109 
114  gamemode::Type getGameModeType() const;
115 
120  bool isGameModeCampaign() const;
121 
126  bool isGameModeFreeplay() const;
127 
132  bool isGameModeMultiplay() const;
133 
138  bool isTutorialActive() const;
139 
144  const MapIdentifier& getMapIdentifier() const;
145 
150  uint32 getCampaignPhaseIndex() const;
151 
156  const PlayerArray& getPlayers() const;
157 
162  bool isSingleMainEvent() const;
163 
168  uint32 getSingleMainEventNumber() const;
169 
174  uint32 getSingleMainEventPhaseIndex() const;
175 
180  void reset();
181 
194  void setupForCampaign(CampaignProgress* campaignProgress, uint32 campaignIndex, bool tutorialActive, const std::string& gameModeClassName = "");
195 
200  void setupForSingleMainEvent(uint32 mainEventNumber, const MapIdentifier& mapIdentifier, uint32 campaignIndex, uint32 campaignPhaseIndex, bool tutorialActive, const std::string& gameModeClassName = "");
201 
206  void setupForFreeplay(const MapIdentifier& mapIdentifier, const std::string& gameModeClassName = "");
207 
212  void setupForChallengeFreeplay(const MapIdentifier& mapIdentifier, const std::string& gameModeClassName = "");
213 
224  void setupForMultiplayCoop(const MapIdentifier& mapIdentifier, uint32 durationInMinutes, const std::string& gameModeClassName = "");
225 
236  void setupForMultiplayPvp(const MapIdentifier& mapIdentifier, uint32 durationInMinutes, const std::string& gameModeClassName = "");
237 
242  void setupForBenchmark(const std::string& gameModeClassName = "");
243 
248  PlayerMetadata& addPlayer(bool local = true);
249 
250 
251  //[-------------------------------------------------------]
252  //[ Public data ]
253  //[-------------------------------------------------------]
254  public:
255  std::string mGameModeClassName;
259  PlayerArray mPlayers;
260  std::shared_ptr<CampaignProgress> mCampaignProgress;
264 
265 
266  };
267 
268 
269 //[-------------------------------------------------------]
270 //[ Namespace ]
271 //[-------------------------------------------------------]
272 } // em5
bool mTutorialActive
"true" if tutorial should be active (ignored depending on game mode and map)
Definition: GameSessionConfiguration.h:256
Definition: ActionPriority.h:13
EMERGENCY 5 campaign progress class.
Definition: CampaignProgress.h:51
uint16 mTeamId
Definition: GameSessionConfiguration.h:66
CampaignIndex
Definition: GameSessionConfiguration.h:52
std::shared_ptr< CampaignProgress > mCampaignProgress
The campaign progress to be used, only valid when game mode is campaign.
Definition: GameSessionConfiguration.h:260
Color class with red, green, blue and alpha component.
Definition: Color4.h:39
unsigned int uint32
Definition: PlatformTypes.h:181
uint32 mPlayerIndex
Definition: GameSessionConfiguration.h:65
#define EM5_API_EXPORT
Definition: Export.h:28
PlayerMetadata()
Definition: GameSessionConfiguration.h:70
Definition: GameSessionConfiguration.h:60
PlayerArray mPlayers
Players.
Definition: GameSessionConfiguration.h:259
Definition: PickupPersonByParamedicAction.h:21
uint32 mUserData
Definition: GameSessionConfiguration.h:68
std::string mGameModeClassName
Game mode CAMP class name: one of campaign, freeplay, multiplay.
Definition: GameSessionConfiguration.h:255
uint32 mSingleMainEventPhaseIndex
Single main event only: Index of the campaign phase to start.
Definition: GameSessionConfiguration.h:262
T getUninitialized()
Definition: GetUninitialized.h:38
std::vector< PlayerMetadata > PlayerArray
Definition: GameSessionConfiguration.h:72
EMERGENCY 5 map identifier class.
Definition: MapIdentifier.h:34
EMERGENCY 5 game session configuration.
Definition: GameSessionConfiguration.h:44
unsigned short uint16
Definition: PlatformTypes.h:178
uint32 mCampaignIndex
Index of campaign to play (only campaign game mode)
Definition: GameSessionConfiguration.h:257
MapIdentifier mMapIdentifier
Map identifier for the selected map.
Definition: GameSessionConfiguration.h:258
bool mIsLocal
Definition: GameSessionConfiguration.h:63
uint8 mEdition
Definition: GameSessionConfiguration.h:64
std::string mName
Definition: GameSessionConfiguration.h:62
uint32 mGameDurationInMinutes
Duration of the game session in minutes, 0 for endless mode.
Definition: GameSessionConfiguration.h:263
uint32 mSingleMainEventNumber
Single main event only: Number of main event (e.g. 302 for EM20 mission "Street Race") ...
Definition: GameSessionConfiguration.h:261
Type
Definition: GameModeType.h:21
unsigned char uint8
Definition: PlatformTypes.h:175
qsf::Color4 mPlayerColor
Definition: GameSessionConfiguration.h:67