Emergency 20 Dokumentation  4.2.0
DoctorLogic.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>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class ActionComponent;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Classes ]
36  //[-------------------------------------------------------]
42  {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public definitions ]
47  //[-------------------------------------------------------]
48  public:
49  static const uint32 GAMELOGIC_TYPE_ID; // "em5::DoctorLogic" game logic type ID
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
56  DoctorLogic();
57 
67  void takeMedikitFromVehicle(const qsf::MessageParameters& parameters);
68 
76  void putMedikitInVehicle(const qsf::MessageParameters& parameters);
77 
78  void startWaitForEnterVehicle(const qsf::MessageParameters& parameters);
79  void abortWaitForEnterVehicle(const qsf::MessageParameters& parameters);
80 
81 
82  //[-------------------------------------------------------]
83  //[ Public virtual em5::CarryPersonLogic methods ]
84  //[-------------------------------------------------------]
85  public:
86  virtual void setCarryPerson(uint64 carryPersonId) override;
87 
88 
89  //[-------------------------------------------------------]
90  //[ Public virtual qsf::GameLogic methods ]
91  //[-------------------------------------------------------]
92  public:
93  virtual bool onStartup() override;
94  virtual void onShutdown() override;
95 
96 
97  //[-------------------------------------------------------]
98  //[ Private definitions ]
99  //[-------------------------------------------------------]
100  private:
101  static const uint32 ACTION_PRIORITY;
102 
103 
104  //[-------------------------------------------------------]
105  //[ Private methods ]
106  //[-------------------------------------------------------]
107  private:
108  // Job updates
109  void updateSimulation(const qsf::JobArguments& jobArguments);
110 
111  void performAutomatism();
112  void performTreatmentAutomatism();
113 
114  void pushSignalActionAndSetupMessageHandler(uint64 vehicleEntityId, qsf::ActionComponent& actionComponent);
115 
116 
117  //[-------------------------------------------------------]
118  //[ Private data ]
119  //[-------------------------------------------------------]
120  private:
121  // Job proxies for regular update
122  qsf::JobProxy mSimulationJobProxy;
123  qsf::Time mTimeWaiting;
124 
125  // We need this message proxy to get or put away the medikit and have a safe serialization
126  qsf::MessageProxy mExitVehicleProxy;
127  qsf::MessageProxy mEnterVehicleProxy;
128  qsf::MessageProxy mEnterVehicleWithoutEquipmentProxy;
129  qsf::MessageProxy mEnterVehicleWithoutEquipmentAbortProxy;
130 
131 
132  //[-------------------------------------------------------]
133  //[ CAMP reflection system ]
134  //[-------------------------------------------------------]
135  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
136 
137 
138  };
139 
140 
141 //[-------------------------------------------------------]
142 //[ Namespace ]
143 //[-------------------------------------------------------]
144 } // em5
145 
146 
147 //[-------------------------------------------------------]
148 //[ CAMP reflection system ]
149 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Doctor logic.
Definition: DoctorLogic.h:41
Message parameters class.
Definition: MessageParameters.h:34
Carry person logic.
Definition: CarryPersonLogic.h:33
unsigned int uint32
Definition: PlatformTypes.h:181
static const uint32 GAMELOGIC_TYPE_ID
Definition: DoctorLogic.h:49
#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
Definition: PickupPersonByParamedicAction.h:21
#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
Action component.
Definition: ActionComponent.h:47
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32