Emergency 20 Dokumentation  4.2.0
ExitRescueHeliAction.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 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21  class HelicopterComponent;
22 }
23 
24 
25 //[-------------------------------------------------------]
26 //[ Namespace ]
27 //[-------------------------------------------------------]
28 namespace em5
29 {
30 
31 
32  //[-------------------------------------------------------]
33  //[ Classes ]
34  //[-------------------------------------------------------]
40  {
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public definitions ]
45  //[-------------------------------------------------------]
46  public:
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public methods ]
52  //[-------------------------------------------------------]
53  public:
59  explicit ExitRescueHeliAction(uint32 actionID);
60 
65  virtual ~ExitRescueHeliAction();
66 
67  void init(uint64 personIdToExit);
68 
69 
70  //[-------------------------------------------------------]
71  //[ Public virtual qsf::Actions methods ]
72  //[-------------------------------------------------------]
73  public:
74  virtual void serialize(qsf::BinarySerializer& serializer) override;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Protected virtual qsf::Action methods ]
79  //[-------------------------------------------------------]
80  protected:
81  virtual bool onStartup() override;
82  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
83 
84 
85  //[-------------------------------------------------------]
86  //[ Protected methods ]
87  //[-------------------------------------------------------]
88  protected:
89  void createOpticalEntities(qsf::Entity& helicopterEntity, bool playAnimationReverse = false);
90  void deleteOpticalEntities();
91 
92 
93  //[-------------------------------------------------------]
94  //[ Protected data ]
95  //[-------------------------------------------------------]
96  protected:
98 
102 
103 
104  //[-------------------------------------------------------]
105  //[ Private methods ]
106  //[-------------------------------------------------------]
107  private:
112  void detectStartingPersonal();
113  qsf::action::Result updateSubAction(const qsf::Clock& clock);
114 
115  // Methods used by the sub action control flow
116  void prepareParamedic();
117  void setupParamedicForLeaving(qsf::Entity& entity, const std::string& animationName, bool fadeIn, bool playAnimationReverse, const qsf::TransformComponent& helicopterTransformComponent);
118 
119 
120  //[-------------------------------------------------------]
121  //[ Private definitions ]
122  //[-------------------------------------------------------]
123  private:
124  // Defines the control flow of the action in general
125  enum GeneralState
126  {
127  GENREALSTATE_INIT,
128  GENREALSTATE_UPDATE,
129  GENREALSTATE_DONE
130  };
131 
132  // Handles the state of the paramedic team
133  enum SubState
134  {
135  STATE_INIT,
136  STATE_UPDATE,
137  STATE_LINEAR_MOVE,
138  STATE_DONE
139  };
140 
141 
142  //[-------------------------------------------------------]
143  //[ Private data ]
144  //[-------------------------------------------------------]
145  private:
146  GeneralState mGeneralState;
147  SubState mSubState;
148  bool mUnloadDoctor;
149  bool mUnloadParamedics;
150  uint64 mEntityIdToExit;
151 
152  // Pointer to units
153  qsf::WeakPtr<qsf::Entity> mParamedicTeam;
154 
155 
156  //[-------------------------------------------------------]
157  //[ CAMP reflection system ]
158  //[-------------------------------------------------------]
159  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
160 
161 
162  };
163 
164 
165 //[-------------------------------------------------------]
166 //[ Namespace ]
167 //[-------------------------------------------------------]
168 } // em5
169 
170 
171 //[-------------------------------------------------------]
172 //[ CAMP reflection system ]
173 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
qsf::WeakPtr< qsf::Entity > mParamedicFrontEntity
Is created in action, used only for animation, we have to delete it at the end of the action...
Definition: ExitRescueHeliAction.h:100
unsigned int uint32
Definition: PlatformTypes.h:181
Transform component class.
Definition: TransformComponent.h:33
EMERGENCY 5 exit vehicle action.
Definition: ExitVehicleAction.h:41
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
qsf::WeakPtr< HelicopterComponent > mHelicopterComponent
Pointer to the helicopter component of the owner.
Definition: ExitRescueHeliAction.h:97
uint64_t uint64
Definition: PlatformTypes.h:184
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
EMERGENCY 5 exit from rescue helicopter action.
Definition: ExitRescueHeliAction.h:39
#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
qsf::WeakPtr< qsf::Entity > mStretcherEntity
Is created in action, used only for animation, we have to delete it at the end of the action...
Definition: ExitRescueHeliAction.h:101
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
static const qsf::NamedIdentifier ACTION_ID
"em5::ExitRescueHeliAction" unique action identifier
Definition: ExitRescueHeliAction.h:47
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20
qsf::WeakPtr< qsf::Entity > mParamedicBackEntity
Is created in action, used only for animation, we have to delete it at the end of the action...
Definition: ExitRescueHeliAction.h:99