Emergency 20 Dokumentation  4.2.0
RunningAmokEvent.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:
50 
55  virtual ~RunningAmokEvent();
56 
61  uint64 getGangsterId() const;
62 
67  void setGangster(const qsf::Entity& entity);
68 
69  void setPeopleToAttack(uint32 peopleToAttack);
70 
71 
72  //[-------------------------------------------------------]
73  //[ Public virtual em5::FreeplayEvent methods ]
74  //[-------------------------------------------------------]
75  public:
76  virtual bool onStartup() override;
77  virtual void onShutdown() override;
78  virtual void onRun() override;
79  virtual bool onFailure(EventResult& eventResult) override;
80  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
81  virtual void hintCallback(Observer& hintObserver) override;
82  virtual const qsf::Entity* getFocusEntity() override;
83  virtual bool checkEventConfiguration() override;
84  virtual void serialize(qsf::BinarySerializer& serializer) override;
85  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
86 
87 
88  //[-------------------------------------------------------]
89  //[ Private methods ]
90  //[-------------------------------------------------------]
91  private:
92  void startObjectives(const qsf::Entity& targetEntity);
93  void startHintObservers();
94  bool checkIfIsHealthy(const qsf::Entity& victim) const;
95  void escape();
96 
97 
98  //[-------------------------------------------------------]
99  //[ Private data ]
100  //[-------------------------------------------------------]
101  private:
102  uint64 mGangsterId;
103  uint32 mAttacksLeft; // The number of person attacks before start escaping
104  bool mPoliceExited;
105 
106 
107  //[-------------------------------------------------------]
108  //[ CAMP reflection system ]
109  //[-------------------------------------------------------]
110  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
111 
112 
113  };
114 
115 
116 //[-------------------------------------------------------]
117 //[ Namespace ]
118 //[-------------------------------------------------------]
119 } // em5
120 
121 
122 //[-------------------------------------------------------]
123 //[ CAMP reflection system ]
124 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
EMERGENCY 5 freeplay event class for "RunningAmok".
Definition: RunningAmokEvent.h:30
Entity class.
Definition: Entity.h:46
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
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
#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::RunningAmokEvent" unique freeplay event ID
Definition: RunningAmokEvent.h:38
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
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