Emergency 20 Dokumentation  4.2.0
EboxComponent-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Includes ]
6 //[-------------------------------------------------------]
8 
9 #include <camp/arraymapper.hpp>
10 
11 
12 //[-------------------------------------------------------]
13 //[ Namespace ]
14 //[-------------------------------------------------------]
15 namespace em5
16 {
17 
18 
19  //[-------------------------------------------------------]
20  //[ Public methods ]
21  //[-------------------------------------------------------]
23  ObjectDamageComponent(prototype),
24  mFlashWaitTime(5.0f, 10.0f),
25  mSparksWaitTime(5.0f, 10.0f),
26  mIsDefect(false),
27  mGapeChance(0.0f),
28  mReactionRadius(0.0f),
29  mMaxInjuredPersons(1),
30  mCurrentInjuredPersons(0),
31  mSecondsToNextFlash(qsf::Time::ZERO),
32  mSecondsToNextSparks(qsf::Time::ZERO),
33  FlashParticlesArray(*this, mFlashParticlesIds),
34  SparksParticlesArray(*this, mSparksParticlesIds)
35  {
36  // Nothing here
37  }
38 
40  {
41  // Nothing to do in here
42  }
43 
44  inline bool EboxComponent::isDefect() const
45  {
46  return mIsDefect;
47  }
48 
50  {
51  return mDamageMesh;
52  }
53 
55  {
56  mDamageMesh = mesh;
57  }
58 
59 
60  //[-------------------------------------------------------]
61  //[ Public virtual em5::DamageComponent methods ]
62  //[-------------------------------------------------------]
64  {
66  }
67 
68 
69  //[-------------------------------------------------------]
70  //[ CAMP reflection system ]
71  //[-------------------------------------------------------]
72  inline std::size_t EboxComponent::EntityIdArrayInterface::size() const
73  {
74  return getVariable().size();
75  }
76 
77  inline const uint64& EboxComponent::EntityIdArrayInterface::get(std::size_t index) const
78  {
79  return getVariable()[index];
80  }
81 
82  inline void EboxComponent::EntityIdArrayInterface::set(std::size_t index, const uint64& value)
83  {
84  getVariable()[index] = value;
85  }
86 
87  inline void EboxComponent::EntityIdArrayInterface::insert(std::size_t before, const uint64& value)
88  {
89  getVariable().insert(getVariable().begin() + before, value);
90  }
91 
92  inline void EboxComponent::EntityIdArrayInterface::remove(std::size_t index)
93  {
94  getVariable().erase(getVariable().begin() + index);
95  }
96 
97 
98 //[-------------------------------------------------------]
99 //[ Namespace ]
100 //[-------------------------------------------------------]
101 } // em5
Definition: ActionPriority.h:13
virtual bool isReadyForCleanup() const override
Check if the deco object component is ready for cleanup.
Definition: ObjectDamageComponent-inl.h:25
uint64_t uint64
Definition: PlatformTypes.h:184
virtual bool isDamaged() const
Definition: DamageComponent-inl.h:77
const qsf::AssetProxy & getDefectMesh() const
Definition: EboxComponent-inl.h:49
Definition: PickupPersonByParamedicAction.h:21
EboxComponent(qsf::Prototype *prototype)
Constructor.
Definition: EboxComponent-inl.h:22
bool isDefect() const
Definition: EboxComponent-inl.h:44
Asset proxy class.
Definition: AssetProxy.h:57
virtual bool isReadyForCleanup() const override
Check if the deco object component is ready for cleanup.
Definition: EboxComponent-inl.h:63
virtual ~EboxComponent()
Destructor.
Definition: EboxComponent-inl.h:39
void setDefectMesh(const qsf::AssetProxy &mesh)
Definition: EboxComponent-inl.h:54
Prototype class.
Definition: Prototype.h:100
EMERGENCY 5 deco object component class.
Definition: ObjectDamageComponent.h:30