Emergency 20 Dokumentation  4.2.0
MedicalEmergencyEventFactory.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 //[-------------------------------------------------------]
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public static methods ]
45  //[-------------------------------------------------------]
46  public:
47  static qsf::Entity* getRandomCandidatePerson(const AgeBitmask* ageBitmask = nullptr, bool insideBuilding = false);
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public methods ]
52  //[-------------------------------------------------------]
53  public:
59 
65 
73  std::string getAgeAsString() const;
74 
82  void setAgeAsString(const std::string& jsonAge);
83 
88  inline AgeBitmask getAge() const;
89 
94  inline void setAge(AgeBitmask age);
95 
103  std::string getWeatherAsString() const;
104 
112  void setWeatherAsString(const std::string& weather);
113 
118  inline WeatherComponent::WeatherBitmask getWeather() const;
119 
124  inline void setWeather(WeatherComponent::WeatherBitmask weather);
125 
130  inline bool getInsideBuilding() const;
131 
136  inline void setInsideBuilding(bool insideBuilding);
137 
142  inline const std::string& getEventLayer() const;
143 
148  inline void setEventLayer(const std::string& eventLayer);
149 
150 
151  //[-------------------------------------------------------]
152  //[ Public virtual em5::FreeplayEventFactory methods ]
153  //[-------------------------------------------------------]
154  public:
155  virtual FreeplayEvent* tryTriggerEvent() override;
156 
157 
158  //[-------------------------------------------------------]
159  //[ Protected methods ]
160  //[-------------------------------------------------------]
161  protected:
162  bool checkWeatherConditions() const;
163  qsf::Entity* findCandidate() const;
164 
165 
166  //[-------------------------------------------------------]
167  //[ Private data ]
168  //[-------------------------------------------------------]
169  private:
170  AgeBitmask mAgeBitmask;
171  WeatherComponent::WeatherBitmask mWeatherBitmask;
172  bool mInsideBuilding;
173  std::string mEventLayer;
174 
175 
176  //[-------------------------------------------------------]
177  //[ CAMP reflection system ]
178  //[-------------------------------------------------------]
179  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
180 
181 
182  };
183 
184 
185 //[-------------------------------------------------------]
186 //[ Namespace ]
187 //[-------------------------------------------------------]
188 } // em5
189 
190 
191 //[-------------------------------------------------------]
192 //[ Implementation ]
193 //[-------------------------------------------------------]
195 
196 
197 //[-------------------------------------------------------]
198 //[ CAMP reflection system ]
199 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
qsf::EnumBitmask< uint8, PersonComponent::Age > AgeBitmask
Definition: MedicalEmergencyEventFactory.h:40
Entity class.
Definition: Entity.h:46
#define EM5_API_EXPORT
Definition: Export.h:28
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
EMERGENCY 5 freeplay event factory for "medical emergency".
Definition: MedicalEmergencyEventFactory.h:32
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
EMERGENCY 5 freeplay event factory base class.
Definition: FreeplayEventFactory.h:56
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66