Emergency 20 Dokumentation  4.2.0
BuryComponent-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  mIsHidden(false),
23  mDraggable(false),
24  mCutableBySaw(false),
25  mIsBlocked(false),
26  BuriedEntitiesArray(*this, mBuriedEntities)
27  {
28  // Nothing here
29  }
30 
31  inline bool BuryComponent::getIsHidden() const
32  {
33  return mIsHidden;
34  }
35 
36  inline void BuryComponent::setIsHidden(bool isHidden)
37  {
38  mIsHidden = isHidden;
39  }
40 
41  inline bool BuryComponent::getDraggable() const
42  {
43  return mDraggable;
44  }
45 
46  inline void BuryComponent::setDraggable(bool draggable)
47  {
48  mDraggable = draggable;
49  }
50 
51  inline bool BuryComponent::getCutableBySaw() const
52  {
53  return mCutableBySaw;
54  }
55 
56  inline void BuryComponent::setCutableBySaw(bool cutableBySaw)
57  {
58  mCutableBySaw = cutableBySaw;
59 
60  if (isSimulating())
61  {
62  showCuttableBySawIcon(cutableBySaw);
63  }
64  }
65 
66 
67  //[-------------------------------------------------------]
68  //[ CAMP reflection system ]
69  //[-------------------------------------------------------]
70  inline std::size_t BuryComponent::EntityIdArrayInterface::size() const
71  {
72  return getVariable().size();
73  }
74 
75  inline const uint64& BuryComponent::EntityIdArrayInterface::get(std::size_t index) const
76  {
77  return getVariable()[index];
78  }
79 
80  inline void BuryComponent::EntityIdArrayInterface::set(std::size_t index, const uint64& value)
81  {
82  getVariable()[index] = value;
83  }
84 
85  inline void BuryComponent::EntityIdArrayInterface::insert(std::size_t before, const uint64& value)
86  {
87  getVariable().insert(getVariable().begin() + before, value);
88  }
89 
90  inline void BuryComponent::EntityIdArrayInterface::remove(std::size_t index)
91  {
92  getVariable().erase(getVariable().begin() + index);
93  }
94 
95 
96 //[-------------------------------------------------------]
97 //[ Namespace ]
98 //[-------------------------------------------------------]
99 } // em5
Definition: ActionPriority.h:13
bool getIsHidden() const
Get if the entity is visible or invisible for the player. Don't mix with the "isHidden" function from...
Definition: BuryComponent-inl.h:31
bool isSimulating() const
Return whether or not the component is in simulating mode.
Definition: Component-inl.h:37
void setDraggable(bool draggable)
Definition: BuryComponent-inl.h:46
uint64_t uint64
Definition: PlatformTypes.h:184
void showCuttableBySawIcon(bool enable)
void setCutableBySaw(bool cutableBySaw)
Definition: BuryComponent-inl.h:56
Definition: PickupPersonByParamedicAction.h:21
bool getCutableBySaw() const
Definition: BuryComponent-inl.h:51
bool getDraggable() const
Definition: BuryComponent-inl.h:41
BuryComponent(qsf::Prototype *prototype)
Constructor.
Definition: BuryComponent-inl.h:20
Prototype class.
Definition: Prototype.h:100
bool isHidden() const
Return whether or not the component is hidden.
Definition: Component-inl.h:52
void setIsHidden(bool isHidden)
Definition: BuryComponent-inl.h:36