Emergency 20 Dokumentation  4.2.0
ContaminationComponent-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Includes ]
6 //[-------------------------------------------------------]
7 #include <camp/arraymapper.hpp>
8 
9 
10 //[-------------------------------------------------------]
11 //[ Namespace ]
12 //[-------------------------------------------------------]
13 namespace em5
14 {
15 
16 
17  //[-------------------------------------------------------]
18  //[ Public methods ]
19  //[-------------------------------------------------------]
21  qsf::Component(prototype),
22  mContaminationType(Injury::CONTAMINATION_NONE),
23  mContaminationLimit(8),
24  mContaminatedPersons(0),
25  CloudArray(*this, mContaminationCloudIds)
26  {
27  // Nothing to do in here
28  }
29 
31  {
32  // Nothing to do in here
33  }
34 
36  {
37  return mContaminationType;
38  }
39 
41  {
42  mContaminationType = contaminationType;
43  }
44 
45 
46  //[-------------------------------------------------------]
47  //[ CAMP reflection system ]
48  //[-------------------------------------------------------]
49  inline std::size_t ContaminationComponent::EntityIdArrayInterface::size() const
50  {
51  return getVariable().size();
52  }
53 
54  inline const uint64& ContaminationComponent::EntityIdArrayInterface::get(std::size_t index) const
55  {
56  return getVariable()[index];
57  }
58 
59  inline void ContaminationComponent::EntityIdArrayInterface::set(std::size_t index, const uint64& value)
60  {
61  getVariable()[index] = value;
62  }
63 
64  inline void ContaminationComponent::EntityIdArrayInterface::insert(std::size_t before, const uint64& value)
65  {
66  getVariable().insert(getVariable().begin() + before, value);
67  }
68 
69  inline void ContaminationComponent::EntityIdArrayInterface::remove(std::size_t index)
70  {
71  getVariable().erase(getVariable().begin() + index);
72  }
73 
75  {
76  return mContaminationLimit;
77  }
78 
79  inline void ContaminationComponent::setContaminationLimit(uint32 contaminationLimit)
80  {
81  mContaminationLimit = contaminationLimit;
82  }
83 
85  {
86  return mContaminatedPersons;
87  }
88 
89 
90 //[-------------------------------------------------------]
91 //[ Namespace ]
92 //[-------------------------------------------------------]
93 } // em5
Definition: ActionPriority.h:13
uint32 mContaminationLimit
Limit of persons that are contaminated by the industrial plant.
Definition: ContaminationComponent.h:154
unsigned int uint32
Definition: PlatformTypes.h:181
ContaminationType getContaminationType() const
Get contamination type.
Definition: ContaminationComponent-inl.h:35
uint64_t uint64
Definition: PlatformTypes.h:184
Definition: PickupPersonByParamedicAction.h:21
void setContaminationType(ContaminationType contaminationType)
Set contamination type.
Definition: ContaminationComponent-inl.h:40
Injury::ContaminationType mContaminationType
What kind of contamination are the clouds spreading.
Definition: ContaminationComponent.h:153
void setContaminationLimit(uint32 contaminationLimit)
Set contamination limit type.
Definition: ContaminationComponent-inl.h:79
uint32 getContaminationLimit() const
Get contamination limit type.
Definition: ContaminationComponent-inl.h:74
virtual ~ContaminationComponent()
Destructor.
Definition: ContaminationComponent-inl.h:30
ContaminationComponent(qsf::Prototype *prototype)
Constructor.
Definition: ContaminationComponent-inl.h:20
Prototype class.
Definition: Prototype.h:100
uint32 getContaminatedPersons() const
Get the number of persons which got contaminated by the plant. Counter only increases (no decrease by...
Definition: ContaminationComponent-inl.h:84
ContaminationType
Definition: Injury.h:67
uint32 mContaminatedPersons
Persons that were contaminated.
Definition: ContaminationComponent.h:155
Injury definition class.
Definition: Injury.h:44