Emergency 20 Dokumentation  4.2.0
PolicemanLogic.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 #include <qsf/job/JobProxy.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public definitions ]
39  //[-------------------------------------------------------]
40  public:
41  static const uint32 GAMELOGIC_TYPE_ID; // "em5::PolicemanLogic" game logic type ID
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public static methods ]
46  //[-------------------------------------------------------]
47  public:
48  static bool areGangstersAround(qsf::Entity& entity);
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
55  PolicemanLogic(uint32 gameLogicId = GAMELOGIC_TYPE_ID);
56 
57 
58  //[-------------------------------------------------------]
59  //[ Private methods ]
60  //[-------------------------------------------------------]
61  private:
62  // Job updates
63  void updateSimulation(const qsf::JobArguments& jobArguments);
64 
65  bool performAutomatism(uint64 ignoreTarget);
66  void abortAutomatism(bool tryToRecover = true);
67  bool placePersonAutomatism(uint64 ignoreTarget);
68  bool speakToPersonAutomatism();
69  void onPersonPlacedInVehicle(const qsf::MessageParameters& parameters);
70  qsf::Entity* findIdlingPolicemanAroundVehicle(qsf::Entity& vehicleEntity, uint32 filteredUnitType);
71  void onPreCommandExecute(const qsf::MessageParameters& parameters);
72  void onPolicemanInjured(const qsf::MessageParameters& parameters);
73 
74 
75  //[-------------------------------------------------------]
76  //[ Public virtual qsf::GameLogic methods ]
77  //[-------------------------------------------------------]
78  public:
79  virtual bool onStartup() override;
80  virtual void onShutdown() override;
81 
82 
83  //[-------------------------------------------------------]
84  //[ Private definitions ]
85  //[-------------------------------------------------------]
86  private:
87  static const uint32 ACTION_PRIORITY;
88 
89 
90  //[-------------------------------------------------------]
91  //[ Private data ]
92  //[-------------------------------------------------------]
93  private:
94  qsf::JobProxy mSimulationJobProxy;
95  qsf::MessageProxy mMessageProxy;
96  qsf::MessageProxy mPostCommandProxy;
97  qsf::MessageProxy mOnInjuredProxy;
98  qsf::MessageProxy mOnContaminatedProxy;
99  qsf::Time mTimeWaiting;
100  glm::vec3 mAutomatismStartPos;
101  bool mIsAutomatismActive;
102  uint64 mAutomatismTargetVehicle;
103 
104 
105  //[-------------------------------------------------------]
106  //[ CAMP reflection system ]
107  //[-------------------------------------------------------]
108  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
109 
110 
111  };
112 
113 
114 //[-------------------------------------------------------]
115 //[ Namespace ]
116 //[-------------------------------------------------------]
117 } // em5
118 
119 
120 //[-------------------------------------------------------]
121 //[ CAMP reflection system ]
122 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
Carry person logic.
Definition: CarryPersonLogic.h:33
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Message listener proxy class.
Definition: MessageProxy.h:47
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
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
Policeman logic.
Definition: PolicemanLogic.h:33
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
static const uint32 GAMELOGIC_TYPE_ID
Definition: PolicemanLogic.h:41
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32