Emergency 20 Dokumentation  4.2.0
UsableByEngineerComponent.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 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
40  static const uint32 COMPONENT_ID;
41 
42  enum Placement
43  {
45  LOW
46  };
47 
48 
49  //[-------------------------------------------------------]
50  //[ Public methods ]
51  //[-------------------------------------------------------]
52  public:
60  explicit UsableByEngineerComponent(qsf::Prototype* prototype);
61 
66  virtual ~UsableByEngineerComponent();
67 
72  void initWithUseTime(qsf::Time useTime);
73 
78  Placement getPlacement() const;
79  void setPlacement(Placement placement);
80 
85  qsf::Time getUseTime() const;
86  void setUseTime(qsf::Time useTime);
87 
88  // Legacy: Only for CAMP property compatibility reasons
89  float getUseTimeInSeconds() const;
90  void setUseTimeInSeconds(float useTime);
91 
96  bool getUsed() const;
97  void setUsed(bool wasUsed);
98 
103  bool getIsInUse() const;
104  void setIsInUse(bool isInUse);
105 
110  void cleanup();
111 
112 
113  //[-------------------------------------------------------]
114  //[ Public virtual qsf::Component methods ]
115  //[-------------------------------------------------------]
116  public:
117  virtual void serialize(qsf::BinarySerializer& serializer) override;
118 
119 
120  //[-------------------------------------------------------]
121  //[ Private data ]
122  //[-------------------------------------------------------]
123  private:
124  Placement mPlacement;
125  qsf::Time mUseTime;
126  bool mUsed;
127  bool mIsInUse;
128 
129 
130  //[-------------------------------------------------------]
131  //[ CAMP reflection system ]
132  //[-------------------------------------------------------]
133  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
134 
135 
136  };
137 
138 
139 //[-------------------------------------------------------]
140 //[ Namespace ]
141 //[-------------------------------------------------------]
142 } // em5
143 
144 
145 //[-------------------------------------------------------]
146 //[ CAMP reflection system ]
147 //[-------------------------------------------------------]
149 QSF_CAMP_TYPE_NONCOPYABLE(em5::UsableByEngineerComponent::Placement)
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
unsigned int uint32
Definition: PlatformTypes.h:181
EMERGENCY 5 usable by engineer component.
Definition: UsableByEngineerComponent.h:32
#define EM5_API_EXPORT
Definition: Export.h:28
Placement
Definition: UsableByEngineerComponent.h:42
Definition: UsableByEngineerComponent.h:44
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
#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
Prototype class.
Definition: Prototype.h:100
static const uint32 COMPONENT_ID
"em5::UsableByEngineerComponent" unique component ID
Definition: UsableByEngineerComponent.h:40
Binary serializer class.
Definition: BinarySerializer.h:35
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32