Emergency 20 Dokumentation  4.2.0
PickupPersonByParamedicAction.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 qsf
22 {
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  {
58  STATE_END
59  };
60 
61 
62  //[-------------------------------------------------------]
63  //[ Public methods ]
64  //[-------------------------------------------------------]
65  public:
71 
77 
82  void init(qsf::Entity& targetEntity);
83 
84  uint64 getTargetEntityId() const;
85 
86 
87  //[-------------------------------------------------------]
88  //[ Public virtual qsf::Actions methods ]
89  //[-------------------------------------------------------]
90  public:
91  virtual void serialize(qsf::BinarySerializer& serializer) override;
92 
93 
94  //[-------------------------------------------------------]
95  //[ Protected virtual qsf::Action methods ]
96  //[-------------------------------------------------------]
97  protected:
98  virtual bool onStartup() override;
99  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
100  virtual void onShutdown() override;
101 
102 
103  //[-------------------------------------------------------]
104  //[ Private methods ]
105  //[-------------------------------------------------------]
106  private:
107  void findIdFromChildLinks();
108  void startLowerStrechAnimation(qsf::Entity& strecherEntity);
109  void startLowerParamedicsAnimation(qsf::Entity& frontParamedic, qsf::Entity& backParamedic);
110  void startRaiseStrechAnimation(qsf::Entity& strecherEntity);
111  void startRaiseParamedicsAnimation(qsf::Entity& frontParamedic, qsf::Entity& backParamedic);
112  void startVictimAnimation(qsf::Entity& patientEntity) const;
113  void pushWaitAction(qsf::Entity& entity, const qsf::Time& waitTime) const;
114  bool isAnimationPlaying() const;
115  void sendMessage() const;
116 
117 
118  //[-------------------------------------------------------]
119  //[ Private data ]
120  //[-------------------------------------------------------]
121  private:
122  uint64 mTargetEntityId;
123  bool mKeepTargetReservation;
124  State mState;
125  uint64 mStrecherId;
126  uint64 mFrontParamedicId;
127  uint64 mBackParamedicId;
128 
129  AudioProxy mAudioProxy;
130 
131  qsf::WeakPtr<qsf::MeshAnimationChannel> mStrecherAnimation;
132  qsf::WeakPtr<qsf::MeshAnimationChannel> mFrontParamedicAnimation;
133  qsf::WeakPtr<qsf::MeshAnimationChannel> mBackParamedicAnimation;
134 
135 
136  //[-------------------------------------------------------]
137  //[ CAMP reflection system ]
138  //[-------------------------------------------------------]
139  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
140 
141 
142  };
143 
144 
145 //[-------------------------------------------------------]
146 //[ Namespace ]
147 //[-------------------------------------------------------]
148 } // em5
149 
150 
151 //[-------------------------------------------------------]
152 //[ CAMP reflection system ]
153 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
Definition: PickupPersonByParamedicAction.h:55
#define EM5_API_EXPORT
Definition: Export.h:28
static const qsf::NamedIdentifier ACTION_ID
"em5::PickupPersonByParamedicAction" unique action identifier
Definition: PickupPersonByParamedicAction.h:49
Definition: PickupPersonByParamedicAction.h:56
Definition: PickupPersonByParamedicAction.h:54
uint64_t uint64
Definition: PlatformTypes.h:184
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Definition: PickupPersonByParamedicAction.h:21
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: PickupPersonByParamedicAction.h:57
Mesh animation channel.
Definition: MeshAnimationChannel.h:48
Abstract action base class.
Definition: Action.h:59
State
Definition: PickupPersonByParamedicAction.h:51
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
Definition: PickupPersonByParamedicAction.h:53
EMERGENCY 5 pickup person by paramedic action.
Definition: PickupPersonByParamedicAction.h:41
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32