Emergency 20 Dokumentation  4.2.0
GangsterCarHijackerLogic.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 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
38  {
39 
40 
41  //[-------------------------------------------------------]
42  //[ Public definitions ]
43  //[-------------------------------------------------------]
44  public:
45  static const uint32 GAMELOGIC_TYPE_ID; // "em5::GangsterCarHijackerLogic" game logic type ID
46 
47 
48  //[-------------------------------------------------------]
49  //[ Public methods ]
50  //[-------------------------------------------------------]
51  public:
53  void startCarChase();
54  void abortCarChase();
55  void escapeOnFoot(qsf::Entity& vehicle);
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public virtual qsf::GameLogic methods ]
60  //[-------------------------------------------------------]
61  public:
62  virtual bool onStartup() override;
63  virtual void onShutdown() override;
64 
65 
66  //[-------------------------------------------------------]
67  //[ Protected virtual em5::GangsterBaseLogic methods ]
68  //[-------------------------------------------------------]
69  protected:
70  void onSimulationUpdate(const qsf::JobArguments& jobArguments) override;
71  // Note: Don't simply save the list because there is no possibility to make sure that the entity references stay valid after the method returns
72  void onUnitsSpotted(std::vector<SpottedUnit>& sightedPoliceUnits) override;
73 
74 
75  //[-------------------------------------------------------]
76  //[ Private methods ]
77  //[-------------------------------------------------------]
78  private:
79  void onShotAt(const qsf::MessageParameters& parameters);
80  void updateCarChase(const qsf::Time& timePassed);
81 
82 
83  //[-------------------------------------------------------]
84  //[ Private data ]
85  //[-------------------------------------------------------]
86  private:
87  qsf::MessageProxy mMessageProxy;
88  qsf::Time mCarChaseTimer;
89 
90 
91  //[-------------------------------------------------------]
92  //[ CAMP reflection system ]
93  //[-------------------------------------------------------]
94  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
95 
96 
97  };
98 
99 
100 //[-------------------------------------------------------]
101 //[ Namespace ]
102 //[-------------------------------------------------------]
103 } // em5
104 
105 
106 //[-------------------------------------------------------]
107 //[ CAMP reflection system ]
108 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
static const uint32 GAMELOGIC_TYPE_ID
Definition: GangsterCarHijackerLogic.h:45
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
Message listener proxy class.
Definition: MessageProxy.h:47
Game logic for gangster type.
Definition: GangsterCarHijackerLogic.h:37
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
#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
Base game logic for gangster.
Definition: GangsterBaseLogic.h:52
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32