Emergency 20 Dokumentation  4.2.0
PickupVehicleByTowcarAction.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 
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public definitions ]
39  //[-------------------------------------------------------]
40  public:
42 
43  enum State
44  {
52  STATE_DONE
53  };
54 
55 
56  //[-------------------------------------------------------]
57  //[ Public methods ]
58  //[-------------------------------------------------------]
59  public:
65 
70  virtual ~PickupVehicleByTowcarAction();
71 
76  void init(qsf::Entity& targetEntity);
77 
78  uint64 getTargetId() const;
79 
80 
81  //[-------------------------------------------------------]
82  //[ Public virtual qsf::Actions methods ]
83  //[-------------------------------------------------------]
84  public:
85  virtual void serialize(qsf::BinarySerializer& serializer) override;
86 
87 
88  //[-------------------------------------------------------]
89  //[ Protected virtual qsf::Action methods ]
90  //[-------------------------------------------------------]
91  protected:
92  virtual bool onStartup() override;
93  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
94  virtual void onShutdown() override;
95 
96 
97  //[-------------------------------------------------------]
98  //[ Private methods ]
99  //[-------------------------------------------------------]
100  private:
101  uint64 getCoverEntityId();
102  void linkWreckToCraneEntity(qsf::Entity& wreckEntity);
103  void unLinkWreckEntity(qsf::Entity& wreckEntity);
104  void exchangeTargetWithCover(qsf::Entity& wreckEntity, qsf::Entity& coverEntity);
105  void addToContainer(qsf::Entity& wreckEntity);
106  void addChildsSafeToContainer(qsf::Entity& mainChildEntity);
107 
108  qsf::Entity* getFirstChildEntity(qsf::Entity* entity);
109  float towcarToWreckYaw(const qsf::Transform& towcarTransform, const qsf::Transform& wreckTransform);
110 
111 
112  //[-------------------------------------------------------]
113  //[ Private data ]
114  //[-------------------------------------------------------]
115  private:
116  // Configuration
117  uint64 mTargetEntityId;
118  uint64 mCoverEntityId;
119  State mState;
120  glm::quat mDefaultRotation;
121  bool mUseCover;
122  float mSecondsPassed;
123  glm::vec3 mTargetPosition;
124 
125  AudioProxy mAudioProxy;
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
Definition: PickupVehicleByTowcarAction.h:47
Entity class.
Definition: Entity.h:46
Definition: PickupVehicleByTowcarAction.h:50
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
static const qsf::NamedIdentifier ACTION_ID
"em5::PickupVehicleByTowcarAction" unique action identifier
Definition: PickupVehicleByTowcarAction.h:41
3D transform class
Definition: Transform.h:45
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Definition: PickupVehicleByTowcarAction.h:51
State
Definition: ProcessState.h:20
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
EMERGENCY 5 pickup vehicle by towcar action.
Definition: PickupVehicleByTowcarAction.h:33
Extended audio proxy for easier multiplay usage.
Definition: AudioProxy.h:47
Definition: PickupVehicleByTowcarAction.h:46
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
State
Definition: PickupVehicleByTowcarAction.h:43
Definition: PickupVehicleByTowcarAction.h:45
Definition: PickupVehicleByTowcarAction.h:49
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
Definition: PickupVehicleByTowcarAction.h:48