Emergency 20 Dokumentation  4.2.0
EventSpreading.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 #include <boost/noncopyable.hpp>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class Entity;
24 }
25 namespace em5
26 {
27  class FreeplayEvent;
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Classes ]
40  //[-------------------------------------------------------]
45  class EventSpreading : public boost::noncopyable
46  {
47 
48 
49  //[-------------------------------------------------------]
50  //[ Public static methods ]
51  //[-------------------------------------------------------]
52  public:
57  static bool eventSpreadReaction(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason = true);
58 
63  static void startFireReaction(qsf::Entity& fireEntity);
64 
69  static void stopFireReaction(qsf::Entity& fireEntity, bool destroyed);
70 
71  static void enterContainerReaction(qsf::Entity& entity, qsf::Entity& containerEntity, uint32 containerCategory);
72  static void leaveContainerReaction(qsf::Entity& entity, qsf::Entity& containerEntity, uint32 containerCategory);
73 
74  static void bombExplosionReaction(qsf::Entity& entity);
75 
76 
77  //[-------------------------------------------------------]
78  //[ Private static methods ]
79  //[-------------------------------------------------------]
80  private:
81  //[-------------------------------------------------------]
82  //[ On event spread reason ]
83  //[-------------------------------------------------------]
88  static bool onCauseInjury(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
89 
94  static bool onCauseDead(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
95 
100  static bool onSpreadFire(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
101 
106  static bool onDamageVehicle(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
107 
112  static bool onSpreadContamination(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
113 
118  static bool onNewGangster(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
119 
124  static bool onEventSpecific(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
125 
130  static bool onNewHostageInBuilding(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
131 
136  static bool onBrokenTree(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
137 
138 
139  //[-------------------------------------------------------]
140  //[ On event reason cause injury ]
141  //[-------------------------------------------------------]
146  static bool onCauseInjury_Injury(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
147 
152  static bool onCauseInjury_Injury_InBuilding(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
153 
158  static bool onCauseInjury_Injury_InRoadVehicle(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
159 
164  static bool onCauseInjury_Infection(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
165 
170  static bool onCauseInjury_Infection_Infective(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
171 
176  static bool onCauseInjury_Gangster(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
177 
178  //[-------------------------------------------------------]
179  //[ On event reason cause dead ]
180  //[-------------------------------------------------------]
185  static bool onCauseDead_Dead(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
186 
187  //[-------------------------------------------------------]
188  //[ On event reason spread fire ]
189  //[-------------------------------------------------------]
194  static bool onSpreadFire_Building(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
195 
200  static bool onSpreadFire_RoadVehicle(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
201 
206  static bool onSpreadFire_Object(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
207 
208  //[-------------------------------------------------------]
209  //[ On event damage road vehicle ]
210  //[-------------------------------------------------------]
215  static bool onDamageVehicle_RoadVehicle(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
216 
217  //[-------------------------------------------------------]
218  //[ On event reason spread contamination ]
219  //[-------------------------------------------------------]
224  static bool onSpreadContamination_Person(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
225 
226  //[-------------------------------------------------------]
227  //[ On event reason new gangster ]
228  //[-------------------------------------------------------]
233  static bool onNewGangster_Person(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
234 
239  static bool onNewGangster_PersonInsideBuilding(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
240 
241  //[-------------------------------------------------------]
242  //[ On event reason event specific ]
243  //[-------------------------------------------------------]
248  static bool onEventSpecific_WavingFromWindow(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
249 
254  static bool onEventSpecific_PersonTrappedInBuilding(FreeplayEvent& freeplayEvent, qsf::Entity& targetEntity, bool newReason);
255 
256 
257  };
258 
259 
260 //[-------------------------------------------------------]
261 //[ Namespace ]
262 //[-------------------------------------------------------]
263 } // em5
Definition: ActionPriority.h:13
static void leaveContainerReaction(qsf::Entity &entity, qsf::Entity &containerEntity, uint32 containerCategory)
Entity class.
Definition: Entity.h:46
static void enterContainerReaction(qsf::Entity &entity, qsf::Entity &containerEntity, uint32 containerCategory)
static void startFireReaction(qsf::Entity &fireEntity)
Reaction to an object being set on fire.
unsigned int uint32
Definition: PlatformTypes.h:181
Reason
Definition: EventSpreadReason.h:20
static void bombExplosionReaction(qsf::Entity &entity)
static bool eventSpreadReaction(FreeplayEvent &freeplayEvent, qsf::Entity &targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason=true)
Create generic objectives and observers at event spreading.
Definition: PickupPersonByParamedicAction.h:21
static void stopFireReaction(qsf::Entity &fireEntity, bool destroyed)
Reaction to an object fire going out.
Static EMERGENCY 5 event spreading logic class.
Definition: EventSpreading.h:45
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66