Emergency 20 Dokumentation  4.2.0
MedicalInBuildingEvent.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 
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Friends ]
39  //[-------------------------------------------------------]
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public definitions ]
45  //[-------------------------------------------------------]
46  public:
47  static const uint32 FREEPLAY_EVENT_ID;
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public methods ]
52  //[-------------------------------------------------------]
53  public:
59 
64  virtual ~MedicalInBuildingEvent();
65 
70  uint64 getTargetEntityId() const;
71 
76  void setTargetEntity(const qsf::Entity& entity);
77 
82  uint32 getDeadPersonsToFail() const;
83 
88  void setDeadPersonsToFail(uint32 personsToFail);
89 
90  void setAmbientLayerName(const std::string& layerName);
91 
96  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(PersonsInside, bool, mPersonsInside)
97 
98 
102  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(PersonsAtWindow, bool, mPersonsAtWindow)
103 
108  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedPersonsRescueTime, qsf::Time, mTrappedPersonsRescueTime)
109 
114  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedHealthyPersonsMin, uint32, mTrappedHealthyPersonsMin)
115  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedHealthyPersonsMax, uint32, mTrappedHealthyPersonsMax)
116  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedInjuredPersonsMin, uint32, mTrappedInjuredPersonsMin)
117  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedInjuredPersonsMax, uint32, mTrappedInjuredPersonsMax)
118  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedPersonWithPlague, bool, mTrappedPersonWithPlague)
119  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(FailAmountInfectedPersons, int, mFailAmountInfectedPersons)
120 
121  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(SpawnFromConnectedSpawnpools, bool, mSpawnFromConnectedSpawnpools)
122 
127  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(BlockedDoor, bool, mBlockedDoor)
128 
129 
130  //[-------------------------------------------------------]
131  //[ Public virtual em5::FreeplayEvent methods ]
132  //[-------------------------------------------------------]
133  public:
134  virtual bool onStartup() override;
135  virtual void onShutdown() override;
136  virtual void onRun() override;
137  virtual bool onFailure(EventResult& eventResult) override;
138  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
139  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
140  virtual void hintCallback(Observer& hintObserver) override;
141  virtual const qsf::Entity* getFocusEntity() override;
142  virtual bool checkEventConfiguration() override;
143  virtual void serialize(qsf::BinarySerializer& serializer) override;
144 
145 
146  //[-------------------------------------------------------]
147  //[ Private methods ]
148  //[-------------------------------------------------------]
149  private:
150  void startHintObservers(const qsf::Entity& targetEntity);
151 
156  void executeFireWithPersonAtWindow(qsf::Entity& entity);
157 
162  void executeFireWithPersonsInside(qsf::Entity& entity);
163 
164  void spawnPersonsFromConnectedSpawnPoints(qsf::Entity& buildingEntity);
165 
166  int getNumberInfectedPersons();
167 
168 
169  //[-------------------------------------------------------]
170  //[ Private data ]
171  //[-------------------------------------------------------]
172  private:
173  uint64 mTargetEntityId;
174  uint32 mDeadPersonsToFail;
175  bool mPersonsInside;
176  bool mPersonsAtWindow;
177  qsf::Time mTrappedPersonsRescueTime;
178  uint32 mTrappedHealthyPersonsMin;
179  uint32 mTrappedHealthyPersonsMax;
180  uint32 mTrappedInjuredPersonsMin;
181  uint32 mTrappedInjuredPersonsMax;
182  bool mTrappedPersonWithPlague;
183  bool mBlockedDoor;
184  bool mSpawnFromConnectedSpawnpools;
185  uint32 mTrappedPersons;
186  uint32 mTrappedInjuredPersons;
187  std::string mAmbientLayerName;
188 
189  int mFailAmountInfectedPersons;
190 
191  qsf::Time mHint01WaitTime;
192  std::vector<uint64> mVictimSpawnPoints;
193  qsf::MessageProxy mMessageProxyStoppedBurning;
194  qsf::MessageProxy mMessageProxyContaminationStart;
195  qsf::MessageProxy mMessageProxyNeedContaminatedTime;
196 
197 
198  //[-------------------------------------------------------]
199  //[ CAMP reflection system ]
200  //[-------------------------------------------------------]
201  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
202 
203 
204  };
205 
206 
207 //[-------------------------------------------------------]
208 //[ Namespace ]
209 //[-------------------------------------------------------]
210 } // em5
211 
212 
213 //[-------------------------------------------------------]
214 //[ CAMP reflection system ]
215 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
static const uint32 FREEPLAY_EVENT_ID
"em5::MedicalInBuildingEvent" unique freeplay event ID
Definition: MedicalInBuildingEvent.h:47
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: AreaConfiguration.h:58
Reason
Definition: EventSpreadReason.h:20
EMERGENCY 5 freeplay event factory for "medical in building emergency event".
Definition: MedicalInBuildingEventFactory.h:30
uint64_t uint64
Definition: PlatformTypes.h:184
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Definition: PickupPersonByParamedicAction.h:21
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
EMERGENCY 5 freeplay event "medical emergency in building".
Definition: MedicalInBuildingEvent.h:33
#define QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(name, type, variable)
Definition: PropertyHelper.h:16
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66