Emergency 20 Dokumentation  4.2.0
HelicopterRotorComponent.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 Time;
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:
49  static const uint32 COMPONENT_ID;
50 
51  static const float SPEED_TRESHHOLD;
52  static const float SPEED_LIMIT;
53  static const float SPEED_MAIN_TO_TAIL_FACTOR;
54  static const float SPEED_ACCELERATION_FACTOR;
55  static const float SPEED_DECELERATION_FACTOR;
56 
57  enum RotorType
58  {
61  ROTOR_FAST_BLURRED
62  };
63 
65  {
67  ROTOR_TAIL
68  };
69 
70 
71  //[-------------------------------------------------------]
72  //[ Public methods ]
73  //[-------------------------------------------------------]
74  public:
82  explicit HelicopterRotorComponent(qsf::Prototype* prototype);
83 
88  virtual ~HelicopterRotorComponent();
89 
94  void updateRotor(const qsf::Time& timePassed);
95 
100  RotorType getRotorType() const;
101 
106  void setRotorType(RotorType rotorType);
107 
112  RotorPosition getRotorPosition() const;
113 
118  void setRotorPosition(RotorPosition rotorPosition);
119 
124  float getRotorRealSpeed() const;
125 
130  void setRotorRealSpeed(float rotorRealSpeed);
131 
136  bool hasMaximalSpeed() const;
137 
138 
139  //[-------------------------------------------------------]
140  //[ Public virtual qsf::Component methods ]
141  //[-------------------------------------------------------]
142  public:
143  virtual void serialize(qsf::BinarySerializer& serializer) override;
144 
145 
146  //[-------------------------------------------------------]
147  //[ Private data ]
148  //[-------------------------------------------------------]
149  private:
150  RotorPosition mRotorPosition;
151  RotorType mRotorType;
152  float mRotorRealSpeed;
153 
154 
155  //[-------------------------------------------------------]
156  //[ CAMP reflection system ]
157  //[-------------------------------------------------------]
158  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
159 
160 
161  };
162 
163 
164 //[-------------------------------------------------------]
165 //[ Namespace ]
166 //[-------------------------------------------------------]
167 } // em5
168 
169 
170 //[-------------------------------------------------------]
171 //[ CAMP reflection system ]
172 //[-------------------------------------------------------]
174 QSF_CAMP_TYPE_NONCOPYABLE(em5::HelicopterRotorComponent::RotorPosition)
175 QSF_CAMP_TYPE_NONCOPYABLE(em5::HelicopterRotorComponent::RotorType)
Definition: ActionPriority.h:13
RotorType
Definition: HelicopterRotorComponent.h:57
Abstract component class.
Definition: Component.h:105
unsigned int uint32
Definition: PlatformTypes.h:181
static const float SPEED_DECELERATION_FACTOR
Acceleration factor (used externally)
Definition: HelicopterRotorComponent.h:55
#define EM5_API_EXPORT
Definition: Export.h:28
static const float SPEED_MAIN_TO_TAIL_FACTOR
Rotation speed factor between main and tail rotor.
Definition: HelicopterRotorComponent.h:53
static const float SPEED_TRESHHOLD
Threshold to change from real rotors to blurred rotors.
Definition: HelicopterRotorComponent.h:51
Definition: HelicopterRotorComponent.h:66
RotorPosition
Definition: HelicopterRotorComponent.h:64
static const float SPEED_LIMIT
Maximum speed.
Definition: HelicopterRotorComponent.h:52
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Definition: PickupPersonByParamedicAction.h:21
Definition: HelicopterRotorComponent.h:59
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
EMERGENCY 5 helicopter rotor component class.
Definition: HelicopterRotorComponent.h:41
static const uint32 COMPONENT_ID
"em5::HelicopterRotorComponent" unique component ID
Definition: HelicopterRotorComponent.h:49
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Prototype class.
Definition: Prototype.h:100
Binary serializer class.
Definition: BinarySerializer.h:35
Definition: HelicopterRotorComponent.h:60
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32
static const float SPEED_ACCELERATION_FACTOR
Acceleration factor (used externally)
Definition: HelicopterRotorComponent.h:54