Emergency 20 Dokumentation  4.2.0
WeatherComponent.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/math/EnumBitmask.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Namespace ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25 
26 
27  //[-------------------------------------------------------]
28  //[ Classes ]
29  //[-------------------------------------------------------]
42  {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public definitions ]
47  //[-------------------------------------------------------]
48  public:
49  static const uint32 COMPONENT_ID;
50 
51  // Event weather flag definitions
53  {
54  WEATHER_UNDEFINED = 0,
65  WEATHER_NORMAL
66  };
67 
68  // Bitmask of all of the above weather flags; allows for arbitrary combinations of the flags
70 
71 
72  //[-------------------------------------------------------]
73  //[ Public methods ]
74  //[-------------------------------------------------------]
75  public:
83  inline explicit WeatherComponent(qsf::Prototype* prototype);
84 
89  inline virtual ~WeatherComponent();
90 
95  inline bool getUseUmbrellas() const;
96 
107  WeatherBitmask getEventWeather() const;
108 
109 
110  //[-------------------------------------------------------]
111  //[ Public virtual qsf::Component methods ]
112  //[-------------------------------------------------------]
113  public:
114  virtual void serialize(qsf::BinarySerializer& serializer) override;
115 
116 
117  //[-------------------------------------------------------]
118  //[ Protected virtual qsf::WeatherComponent methods ]
119  //[-------------------------------------------------------]
120  protected:
121  virtual void onWeatherChange() override;
122  virtual void updateSimulation(const qsf::JobArguments& jobArguments) override;
123 
124 
125  //[-------------------------------------------------------]
126  //[ Private data ]
127  //[-------------------------------------------------------]
128  private:
129  bool mUseUmbrellas;
130  float mLastUseUmbrellaValue;
131  qsf::Time mUmbrellaUpdateTimer;
132  bool mCheckUmbrellaChanges;
133 
134 
135  //[-------------------------------------------------------]
136  //[ CAMP reflection system ]
137  //[-------------------------------------------------------]
138  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
139 
140 
141  };
142 
143 
144 //[-------------------------------------------------------]
145 //[ Namespace ]
146 //[-------------------------------------------------------]
147 } // em5
148 
149 
150 //[-------------------------------------------------------]
151 //[ Implementation ]
152 //[-------------------------------------------------------]
154 
155 
156 //[-------------------------------------------------------]
157 //[ CAMP reflection system ]
158 //[-------------------------------------------------------]
160 QSF_CAMP_TYPE_NONCOPYABLE(em5::WeatherComponent::EventWeather)
Definition: ActionPriority.h:13
static const uint32 COMPONENT_ID
"em5::WeatherComponent" unique component ID
Definition: WeatherComponent.h:49
Definition: WeatherComponent.h:62
unsigned int uint32
Definition: PlatformTypes.h:181
Definition: WeatherComponent.h:59
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: WeatherComponent.h:56
EventWeather
Definition: WeatherComponent.h:52
Definition: WeatherComponent.h:64
EMERGENCY 5 weather core component class.
Definition: WeatherComponent.h:41
Definition: WeatherComponent.h:61
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Weather core component class.
Definition: WeatherComponent.h:64
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
Definition: WeatherComponent.h:63
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Prototype class.
Definition: Prototype.h:100
Definition: WeatherComponent.h:60
Binary serializer class.
Definition: BinarySerializer.h:35
Definition: WeatherComponent.h:57
TODO(fw): Everyone likes enum value descriptions ;)
Definition: WeatherComponent.h:55
Definition: WeatherComponent.h:58
qsf::EnumBitmask< uint32, EventWeather > WeatherBitmask
Definition: WeatherComponent.h:69
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32