Emergency 20 Dokumentation  4.2.0
ObjectiveHelper.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 
15 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21  class Objective;
22 }
23 namespace qsf
24 {
25  class Entity;
26 }
27 
28 
29 //[-------------------------------------------------------]
30 //[ Namespace ]
31 //[-------------------------------------------------------]
32 namespace em5
33 {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
43  class EM5_API_EXPORT ObjectiveHelper : public boost::noncopyable
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public definitions ]
49  //[-------------------------------------------------------]
50  public:
51  // Objectives
66 
97 
116 
117 
118  //[-------------------------------------------------------]
119  //[ Public static methods ]
120  //[-------------------------------------------------------]
121  public:
134  static bool initializeObjectiveByKey(uint32 objectiveTypeId, Objective& objective);
135 
136 
137  //[-------------------------------------------------------]
138  //[ Public methods ]
139  //[-------------------------------------------------------]
140  public:
145  explicit ObjectiveHelper(FreeplayEvent& freeplayEvent);
146 
151  virtual ~ObjectiveHelper();
152 
157  const FreeplayEvent::ObjectiveInstanceMap& getObjectives() const;
158 
166  Objective* getObjectiveByTypeId(uint32 typeId) const;
167 
175  Objective& getObjectiveByTypeIdSafe(uint32 typeId) const;
176 
181  Objective& getOrCreateObjectiveByTypeId(uint32 typeId) const;
182 
190  Objective& getOrCreateObjective(uint32 typeId, const Objective::ObjectiveType type, const std::string& text = "", uint32 orderPriority = 100) const;
191 
196  void removeObjectiveByTypeId(uint32 typeId) const;
197 
202  void clearObjectives() const;
203 
208  Objective& addDeadCivilPersonsFailCondition(uint32 limit);
209  Objective& addDeadUnitPersonsFailCondition(uint32 limit);
210  Objective& addDeadPersonsFailCondition(uint32 limit);
211 
216  Objective& addInjuredCivilPersonsFailCondition(uint32 limit);
217  Objective& addInjuredUnitPersonsFailCondition(uint32 limit);
218  Objective& addInjuredPersonsFailCondition(uint32 limit);
219 
224  Objective& addUnitsLostFailCondition(uint32 limit);
225 
230  Objective& addEscapedGangstersFailCondition(uint32 limit);
231 
236  Objective& addBurningObjectsFailCondition(uint32 limit);
237  Objective& addBurningBuildingsFailCondition(uint32 limit);
238  Objective& addBurningObjectsAndBuildingsFailCondition(uint32 limit);
239 
240 
241  //[-------------------------------------------------------]
242  //[ Private data ]
243  //[-------------------------------------------------------]
244  private:
245  FreeplayEvent& mEvent;
246 
247 
248  };
249 
250 
251 //[-------------------------------------------------------]
252 //[ Namespace ]
253 //[-------------------------------------------------------]
254 } // em5
static const uint32 OBJECTIVE_NEED_PERSONFROMTRAINTRACK
"PersonFromTrainTrack": Player need to bring persons from train tracks to land
Definition: ObjectiveHelper.h:74
Definition: ActionPriority.h:13
static const uint32 OBJECTIVE_NEED_RESCUEPERSONWITHHELI
"RescuePersonWithHeli": Rescue injures persons with heli
Definition: ObjectiveHelper.h:81
static const uint32 OBJECTIVE_NEED_FINDBOMBINCASE
"FindBombInCase": Send police dog leader to search cases with bomb
Definition: ObjectiveHelper.h:95
static const uint32 OBJECTIVE_NEED_SAVEWAVINGPERSON
"SaveWavingPerson": Player needs to save person with the DLK
Definition: ObjectiveHelper.h:57
static const uint32 OBJECTIVE_NEED_CHASEAWAYHOTELPROTESTER
"ChaseAwayHotelProtester": Chase away hotel protester
Definition: ObjectiveHelper.h:86
static const uint32 OBJECTIVE_FAIL_DAMAGESQUADVEHICLES
"NoDamagedSquadVehicles": Player must prevent squad vehicles from being damaged
Definition: ObjectiveHelper.h:108
static const uint32 OBJECTIVE_NEED_FINDKILLERWITHSEKDRONE
"FindKillerWithSEKDrone": PLayer needs to find the killer with the SEK drone
Definition: ObjectiveHelper.h:65
static const uint32 OBJECTIVE_NEED_PERSONSBURIEDHEAVYDEBRIS2
"PersonsBuriedHeavyDebris2": Save all injured persons under debris which needs a crane ...
Definition: ObjectiveHelper.h:80
static const uint32 OBJECTIVE_NEED_TAKEGANGSTEROUTSIDE_POLICE
"TakeGangsterOutsidePolice": Send police in building with gangster
Definition: ObjectiveHelper.h:88
static const uint32 OBJECTIVE_NEED_TAKEGANGSTEROUTSIDE_SEK
"TakeGangsterOutsideSEK": Send police in building with gangster
Definition: ObjectiveHelper.h:89
static const uint32 OBJECTIVE_NEED_SPEAKTO_HOSTAGETAKER
"SpeakToHostageTaker": Send police to talk with gangster in building
Definition: ObjectiveHelper.h:91
static const uint32 OBJECTIVE_NEED_EXTINGUISHEBOXES
"ExtinguishEBoxes": Extinguish all burning eboxes
Definition: ObjectiveHelper.h:70
unsigned int uint32
Definition: PlatformTypes.h:181
static const uint32 OBJECTIVE_NEED_PERSONSBURIEDHEAVYDEBRIS
"PersonsBuriedHeavyDebris": Save all injured persons under debris which needs a crane ...
Definition: ObjectiveHelper.h:79
static const uint32 OBJECTIVE_FAIL_EXPLODED_BOMBS
"NoBombsExploded": Player must not let bombs explode
Definition: ObjectiveHelper.h:112
#define EM5_API_EXPORT
Definition: Export.h:28
static const uint32 OBJECTIVE_NEED_DECONTAMINATEPERSONS
"DecontaminatePersons": Player needs to decontaminate all contaminated persons
Definition: ObjectiveHelper.h:58
static const uint32 OBJECTIVE_FAIL_TOOMANYPROTESTER
"TooMayProtester": Player must keep a demonstration under a certain number of protester ...
Definition: ObjectiveHelper.h:115
static const uint32 OBJECTIVE_NEED_RESCUEWITCH
"RescueWitch": Use guardsman to rescue witch from pyre
Definition: ObjectiveHelper.h:96
static const uint32 OBJECTIVE_NEED_FREEPERSONSFROMBUILDING
"FreePersonsFromBuilding": Player needs to take injured persons out of building
Definition: ObjectiveHelper.h:77
static const uint32 OBJECTIVE_NEED_DISPOSEBOMB
"DisposeBomb": Player needs to dispose bomb with SEK robot
Definition: ObjectiveHelper.h:64
static const uint32 OBJECTIVE_NEED_STOPCARTHIEF
"StopCarThief": Player needs to chase all stolen cars with police helicopter and stop them ...
Definition: ObjectiveHelper.h:62
static const uint32 OBJECTIVE_NEED_TRANSPORTCRIMINALPERSON
"TransportCriminalPerson": Player needs to transport treated criminal persons to the head quarters ...
Definition: ObjectiveHelper.h:61
static const uint32 OBJECTIVE_FAIL_PERSONSESCAPE
"PersonsEscape": Criminal persons escape from the map
Definition: ObjectiveHelper.h:113
static const uint32 OBJECTIVE_FAIL_GANGSTERNOTFOUND
"NoFindGangster": Player must find gangster in given time
Definition: ObjectiveHelper.h:114
static const uint32 OBJECTIVE_NEED_REPAIRTRACKELECTRIC
"RepairTrackElectric": Send engineer to disable ebox for train tracks
Definition: ObjectiveHelper.h:85
static const uint32 OBJECTIVE_NEED_TAKETERRORISTOUTSIDE_SEK
"TakeTerroristOutsideSEK": Send police in building with gangster (terrorist)
Definition: ObjectiveHelper.h:90
static const uint32 OBJECTIVE_FAIL_BURNING_OBJECTANDBUILDING
"NoObjectAndBuildingIsBurning": Player must extinguish burning object AND buildings ...
Definition: ObjectiveHelper.h:111
static const uint32 OBJECTIVE_NEED_TALK_TO_PERSON
"TalkToPerson": Send police to talk with person
Definition: ObjectiveHelper.h:92
static const uint32 OBJECTIVE_NEED_RESCUEPERSONSFROMTRAINTRACK
"RescuePersonsFromTrainTrack": Rescue injured persons from (electirc) train track ...
Definition: ObjectiveHelper.h:82
static const uint32 OBJECTIVE_NEED_PERSONHANGONTRAINTRACK
"PersonHangOnTrainTrack": Player need to bring hanging persons from train tracks to land ...
Definition: ObjectiveHelper.h:73
static const uint32 OBJECTIVE_NEED_BRINGPERSONTOLAND
"BringPersonToLand": Player needs to bring the rescued person to land
Definition: ObjectiveHelper.h:72
static const uint32 OBJECTIVE_NEED_EXTINGUISHFIRES
"ExtinguishFires": Player needs to extinguish all fires
Definition: ObjectiveHelper.h:55
static const uint32 OBJECTIVE_NEED_TRANSPORTPLAGUEPERSON
"TransportPlaguePersons": Player needs to transport all plague infected or injured persons to the hea...
Definition: ObjectiveHelper.h:54
EMERGENCY 5 objective class.
Definition: Objective.h:51
Definition: PickupPersonByParamedicAction.h:21
static const uint32 OBJECTIVE_NEED_TREATCRIMINALPERSON
"TreatCriminalPerson": Player needs to treat injured criminal persons
Definition: ObjectiveHelper.h:60
EMERGENCY 5 objective helper class.
Definition: ObjectiveHelper.h:43
ObjectiveType
Definition: Objective.h:70
static const uint32 OBJECTIVE_FAIL_DEADPERSONS
"NoDead": Player must prevent persons from dying
Definition: ObjectiveHelper.h:100
static const uint32 OBJECTIVE_FAIL_BURNING_BUILDINGS
"NoBurningBuildings": Player must extinguish burning buildings
Definition: ObjectiveHelper.h:109
static const uint32 OBJECTIVE_FAIL_DESTROYEDOBJECTS
"NoDestroyedObjects": Player must prevent objects from being destroyed
Definition: ObjectiveHelper.h:103
static const uint32 OBJECTIVE_FAIL_CONTAMINATEDPERSONS
"NoContaminationPersons": Player must prevent persons from being contaminated (squad + civil) ...
Definition: ObjectiveHelper.h:99
static const uint32 OBJECTIVE_NEED_FINDPERSON
"FindPerson": Player needs to find the hidden person
Definition: ObjectiveHelper.h:75
static const uint32 OBJECTIVE_FAIL_TIMER
"Timer": The player must finish the event in a given amount of time
Definition: ObjectiveHelper.h:98
static const uint32 OBJECTIVE_FAIL_BURNING_OBJECTS
"NoObjectIsBurning": Player must extinguish burning objects
Definition: ObjectiveHelper.h:110
static const uint32 OBJECTIVE_FAIL_UNITS_LOST
"UnitsLost": Player must prevent units from being injured (persons) or damaged (vehicles) ...
Definition: ObjectiveHelper.h:107
static const uint32 OBJECTIVE_NEED_HEALPERSONS
"HealPersons": Person was healed and has no injury anymore
Definition: ObjectiveHelper.h:68
static const uint32 OBJECTIVE_NEED_TRANSPORTINJURED
"TransportPersons": Player needs to transport treated persons to the head quarters ...
Definition: ObjectiveHelper.h:53
static const uint32 OBJECTIVE_NEED_REPAIREBOXES
"RepairEBoxes": Repair all defect EBoxes
Definition: ObjectiveHelper.h:69
static const uint32 OBJECTIVE_NEED_GETPERSONOUTOFCAR
"GetPersonOutOfCar": Player needs to take injured persons out of vehicle
Definition: ObjectiveHelper.h:67
static const uint32 OBJECTIVE_FAIL_INJUREDPERSONS
"NoInjuredPersons": Player must prevent persons from being injured (squad + civil) ...
Definition: ObjectiveHelper.h:106
static const uint32 OBJECTIVE_NEED_RETRIEVEVEHICLE
"RetrieveVehicle": Player needs to move a stolen vehicle to the HQ
Definition: ObjectiveHelper.h:63
static const uint32 OBJECTIVE_NEED_SAWBURYINGTREE
"SawBuryingTree": Remove a cuttable tree that is burying a person or vehicle
Definition: ObjectiveHelper.h:87
static const uint32 OBJECTIVE_NEED_ARRESTPERSONS
"ArrestPersons": Player needs to arrest and transport the criminal persons
Definition: ObjectiveHelper.h:59
static const uint32 OBJECTIVE_NEED_PERSONSBURIEDLIGHTDEBRIS
"PersonsBuriedLightDebris": Save all injured persons under debris which needs a fireman or a crane ...
Definition: ObjectiveHelper.h:78
static const uint32 OBJECTIVE_FAIL_INJUREDSQUAD
"NoInjuredSquad": Player must prevent squad persons from being injured
Definition: ObjectiveHelper.h:105
static const uint32 OBJECTIVE_NEED_QUICKTESTPERSONS
"QuicktestPersons": Player needs a plague quick test for the contaminated persons ...
Definition: ObjectiveHelper.h:83
static const uint32 OBJECTIVE_FAIL_DESTROYEDVEHICLES
"NoDestroyedVehicles": Player must prevent vehicles from being destroyed
Definition: ObjectiveHelper.h:102
static const uint32 OBJECTIVE_FAIL_DEADSQUADPERSONS
"NoDeadSquad": Player must prevent squad persons from dying
Definition: ObjectiveHelper.h:101
static const uint32 OBJECTIVE_NEED_TAKEHOSTAGEOUTSIDE
"TakeHostageOutside": Send police in building with hostage
Definition: ObjectiveHelper.h:93
ObjectiveList::ObjectiveInstanceMap ObjectiveInstanceMap
Definition: FreeplayEvent.h:107
static const uint32 OBJECTIVE_NEED_CHASEAWAYPROTESTER
"ChaseAwayProtester": Chase away protester
Definition: ObjectiveHelper.h:76
static const uint32 OBJECTIVE_NEED_RESCUEDROWNING
"RescueDrowning": Player needs to dive and rescue the drowning person
Definition: ObjectiveHelper.h:71
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
static const uint32 OBJECTIVE_NEED_TAKEINJUREDHOSTAGEOUTSIDE
"TakeInjuredHostageOutside": Send Firefighter in building with injured hostage
Definition: ObjectiveHelper.h:94
static const uint32 OBJECTIVE_NEED_CLEANUPVEHICLES
"CleanupVehicles": Player needs to clean up all damaged or destroyed cars
Definition: ObjectiveHelper.h:56
static const uint32 OBJECTIVE_NEED_TREATPERSONS
"TreatPersons": Player needs to treat injured persons
Definition: ObjectiveHelper.h:52
static const uint32 OBJECTIVE_NEED_REPAIRBUILDING
"RepairBuilding": Send engineer in damaged house
Definition: ObjectiveHelper.h:84
static const uint32 OBJECTIVE_FAIL_INJUREDCIVILS
"NoInjuredCivilPersons": Player must prevent civil persons from being injured
Definition: ObjectiveHelper.h:104