Emergency 20 Dokumentation  4.2.0
SpeedLimitComponent.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  namespace ai
24  {
25  class NavigationComponent;
26  }
27 }
28 
29 
30 //[-------------------------------------------------------]
31 //[ Namespace ]
32 //[-------------------------------------------------------]
33 namespace em5
34 {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Classes ]
39  //[-------------------------------------------------------]
45  {
46 
47 
48  //[-------------------------------------------------------]
49  //[ Public definitions ]
50  //[-------------------------------------------------------]
51  public:
52  static const uint32 COMPONENT_ID;
53  static const uint32 RADIUS;
54  static const uint32 SPEED_LIMIT;
55 
56  static const float DEFAULT_RADIUS;
57  static const float DEFAULT_SPEED_LIMIT;
58 
59 
60  //[-------------------------------------------------------]
61  //[ Public methods ]
62  //[-------------------------------------------------------]
63  public:
71  explicit SpeedLimitComponent(qsf::Prototype* prototype);
72 
77  inline virtual ~SpeedLimitComponent();
78 
85  inline float getRadius() const;
86  inline void setRadius(float radius);
87 
92  inline float getSpeedLimit() const;
93  inline void setSpeedLimit(float speedLimit);
94 
95 
96  //[-------------------------------------------------------]
97  //[ Protected virtual qsf::Component methods ]
98  //[-------------------------------------------------------]
99  protected:
100  virtual bool onStartup() override;
101  virtual void onShutdown() override;
102 
103 
104  //[-------------------------------------------------------]
105  //[ Private data ]
106  //[-------------------------------------------------------]
107  private:
108  // Connected to the CAMP reflection system
109  float mRadius;
110  float mSpeedLimit;
111 
112 
113  //[-------------------------------------------------------]
114  //[ CAMP reflection system ]
115  //[-------------------------------------------------------]
116  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
117 
118 
119  };
120 
121 
122 //[-------------------------------------------------------]
123 //[ Namespace ]
124 //[-------------------------------------------------------]
125 } // em5
126 
127 
128 //[-------------------------------------------------------]
129 //[ Implementation ]
130 //[-------------------------------------------------------]
132 
133 
134 //[-------------------------------------------------------]
135 //[ CAMP reflection system ]
136 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
unsigned int uint32
Definition: PlatformTypes.h:181
EMERGENCY 5 speed limit component to manipulate moving objects in its vicinity.
Definition: SpeedLimitComponent.h:44
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: PickupPersonByParamedicAction.h:21
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
static const float DEFAULT_RADIUS
Default value for radius.
Definition: SpeedLimitComponent.h:56
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
static const float DEFAULT_SPEED_LIMIT
Default value for speed limit.
Definition: SpeedLimitComponent.h:57
static const uint32 RADIUS
"Radius" unique class property ID inside the class
Definition: SpeedLimitComponent.h:53
Prototype class.
Definition: Prototype.h:100
static const uint32 SPEED_LIMIT
"SpeedLimit" unique class property ID inside the class
Definition: SpeedLimitComponent.h:54
static const uint32 COMPONENT_ID
"em5::SpeedLimitComponent" unique component ID
Definition: SpeedLimitComponent.h:52