Emergency 20 Dokumentation  4.2.0
HeistEvent.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 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
31  {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Public definitions ]
36  //[-------------------------------------------------------]
37  public:
38  static const uint32 FREEPLAY_EVENT_ID;
39 
40 
41  //[-------------------------------------------------------]
42  //[ Public methods ]
43  //[-------------------------------------------------------]
44  public:
49  HeistEvent();
50 
55  virtual ~HeistEvent();
56 
61  uint64 getBuildingId() const;
62 
67  void setBuilding(qsf::Entity& entity);
68 
69  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(HeistDuration, float, mHeistDuration);
70  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(VictimPool, const std::string&, mVictimPool);
71 
72 
73  //[-------------------------------------------------------]
74  //[ Public virtual em5::FreeplayEvent methods ]
75  //[-------------------------------------------------------]
76  public:
77  virtual bool onStartup() override;
78  virtual void onShutdown() override;
79  virtual void onRun() override;
80  virtual bool onFailure(EventResult& eventResult) override;
81  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
82  virtual void hintCallback(Observer& hintObserver) override;
83  virtual const qsf::Entity* getFocusEntity() override;
84  virtual bool checkEventConfiguration() override;
85  virtual void serialize(qsf::BinarySerializer& serializer) override;
86  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
87 
88 
89  //[-------------------------------------------------------]
90  //[ Private methods ]
91  //[-------------------------------------------------------]
92  private:
93  void startHintObservers();
94  bool checkIfIsHealthy( qsf::Entity& victim);
95  bool checkIfReachedBuilding(qsf::Entity& gangster, qsf::Entity& victim);
96  void setupGangster(qsf::Entity& gangster, qsf::Entity& victim);
97  void escape(qsf::Entity& gangster);
98 
99 
100  //[-------------------------------------------------------]
101  //[ Private data ]
102  //[-------------------------------------------------------]
103  private:
104  uint64 mBuildingId;
105  uint64 mVictimId;
106  bool mPerpetrating;
107  bool mPerpetrated;
108  bool mRescue;
109  float mHeistDuration;
110  std::string mVictimPool;
111  bool mDontShootTriggered;
112 
113 
114  //[-------------------------------------------------------]
115  //[ CAMP reflection system ]
116  //[-------------------------------------------------------]
117  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
118 
119 
120  };
121 
122 
123 //[-------------------------------------------------------]
124 //[ Namespace ]
125 //[-------------------------------------------------------]
126 } // em5
127 
128 
129 //[-------------------------------------------------------]
130 //[ CAMP reflection system ]
131 //[-------------------------------------------------------]
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
EMERGENCY 5 freeplay event class for "Heist".
Definition: HeistEvent.h:30
Reason
Definition: EventSpreadReason.h:20
uint64_t uint64
Definition: PlatformTypes.h:184
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
static const uint32 FREEPLAY_EVENT_ID
"em5::HeistEvent" unique freeplay event ID
Definition: HeistEvent.h:38
#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
#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
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32