Emergency 20 Dokumentation  4.2.0
PlaceBarrierPoleAction.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 Declaration ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class BarrierTapeComponent;
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_FINISH
59  };
60 
61 
62  //[-------------------------------------------------------]
63  //[ Public methods ]
64  //[-------------------------------------------------------]
65  public:
71 
76  virtual ~PlaceBarrierPoleAction();
77 
82  void init(BarrierTapeComponent* barrierTapeComponent);
83 
88  State getActionState() const;
89 
90 
91  //[-------------------------------------------------------]
92  //[ Public virtual qsf::Actions methods ]
93  //[-------------------------------------------------------]
94  public:
95  virtual void serialize(qsf::BinarySerializer& serializer) override;
96 
97 
98  //[-------------------------------------------------------]
99  //[ Protected virtual qsf::Action methods ]
100  //[-------------------------------------------------------]
101  protected:
102  virtual bool onStartup() override;
103  virtual void onShutdown() override;
104  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
105 
106 
107  //[-------------------------------------------------------]
108  //[ Private methods ]
109  //[-------------------------------------------------------]
110  private:
111  bool validateUserAndTarget(const glm::vec3& targetPosition) const;
112 
113 
114  //[-------------------------------------------------------]
115  //[ Private data ]
116  //[-------------------------------------------------------]
117  private:
118  State mState;
119 
120  // Configuration
121  qsf::WeakPtr<BarrierTapeComponent> mBarrierTapeComponent;
122 
123 
124  //[-------------------------------------------------------]
125  //[ CAMP reflection system ]
126  //[-------------------------------------------------------]
127  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
128 
129 
130  };
131 
132 
133 //[-------------------------------------------------------]
134 //[ Namespace ]
135 //[-------------------------------------------------------]
136 } // em5
137 
138 
139 //[-------------------------------------------------------]
140 //[ CAMP reflection system ]
141 //[-------------------------------------------------------]
State
Definition: PlaceBarrierPoleAction.h:51
Definition: ActionPriority.h:13
Definition: PlaceBarrierPoleAction.h:54
EMERGENCY 5 barrier tape component.
Definition: BarrierTapeComponent.h:46
Clock class.
Definition: Clock.h:33
Definition: PlaceBarrierPoleAction.h:53
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: PlaceBarrierPoleAction.h:55
Definition: PlaceBarrierPoleAction.h:57
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
static const qsf::NamedIdentifier ACTION_ID
"em5::PlaceBarrierPoleAction" unique action identifier
Definition: PlaceBarrierPoleAction.h:49
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
Definition: PlaceBarrierPoleAction.h:56
EMERGENCY 5 action to place a pole for a barrier tape.
Definition: PlaceBarrierPoleAction.h:41
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20