Emergency 20 Dokumentation  4.2.0
BuryComponent.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 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
16 
17 #include <vector>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Namespace ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25 
26 
27  //[-------------------------------------------------------]
28  //[ Classes ]
29  //[-------------------------------------------------------]
35  {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Public definitions ]
40  //[-------------------------------------------------------]
41  public:
42  static const uint32 COMPONENT_ID;
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public methods ]
47  //[-------------------------------------------------------]
48  public:
56  explicit inline BuryComponent(qsf::Prototype* prototype);
57 
62  virtual ~BuryComponent();
63 
68  inline bool getIsHidden() const;
69  inline void setIsHidden(bool isHidden);
70 
71  inline bool getDraggable() const;
72  inline void setDraggable(bool draggable);
73 
74  inline bool getCutableBySaw() const;
75  inline void setCutableBySaw(bool cutableBySaw);
76 
77  bool isBlocked() const;
78  void setBlocked(bool blocked);
79 
80  void unlinkAndShowBuriedEntities();
81 
82  void buryEntity(qsf::Entity& entity);
83  void showCuttableBySawIcon(bool enable);
84 
85 
86  //[-------------------------------------------------------]
87  //[ Public virtual qsf::Component methods ]
88  //[-------------------------------------------------------]
89  public:
90  virtual void serialize(qsf::BinarySerializer& serializer) override;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Protected virtual qsf::Component methods ]
95  //[-------------------------------------------------------]
96  protected:
97  virtual void onSetSimulating(bool simulating) override;
98 
99 
100  //[-------------------------------------------------------]
101  //[ Private definitions ]
102  //[-------------------------------------------------------]
103  private:
104  typedef std::vector<uint64> EntityIdArray;
105 
106 
107  //[-------------------------------------------------------]
108  //[ Private methods ]
109  //[-------------------------------------------------------]
110  private:
111  void showBuriedEntities();
112  void hideBuriedEntities();
113  void setBuriedEntityHiddenType(qsf::Entity& buriedEntity) const;
114 
115 
116  //[-------------------------------------------------------]
117  //[ Private data ]
118  //[-------------------------------------------------------]
119  private:
120  bool mIsHidden;
121  bool mDraggable;
122  bool mCutableBySaw;
123  bool mIsBlocked;
124  EntityIdArray mBuriedEntities;
125 
126 
127  //[-------------------------------------------------------]
128  //[ CAMP reflection system ]
129  //[-------------------------------------------------------]
130  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
131 
132  public:
133  QSF_CAMP_ARRAY_INTERFACE_CLASS_WITH_VARIABLE(EntityIdArrayInterface, BuryComponent, std::vector<uint64>, uint64);
134  EntityIdArrayInterface BuriedEntitiesArray;
135 
136 
137  };
138 
139 
140 //[-------------------------------------------------------]
141 //[ Namespace ]
142 //[-------------------------------------------------------]
143 } // em5
144 
145 
146 //[-------------------------------------------------------]
147 //[ Implementation ]
148 //[-------------------------------------------------------]
149 #include "em5/component/objects/BuryComponent-inl.h"
150 
151 
152 //[-------------------------------------------------------]
153 //[ CAMP reflection system ]
154 //[-------------------------------------------------------]
156 QSF_CAMP_ARRAY_MAPPER_DEFINITION(em5::BuryComponent::EntityIdArrayInterface)
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
#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
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
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
static const uint32 COMPONENT_ID
"em5::BuryComponent" unique component ID
Definition: BuryComponent.h:42
Prototype class.
Definition: Prototype.h:100
Binary serializer class.
Definition: BinarySerializer.h:35
EMERGENCY 5 bury component class; given to the entity how burys other entities.
Definition: BuryComponent.h:34