Emergency 20 Dokumentation  4.2.0
CutRoadVehicleAction.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 {
23  class MeshAnimationChannel;
24  namespace game
25  {
26  class PrototypeContainer;
27  }
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Classes ]
40  //[-------------------------------------------------------]
49  {
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public definitions ]
54  //[-------------------------------------------------------]
55  public:
57 
58 
59  //[-------------------------------------------------------]
60  //[ Public methods ]
61  //[-------------------------------------------------------]
62  public:
68 
73  virtual ~CutRoadVehicleAction();
74 
79  void init(qsf::Entity& targetEntity);
80 
81  uint64 getTargetEntityId() const;
82 
83  bool isDone() const;
84 
85 
86  //[-------------------------------------------------------]
87  //[ Public virtual qsf::Actions methods ]
88  //[-------------------------------------------------------]
89  public:
90  virtual void serialize(qsf::BinarySerializer& serializer) override;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Protected virtual qsf::Action methods ]
95  //[-------------------------------------------------------]
96  protected:
97  virtual bool onStartup() override;
98  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
99  virtual void onShutdown() override;
100 
101 
102  //[-------------------------------------------------------]
103  //[ Private definitions ]
104  //[-------------------------------------------------------]
105  private:
106  enum State
107  {
108  STATE_INIT,
109  STATE_CREATE_COMPRESSOR,
110  STATE_PLACE_CUTTER,
111  STATE_PICKUP_CUTTER,
112  STATE_START_CUTTING,
113  STATE_LOOP_CUTTING,
114  STATE_END_CUTTING,
115  STATE_PLACE_CUTTER_AGAIN,
116  STATE_UNLOAD,
117  STATE_FINALLY_START_PICKUP_CUTTER,
118  STATE_FINALLY_PICKUP_CUTTER,
119  STATE_DONE
120  };
121 
122 
123  //[-------------------------------------------------------]
124  //[ Private methods ]
125  //[-------------------------------------------------------]
126  private:
127  void createCompressorPump();
128  void linkCutterToCompressor() const;
129  void pickupCutterFromCompressor() const;
130  uint32 unloadPersonFromVehicle(const qsf::game::PrototypeContainer& roadVehicleComponent);
131  void pushPullingPersonFromVehicleActions() const;
132  void pushFallbackAnimationsAndPlaceRescuedPerson() const;
133 
134 
135  //[-------------------------------------------------------]
136  //[ Private data ]
137  //[-------------------------------------------------------]
138  private:
139  uint64 mTargetEntityId;
140  State mState;
141  qsf::Time mTime;
142  qsf::WeakPtr<qsf::Entity> mCompressorPumpEntity;
143  qsf::WeakPtr<qsf::MeshAnimationChannel> mMeshAnimationChannel;
144  qsf::WeakPtr<qsf::Entity> mRescuedPerson;
145  AudioProxy mAudioProxy;
146  AudioProxy mCompressorAudioProxy;
147  bool mPlayAllRescueAnimations;
148 
149 
150  //[-------------------------------------------------------]
151  //[ CAMP reflection system ]
152  //[-------------------------------------------------------]
153  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
154 
155 
156  };
157 
158 
159 //[-------------------------------------------------------]
160 //[ Namespace ]
161 //[-------------------------------------------------------]
162 } // em5
163 
164 
165 //[-------------------------------------------------------]
166 //[ CAMP reflection system ]
167 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
static const qsf::NamedIdentifier ACTION_ID
"em5::CutRoadVehicleAction" unique action identifier
Definition: CutRoadVehicleAction.h:56
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
Prototype container base class.
Definition: PrototypeContainer.h:52
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
Abstract action base class.
Definition: Action.h:59
EMERGENCY 5 cut car action.
Definition: CutRoadVehicleAction.h:48
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
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