Emergency 20 Dokumentation  4.2.0
ContaminationComponent.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 //[-------------------------------------------------------]
14 
16 
17 #include <vector>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25  class ContaminationCloudComponent;
26 }
27 
28 
29 //[-------------------------------------------------------]
30 //[ Namespace ]
31 //[-------------------------------------------------------]
32 namespace em5
33 {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public definitions ]
49  //[-------------------------------------------------------]
50  public:
51  static const uint32 COMPONENT_ID;
52 
53  // Shortcuts
55 
56 
57  //[-------------------------------------------------------]
58  //[ Public methods ]
59  //[-------------------------------------------------------]
60  public:
68  inline explicit ContaminationComponent(qsf::Prototype* prototype);
69 
74  inline virtual ~ContaminationComponent();
75 
80  void startSimulation();
81 
86  void stopSimulation();
87 
92  inline ContaminationType getContaminationType() const;
93 
98  inline void setContaminationType(ContaminationType contaminationType);
99 
104  inline uint32 getContaminationLimit() const;
105 
110  inline void setContaminationLimit(uint32 contaminationLimit);
111 
116  void increaseContaminatedPersons();
117 
123  inline uint32 getContaminatedPersons() const;
124 
129  void getContaminationCloudComponents(std::vector<ContaminationCloudComponent*>& components, bool showError = true) const;
130 
131 
132  //[-------------------------------------------------------]
133  //[ Public virtual qsf::Component methods ]
134  //[-------------------------------------------------------]
135  public:
136  virtual void serialize(qsf::BinarySerializer& serializer) override;
137  virtual void onSetDebug(bool debug) override;
138 
139 
140  //[-------------------------------------------------------]
141  //[ Private definition ]
142  //[-------------------------------------------------------]
143  private:
144  typedef std::vector<uint64> CloudIdArray;
145 
146 
147  //[-------------------------------------------------------]
148  //[ Private data ]
149  //[-------------------------------------------------------]
150  public:
151  // Connected to CAMP
152  CloudIdArray mContaminationCloudIds;
156 
157 
158  //[-------------------------------------------------------]
159  //[ CAMP reflection system ]
160  //[-------------------------------------------------------]
161  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
162 
163  public:
164  QSF_CAMP_ARRAY_INTERFACE_CLASS_WITH_VARIABLE(EntityIdArrayInterface, ContaminationComponent, std::vector<uint64>, uint64);
165  EntityIdArrayInterface CloudArray;
166 
167 
168  };
169 
170 
171 //[-------------------------------------------------------]
172 //[ Namespace ]
173 //[-------------------------------------------------------]
174 } // em5
175 
176 
177 //[-------------------------------------------------------]
178 //[ Implementation ]
179 //[-------------------------------------------------------]
180 #include "em5/component/objects/ContaminationComponent-inl.h"
181 
182 
183 //[-------------------------------------------------------]
184 //[ CAMP reflection system ]
185 //[-------------------------------------------------------]
187 QSF_CAMP_ARRAY_MAPPER_DEFINITION(em5::ContaminationComponent::EntityIdArrayInterface)
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
uint32 mContaminationLimit
Limit of persons that are contaminated by the industrial plant.
Definition: ContaminationComponent.h:154
unsigned int uint32
Definition: PlatformTypes.h:181
static const uint32 COMPONENT_ID
"em5::ContaminationComponent" unique component ID
Definition: ContaminationComponent.h:51
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: AreaConfiguration.h:58
#define QSF_CAMP_ARRAY_INTERFACE_CLASS_WITH_VARIABLE(interfaceClassName, ownerType, variableType, elementType)
Definition: CampClass.h:241
uint64_t uint64
Definition: PlatformTypes.h:184
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Injury::ContaminationType ContaminationType
Definition: ContaminationComponent.h:54
QSF_CAMP_ARRAY_MAPPER_DEFINITION(qsf::ai::TrafficLightTimerComponent::ManagedTrafficLightList)
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
CloudIdArray mContaminationCloudIds
Array of contamination cloud entity IDs.
Definition: ContaminationComponent.h:152
Injury::ContaminationType mContaminationType
What kind of contamination are the clouds spreading.
Definition: ContaminationComponent.h:153
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
EMERGENCY 5 contamination component class.
Definition: ContaminationComponent.h:43
Prototype class.
Definition: Prototype.h:100
ContaminationType
Definition: Injury.h:67
uint32 mContaminatedPersons
Persons that were contaminated.
Definition: ContaminationComponent.h:155
Binary serializer class.
Definition: BinarySerializer.h:35