Emergency 20 Dokumentation  4.2.0
DirtyBombEvent.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2014 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 
15 #include <qsf/job/JobProxy.h>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class JobArguments;
24  class MessageProxy;
25 }
26 
27 
28 //[-------------------------------------------------------]
29 //[ Namespace ]
30 //[-------------------------------------------------------]
31 namespace em5
32 {
33 
34 
35  //[-------------------------------------------------------]
36  //[ Classes ]
37  //[-------------------------------------------------------]
43  {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Public definitions ]
48  //[-------------------------------------------------------]
49  public:
50  static const uint32 FREEPLAY_EVENT_ID;
51 
52 
53  //[-------------------------------------------------------]
54  //[ Public methods ]
55  //[-------------------------------------------------------]
56  public:
62 
67  virtual ~DirtyBombEvent();
68 
69  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(BombTargetId, uint64, mBombTargetId);
70  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(ExplosionRadius, float, mExplosionRadius);
71  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(ContaminationRadius, float, mContaminationRadius);
72  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TerroristSeekTime, qsf::Time, mTerroristSeekTime);
73 
74  std::vector<uint64>& getTerroristIds();
75 
76 
77  //[-------------------------------------------------------]
78  //[ Public virtual em5::FreeplayEvent methods ]
79  //[-------------------------------------------------------]
80  public:
81  virtual bool onStartup() override;
82  virtual void onShutdown() override;
83  virtual void onRun() override;
84  virtual bool onFailure(EventResult& eventResult) override;
85  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
86  virtual void hintCallback(Observer& hintObserver) override;
87  virtual const qsf::Entity* getFocusEntity() override;
88  virtual bool checkEventConfiguration() override;
89  virtual void serialize(qsf::BinarySerializer& serializer) override;
90  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Private methods ]
95  //[-------------------------------------------------------]
96  private:
97  void startHintObservers();
98  void explodeDirtyBomb(qsf::Entity& entity);
99 
100  void onTerroristSeekFail(const qsf::JobArguments& jobArguments);
101  void onTerroristFound(const qsf::MessageParameters& parameters);
102 
103  void playHint02();
104  void playHint04();
105 
106 
107  //[-------------------------------------------------------]
108  //[ Private data ]
109  //[-------------------------------------------------------]
110  private:
111  float mExplosionRadius;
112  float mContaminationRadius;
113  uint64 mBombTargetId;
114  std::vector<uint64> mTerroristIds;
115  qsf::Time mTerroristSeekTime;
116 
117  std::vector<qsf::MessageProxy> mTerroristFoundMessageProxies;
118  qsf::JobProxy mTerroristSeekTimer;
119 
120  qsf::Time mHint01WaitTime; // Waiting time for terrorist seek hint
121  qsf::Time mHint03WaitTime;
122  float mHint04LifeEnergy;
123  bool mHint02Triggered;
124  bool mHint04Triggered;
125 
126 
127  //[-------------------------------------------------------]
128  //[ CAMP reflection system ]
129  //[-------------------------------------------------------]
130  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
131 
132 
133  };
134 
135 
136 //[-------------------------------------------------------]
137 //[ Namespace ]
138 //[-------------------------------------------------------]
139 } // em5
140 
141 
142 //[-------------------------------------------------------]
143 //[ CAMP reflection system ]
144 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Reason
Definition: EventSpreadReason.h:20
uint64_t uint64
Definition: PlatformTypes.h:184
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
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
static const uint32 FREEPLAY_EVENT_ID
"em5::DirtyBombEvent" unique freeplay event ID
Definition: DirtyBombEvent.h:50
#define QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(name, type, variable)
Definition: PropertyHelper.h:16
EMERGENCY 5 gangster freeplay event base class.
Definition: GangsterEvent.h:41
Binary serializer class.
Definition: BinarySerializer.h:35
EMERGENCY 5 freeplay event class for "dirty bomb.
Definition: DirtyBombEvent.h:42
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32