Emergency 20 Dokumentation  4.2.0
DisconnectHydrantAction.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 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class MeshAnimationChannel;
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 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
61 
66  virtual ~DisconnectHydrantAction();
67 
72  void init(const qsf::Entity& targetEntity);
73 
74 
75  //[-------------------------------------------------------]
76  //[ Public virtual qsf::Actions methods ]
77  //[-------------------------------------------------------]
78  public:
79  virtual void serialize(qsf::BinarySerializer& serializer) override;
80 
81 
82  //[-------------------------------------------------------]
83  //[ Protected virtual qsf::Action methods ]
84  //[-------------------------------------------------------]
85  protected:
86  virtual bool onStartup() override;
87  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
88 
89 
90  //[-------------------------------------------------------]
91  //[ Private methods ]
92  //[-------------------------------------------------------]
93  private:
94  void handleConnectedRoadVehicle(qsf::Entity& hydrantEntity);
95  void handleHistoricWell(const qsf::Entity& hydrantEntity) const;
96 
97 
98  //[-------------------------------------------------------]
99  //[ Private definitions ]
100  //[-------------------------------------------------------]
101  private:
102  enum State
103  {
104  STATE_INIT,
105  STATE_DELETE_NOZZLE,
106  STATE_CREATE_HOSE,
107  STATE_DISCONNECT
108  };
109 
110 
111  //[-------------------------------------------------------]
112  //[ Private data ]
113  //[-------------------------------------------------------]
114  private:
115  uint64 mTargetEntityId;
116  State mCurrentState;
117  qsf::WeakPtr<qsf::MeshAnimationChannel> mMeshAnimationChannel;
118  bool mUseGroundHydrant;
119 
120 
121  //[-------------------------------------------------------]
122  //[ CAMP reflection system ]
123  //[-------------------------------------------------------]
124  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
125 
126 
127  };
128 
129 
130 //[-------------------------------------------------------]
131 //[ Namespace ]
132 //[-------------------------------------------------------]
133 } // em5
134 
135 
136 //[-------------------------------------------------------]
137 //[ CAMP reflection system ]
138 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 disconnect hydrant action.
Definition: DisconnectHydrantAction.h:41
Entity class.
Definition: Entity.h:46
static const qsf::NamedIdentifier ACTION_ID
"em5::DisconnectHydrantAction" unique action identifier
Definition: DisconnectHydrantAction.h:49
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
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
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
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