Emergency 20 Dokumentation  4.2.0
SimpleFireEvent.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 ~SimpleFireEvent();
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 
94  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(Explosion, bool, mExplosion)
95 
96 
100  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(ExplosionRadius, float, mExplosionRadius)
101 
106  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(IndustrialPlant, bool, mIndustrialPlant)
107 
112  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(DefectEbox, bool, mDefectEbox)
113 
118  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(PersonsInside, bool, mPersonsInside)
119 
124  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(PersonsAtWindow, bool, mPersonsAtWindow)
125 
130  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedPersonsRescueTime, qsf::Time, mTrappedPersonsRescueTime)
131 
136  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedHealthyPersonsMin, uint32, mTrappedHealthyPersonsMin)
137  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedHealthyPersonsMax, uint32, mTrappedHealthyPersonsMax)
138  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedInjuredPersonsMin, uint32, mTrappedInjuredPersonsMin)
139  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedInjuredPersonsMax, uint32, mTrappedInjuredPersonsMax)
140  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedPersonWithPlague, bool, mTrappedPersonWithPlague)
141 
142  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(SpawnFromConnectedSpawnpools, bool, mSpawnFromConnectedSpawnpools)
143 
148  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(BlockedDoor, bool, mBlockedDoor)
149 
150  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(InjuredSquadToFail, uint32, mInjuredSquadToFail)
151  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(BurningObjectsToFail, uint32, mBurningObjectsToFail)
152 
153  void setAmbientLayerName(const std::string& ambientLayerName);
154 
155 
156  //[-------------------------------------------------------]
157  //[ Public virtual em5::FreeplayEvent methods ]
158  //[-------------------------------------------------------]
159  public:
160  virtual bool onStartup() override;
161  virtual void onShutdown() override;
162  virtual void onRun() override;
163  virtual bool onFailure(EventResult& eventResult) override;
164  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
165  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
166  virtual void hintCallback(Observer& hintObserver) override;
167  virtual const qsf::Entity* getFocusEntity() override;
168  virtual bool checkEventConfiguration() override;
169  virtual void serialize(qsf::BinarySerializer& serializer) override;
170 
171 
172  //[-------------------------------------------------------]
173  //[ Private methods ]
174  //[-------------------------------------------------------]
175  private:
176  void startObjectives(const qsf::Entity& targetEntity);
177  void startHintObservers(const qsf::Entity& targetEntity);
178 
183  void executeNormalFire(qsf::Entity& entity);
184 
189  void executeFireWithPersonAtWindow(qsf::Entity& entity);
190 
195  void executeFireWithPersonsInside(qsf::Entity& entity);
196 
201  void executeExplosion(qsf::Entity& entity);
202 
207  void executeIndustrialPlantFire(qsf::Entity& entity);
208 
209  void onContaminationStartSpreading(const qsf::MessageParameters& parameters);
210  void onNeedContaminated(const qsf::MessageParameters& parameters);
211  void onPersonSaved(const qsf::MessageParameters& parameters);
212  bool injureSavedPerson(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity);
213  void spawnInContaminationArea(qsf::Entity& buildingEntity);
214  void spawnPersonsFromConnectedSpawnPoints(qsf::Entity& buildingEntity);
215 
216  //[-------------------------------------------------------]
217  //[ Protected data ]
218  //[-------------------------------------------------------]
219  protected:
220  uint64 mTargetEntityId;
221 
222 
223  //[-------------------------------------------------------]
224  //[ Private data ]
225  //[-------------------------------------------------------]
226  private:
227  uint32 mDeadPersonsToFail;
228  uint32 mInjuredSquadToFail;
229  uint32 mBurningObjectsToFail;
230  bool mExplosion;
231  bool mIndustrialPlant;
232  bool mDefectEbox;
233  float mExplosionRadius;
234  uint64 mExplosionId;
235  bool mPersonsInside;
236  bool mPersonsAtWindow;
237  qsf::Time mTrappedPersonsRescueTime;
238  uint32 mTrappedHealthyPersonsMin;
239  uint32 mTrappedHealthyPersonsMax;
240  uint32 mTrappedInjuredPersonsMin;
241  uint32 mTrappedInjuredPersonsMax;
242  bool mTrappedPersonWithPlague;
243  bool mBlockedDoor;
244  bool mSpawnFromConnectedSpawnpools;
245  uint32 mTrappedPersons;
246  uint32 mTrappedInjuredPersons;
247  std::string mAmbientLayerName;
248 
249  qsf::Time mHint01WaitTime;
250  std::vector<uint64> mVictimSpawnPoints;
251  qsf::MessageProxy mMessageProxyStoppedBurning;
252  qsf::MessageProxy mMessageProxyContaminationStart;
253  qsf::MessageProxy mMessageProxyNeedContaminatedTime;
254 
255 
256  //[-------------------------------------------------------]
257  //[ CAMP reflection system ]
258  //[-------------------------------------------------------]
259  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
260 
261 
262  };
263 
264 
265 //[-------------------------------------------------------]
266 //[ Namespace ]
267 //[-------------------------------------------------------]
268 } // em5
269 
270 
271 //[-------------------------------------------------------]
272 //[ CAMP reflection system ]
273 //[-------------------------------------------------------]
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
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: AreaConfiguration.h:58
Reason
Definition: EventSpreadReason.h:20
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
EMERGENCY 5 freeplay event factory for "building fire event".
Definition: BuildingFireEventFactory.h:46
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
EMERGENCY 5 freeplay event "simple fire".
Definition: SimpleFireEvent.h:33
#define QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(name, type, variable)
Definition: PropertyHelper.h:16
static const uint32 FREEPLAY_EVENT_ID
"em5::SimpleFireEvent" unique freeplay event ID
Definition: SimpleFireEvent.h:47
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66