Emergency 20 Dokumentation  4.2.0
RopingFromHelicopterAction.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 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class HelicopterComponent;
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:
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
61 
66  virtual ~RopingFromHelicopterAction();
67 
72  void init(const glm::vec3& targetPosition);
73 
74 
75  //[-------------------------------------------------------]
76  //[ Public virtual qsf::Actions methods ]
77  //[-------------------------------------------------------]
78  public:
79  virtual void serialize(qsf::BinarySerializer& serializer) override;
80 
81 
82  //[-------------------------------------------------------]
83  //[ Protected virtual qsf::Action methods ]
84  //[-------------------------------------------------------]
85  protected:
86  virtual bool onStartup() override;
87  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
88 
89 
90  //[-------------------------------------------------------]
91  //[ Private methods ]
92  //[-------------------------------------------------------]
93  private:
94  void showPersonalInside(bool show);
95  void spawnUnits();
96  bool isPersonInRopingProcess();
97 
98 
99  //[-------------------------------------------------------]
100  //[ Private definitions ]
101  //[-------------------------------------------------------]
102  private:
103  enum State
104  {
105  STATE_INIT,
106  STATE_OPEN_DOOR,
107  STATE_EXTEND_FAST_ROPE,
108  STATE_SPAWN_PERSONAL,
109  STATE_ROPING,
110  STATE_HIDE_FAST_ROPE,
111  STATE_CLOSE_DOOR
112  };
113 
114 
115  //[-------------------------------------------------------]
116  //[ Private data ]
117  //[-------------------------------------------------------]
118  private:
119  State mState;
120  glm::vec3 mTargetPosition;
121  qsf::WeakPtr<HelicopterComponent> mHelicopterComponent;
122  std::vector<qsf::Entity*> mEntitiesToExit;
123 
124 
125  //[-------------------------------------------------------]
126  //[ CAMP reflection system ]
127  //[-------------------------------------------------------]
128  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
129 
130 
131  };
132 
133 
134 //[-------------------------------------------------------]
135 //[ Namespace ]
136 //[-------------------------------------------------------]
137 } // em5
138 
139 
140 //[-------------------------------------------------------]
141 //[ CAMP reflection system ]
142 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
State
Definition: ProcessState.h:20
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
static const qsf::NamedIdentifier ACTION_ID
"em5::RopingFromHelicopterAction" unique action identifier
Definition: RopingFromHelicopterAction.h:49
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Abstract action base class.
Definition: Action.h:59
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20
EMERGENCY 5 roping from (flying) helicopter action.
Definition: RopingFromHelicopterAction.h:41