Emergency 20 Dokumentation  4.2.0
PlaceBarrierTapeCommandMode.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 #include <qsf/reflection/CampClass.h> // This include is not needed here directly, but most likely in a derived class
18 #include <qsf/base/WeakPtr.h>
19 #include <qsf/time/Time.h>
20 
21 
22 //[-------------------------------------------------------]
23 //[ Forward declarations ]
24 //[-------------------------------------------------------]
25 namespace qsf
26 {
27  class Entity;
28 }
29 namespace em5
30 {
31  class BarrierTapeComponent;
32 }
33 
34 
35 //[-------------------------------------------------------]
36 //[ Namespace ]
37 //[-------------------------------------------------------]
38 namespace em5
39 {
40 
41 
42  //[-------------------------------------------------------]
43  //[ Classes ]
44  //[-------------------------------------------------------]
53  {
54 
55 
56  //[-------------------------------------------------------]
57  //[ Public definitions ]
58  //[-------------------------------------------------------]
59  public:
60  static const uint32 PLUGINABLE_ID;
61 
62 
63  //[-------------------------------------------------------]
64  //[ Public methods ]
65  //[-------------------------------------------------------]
66  public:
72 
77  virtual ~PlaceBarrierTapeCommandMode();
78 
83  void initialize(qsf::Entity& caller);
84 
85 
86  //[-------------------------------------------------------]
87  //[ Public virtual qsf::game::CommandMode methods ]
88  //[-------------------------------------------------------]
89  public:
90  virtual void startup() override;
91  virtual void shutdown() override;
92  virtual bool executeCommandContext(qsf::game::CommandContext& commandContext, const EntityIdSet& callerIds) override;
93  virtual void updateCommandMode(const qsf::Clock& clock) override;
94 
95 
96  //[-------------------------------------------------------]
97  //[ Private definitions ]
98  //[-------------------------------------------------------]
99  private:
100  static const uint32 ACTION_PRIORITY;
101 
102 
103  //[-------------------------------------------------------]
104  //[ Private methods ]
105  //[-------------------------------------------------------]
106  private:
107  // Find the position of the first hit in the scene which is _not_ the pole itself
108  bool get3dPositionUnderMouse(const glm::vec2& normalizedMousePosition, glm::vec3& outPosition, BarrierTapeComponent* barrierTapeComponent);
109 
110 
111  //[-------------------------------------------------------]
112  //[ Private data ]
113  //[-------------------------------------------------------]
114  private:
115  qsf::Entity* mCaller;
116  qsf::Time mElapsedWaitTime;
117  qsf::WeakPtr<BarrierTapeComponent> mBarrierTapeComponent;
118  uint32 mPreviewPole;
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 barrier tape component.
Definition: BarrierTapeComponent.h:46
Entity class.
Definition: Entity.h:46
Place a tape barrier that stops persons.
Definition: PlaceBarrierTapeCommandMode.h:52
unsigned int uint32
Definition: PlatformTypes.h:181
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
static const uint32 PLUGINABLE_ID
"em5::PlaceBarrierTapeCommandMode" unique command pluginable ID
Definition: PlaceBarrierTapeCommandMode.h:60
Definition: PickupPersonByParamedicAction.h:21
#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
Command mode base class.
Definition: CommandMode.h:51
boost::container::flat_set< uint64 > EntityIdSet
Definition: CommandMode.h:59
Command context base class.
Definition: CommandContext.h:48
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32