Emergency 20 Dokumentation  4.2.0
GameComponent.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 
43  //[-------------------------------------------------------]
44  //[ Public methods ]
45  //[-------------------------------------------------------]
46  public:
51  explicit GameComponent(qsf::Prototype* prototype);
52 
57  ~GameComponent();
58 
59  float getGameSpeed() const;
60  void setGameSpeed(float gameSpeed);
61 
62  inline bool isInTutorial() const;
63  void setInTutorial(bool tutorialRunning);
64 
65  bool getFireSimulationActive() const;
66  void setFireSimulationActive(bool fireSimulationActive);
67 
68  bool getHealthSimulationActive() const;
69  void setHealthSimulationActive(bool healthSimulationActive);
70 
71  inline bool getDamageSimulationActive() const;
72  void setDamageSimulationActive(bool damageSimulationActive);
73 
74  // TODO(vs) Not used anymore.
75  // I am bit skeptical about the other behavior flags below.
76  // I think ai::NavigationComponent isActive should be sufficient for all these use cases and disable all movement
77  inline bool getCivilistBehaviorActive() const;
78  void setCivilistBehaviorActive(bool civilistBehaviorActive);
79 
80  inline bool getCivilPersonMovement() const;
81  void setCivilPersonMovement(bool civilPersonMovement);
82 
83  inline bool getCivilVehiclesDrive() const;
84  void setCivilVehiclesDrive(bool civilVehiclesDrive);
85 
86  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(CivilVehiclesStuckCheck, bool, mCivilVehiclesStuckCheck);
87 
88  inline bool getUnitAutomatismActive() const;
89  void setUnitAutomatismActive(bool unitAutomatismActive);
90 
91  inline bool getAutoEnteringOfDoctorActive() const;
92  void setAutoEnteringOfDoctorActive(bool active);
93 
94  inline bool getShowGroundMarkersForAllOwnUnits() const;
95  void setShowGroundMarkersForAllOwnUnits(bool showGroundMarkersForAllOwnUnits);
96 
97 
98  //[-------------------------------------------------------]
99  //[ Private data ]
100  //[-------------------------------------------------------]
101  private:
102  bool mInTutorial;
103  bool mDamageSystemActive;
104  bool mCivilistBehaviorActive;
105  bool mCivilPersonMovement;
106  bool mCivilVehiclesDrive;
107  bool mCivilVehiclesStuckCheck;
108  bool mUnitAutomatismActive;
109  bool mAutoEnteringOfDoctorActive;
110  bool mShowGroundMarkersForAllOwnUnits;
111 
112 
113  //[-------------------------------------------------------]
114  //[ CAMP reflection system ]
115  //[-------------------------------------------------------]
116  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
117 
118 
119  };
120 
121 
122 //[-------------------------------------------------------]
123 //[ Namespace ]
124 //[-------------------------------------------------------]
125 } // em5
126 
127 
128 //[-------------------------------------------------------]
129 //[ Implementation ]
130 //[-------------------------------------------------------]
132 
133 
134 //[-------------------------------------------------------]
135 //[ CAMP reflection system ]
136 //[-------------------------------------------------------]
static const uint32 COMPONENT_ID
"em5::GameComponent" unique component ID
Definition: GameComponent.h:40
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
EMERGENCY 5 game component class. Holds information for the map properties.
Definition: GameComponent.h:32
#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