Emergency 20 Dokumentation  4.2.0
LoadBoatToTransporterAction.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 
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  {
51  STATE_DONE
52  };
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public methods ]
57  //[-------------------------------------------------------]
58  public:
64 
69  virtual ~LoadBoatToTransporterAction();
70 
75  void init(const qsf::Entity& targetEntity);
76 
81  uint64 getTargetId() const;
82 
83 
84  //[-------------------------------------------------------]
85  //[ Public virtual qsf::Actions methods ]
86  //[-------------------------------------------------------]
87  public:
88  virtual void serialize(qsf::BinarySerializer& serializer) override;
89 
90 
91  //[-------------------------------------------------------]
92  //[ Protected virtual qsf::Action methods ]
93  //[-------------------------------------------------------]
94  protected:
95  virtual bool onStartup() override;
96  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
97 
98 
99  //[-------------------------------------------------------]
100  //[ Private methods ]
101  //[-------------------------------------------------------]
102  private:
103  void linkBoatToCraneEntity(qsf::Entity& boatEntity);
104  void linkBoatToVehicle(qsf::Entity& boatEntity);
105  qsf::Entity* getFirstChildEntity(qsf::Entity* entity);
106  void linkParticles(const qsf::Entity& targetEntity, qsf::Entity* particleEntity, float delay, float timeout);
107  void unlinkParticles(qsf::Entity& targetEntity);
108 
109 
110  //[-------------------------------------------------------]
111  //[ Private data ]
112  //[-------------------------------------------------------]
113  private:
114  // Configuration
115  uint64 mTargetEntityId;
116  State mState;
117  glm::quat mDefaultRotation;
118  glm::vec3 mDropPosition;
119 
120  // Only for temporary particle effects, no weak pointer necessary
121  qsf::Entity* mWatersprayEntity;
122  qsf::Entity* mWaterdropsEntity;
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
Entity class.
Definition: Entity.h:46
Definition: LoadBoatToTransporterAction.h:49
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
State
Definition: LoadBoatToTransporterAction.h:43
Definition: LoadBoatToTransporterAction.h:50
Definition: LoadBoatToTransporterAction.h:45
uint64_t uint64
Definition: PlatformTypes.h:184
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Definition: LoadBoatToTransporterAction.h:48
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::LoadBoatToTransporterAction" unique action identifier
Definition: LoadBoatToTransporterAction.h:41
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Definition: LoadBoatToTransporterAction.h:46
Abstract action base class.
Definition: Action.h:59
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
Definition: LoadBoatToTransporterAction.h:47
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20
EMERGENCY 5 load boat into transporter action.
Definition: LoadBoatToTransporterAction.h:33