Emergency 20 Dokumentation  4.2.0
StakeComponent.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 
17 #include <qsf/time/Time.h>
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 StakeComponent(qsf::Prototype* prototype);
57 
62  virtual ~StakeComponent();
63 
64  qsf::Transform getActionTransform();
65 
66  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(RescueTime, qsf::Time, mRescueTime);
67  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(WitchEntity, uint64, mWitchEntityId);
68  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(ActionPosition, uint64, mActionPositionEntityId);
69  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(canBeIgnited, bool, mCanBeIgnited);
70 
71  void turnOffIcons();
72 
73  void setWitchHidden(bool hidden);
74 
75 
76  //[-------------------------------------------------------]
77  //[ Protected virtual qsf::Component methods ]
78  //[-------------------------------------------------------]
79  protected:
80  virtual void onSetSimulating(bool simulating);
81  virtual void onSetActive(bool active);
82 
83 
84  //[-------------------------------------------------------]
85  //[ Private methods ]
86  //[-------------------------------------------------------]
87  private:
88  void internalSetActive(bool active);
89 
90 
91  //[-------------------------------------------------------]
92  //[ Private data ]
93  //[-------------------------------------------------------]
94  private:
95  qsf::Time mRescueTime;
96  uint64 mWitchEntityId; // Id of the witch person
97  uint64 mActionPositionEntityId;
98  bool mCanBeIgnited; // "true" at start, false if a guardsman rescuing is active or finished
99  bool mInternalActive;
100 
101 
102  //[-------------------------------------------------------]
103  //[ CAMP reflection system ]
104  //[-------------------------------------------------------]
105  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
106 
107 
108  };
109 
110 
111 //[-------------------------------------------------------]
112 //[ Namespace ]
113 //[-------------------------------------------------------]
114 } // em5
115 
116 
117 //[-------------------------------------------------------]
118 //[ CAMP reflection system ]
119 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 2017 Stake Object Component.
Definition: StakeComponent.h:34
Abstract component class.
Definition: Component.h:105
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
static const uint32 COMPONENT_ID
"em5::StakeComponent" unique component ID
Definition: StakeComponent.h:42
3D transform class
Definition: Transform.h:45
#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
#define QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(name, type, variable)
Definition: PropertyHelper.h:16
Prototype class.
Definition: Prototype.h:100
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32