Emergency 20 Dokumentation  4.2.0
PickpocketEvent.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 ~PickpocketEvent();
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public virtual em5::FreeplayEvent methods ]
60  //[-------------------------------------------------------]
61  public:
62  virtual bool onStartup() override;
63  virtual void onShutdown() override;
64  virtual void onRun() override;
65  virtual bool onFailure(EventResult& eventResult) override;
66  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
67  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
68  virtual void hintCallback(Observer& hintObserver) override;
69  virtual const qsf::Entity* getFocusEntity() override;
70  virtual bool checkEventConfiguration() override;
71  virtual void serialize(qsf::BinarySerializer& serializer) override;
72 
73 
74  //[-------------------------------------------------------]
75  //[ Private methods ]
76  //[-------------------------------------------------------]
77  private:
78  void startHintObservers();
79  bool checkIfIsHealthy( qsf::Entity& victim);
80  bool checkIfReachedVictim(qsf::Entity& gangster, qsf::Entity& victim);
81  void setupGangster(qsf::Entity& gangster, qsf::Entity& victim);
82  void escape(qsf::Entity& gangster);
83 
84 
85  //[-------------------------------------------------------]
86  //[ Private data ]
87  //[-------------------------------------------------------]
88  private:
89  bool mPerpetrating;
90  bool mPerpetrated;
91  bool mDontShootTriggered;
92 
93 
94  //[-------------------------------------------------------]
95  //[ CAMP reflection system ]
96  //[-------------------------------------------------------]
97  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
98 
99 
100  };
101 
102 
103 //[-------------------------------------------------------]
104 //[ Namespace ]
105 //[-------------------------------------------------------]
106 } // em5
107 
108 
109 //[-------------------------------------------------------]
110 //[ CAMP reflection system ]
111 //[-------------------------------------------------------]
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
Reason
Definition: EventSpreadReason.h:20
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
static const uint32 FREEPLAY_EVENT_ID
"em5::PickpocketEvent" unique freeplay event ID
Definition: PickpocketEvent.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
EMERGENCY 5 gangster freeplay event base class.
Definition: GangsterEvent.h:41
EMERGENCY 5 freeplay event class for "Pickpocket".
Definition: PickpocketEvent.h:30
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