Emergency 20 Dokumentation  4.2.0
PickupPersonByFlyingHeliAction.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/audio/AudioProxy.h"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class HelicopterHatchComponent;
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  enum State
52  {
57  STATE_FINISH
58  };
59 
60 
61  //[-------------------------------------------------------]
62  //[ Public methods ]
63  //[-------------------------------------------------------]
64  public:
70 
76 
81  void init(const qsf::Entity& targetEntity);
82 
83  uint64 getTargetId() const;
84 
85  bool isStrecherWaitForLoading();
86 
87 
88  //[-------------------------------------------------------]
89  //[ Public virtual qsf::Actions methods ]
90  //[-------------------------------------------------------]
91  public:
92  virtual void serialize(qsf::BinarySerializer& serializer) override;
93 
94 
95  //[-------------------------------------------------------]
96  //[ Protected virtual qsf::Action methods ]
97  //[-------------------------------------------------------]
98  protected:
99  virtual bool onStartup() override;
100  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
101  virtual void onShutdown() override;
102 
103 
104  //[-------------------------------------------------------]
105  //[ Private methods ]
106  //[-------------------------------------------------------]
107  private:
108  bool checkActionCondition(qsf::Entity& targetEntity);
109  void placeTargetOnStretcher();
110  void putPersonInVehicleAndSendMessage();
111 
112 
113  //[-------------------------------------------------------]
114  //[ Private data ]
115  //[-------------------------------------------------------]
116  private:
117  // Configuration
118  uint64 mTargetEntityId;
119  State mState;
120  bool mIsTargetInjured;
121 
122  AudioProxy mAudioProxy;
123 
124  qsf::WeakPtr<HelicopterHatchComponent> mHelicopterHatchComponent;
125  qsf::WeakPtr<qsf::Entity> mTargetEntity;
126 
127 
128  //[-------------------------------------------------------]
129  //[ CAMP reflection system ]
130  //[-------------------------------------------------------]
131  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
132 
133 
134  };
135 
136 
137 //[-------------------------------------------------------]
138 //[ Namespace ]
139 //[-------------------------------------------------------]
140 } // em5
141 
142 
143 //[-------------------------------------------------------]
144 //[ CAMP reflection system ]
145 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
State
Definition: PickupPersonByFlyingHeliAction.h:51
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
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
Definition: PickupPersonByFlyingHeliAction.h:53
Definition: PickupPersonByFlyingHeliAction.h:56
State
Definition: ProcessState.h:20
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
Extended audio proxy for easier multiplay usage.
Definition: AudioProxy.h:47
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Definition: PickupPersonByFlyingHeliAction.h:54
Definition: PickupPersonByFlyingHeliAction.h:55
Abstract action base class.
Definition: Action.h:59
static const qsf::NamedIdentifier ACTION_ID
"em5::PickupPersonByFlyingHeliAction" unique action identifier
Definition: PickupPersonByFlyingHeliAction.h:49
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
EMERGENCY 5 pickup person by flying heli action.
Definition: PickupPersonByFlyingHeliAction.h:41
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20