Emergency 20 Dokumentation  4.2.0
MoveToDespawnComponent.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 #include <qsf/job/JobProxy.h>
17 #include <qsf/time/Time.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace qsf
24 {
25  class ActionComponent;
26 }
27 namespace em5
28 {
29  class CivilistSpawnPointComponent;
30 }
31 
32 
33 //[-------------------------------------------------------]
34 //[ Namespace ]
35 //[-------------------------------------------------------]
36 namespace em5
37 {
38 
39 
40  //[-------------------------------------------------------]
41  //[ Classes ]
42  //[-------------------------------------------------------]
48  {
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public definitions ]
53  //[-------------------------------------------------------]
54  public:
55  static const uint32 COMPONENT_ID;
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public methods ]
60  //[-------------------------------------------------------]
61  public:
69  explicit MoveToDespawnComponent(qsf::Prototype* prototype);
70 
75  virtual ~MoveToDespawnComponent();
76 
77  uint32 getActionPriority() const;
78  void setActionPriority(uint32 priority);
79 
80  uint32 getMovementMode() const;
81  void setMovementMode(uint32 movementMode);
82 
95  void getExitAndTransitSpawnPoints(std::vector<CivilistSpawnPointComponent*>& exitSpawnPointComponentVector, std::vector<CivilistSpawnPointComponent*>& transitSpawnPointComponentVector);
96 
97 
98  //[-------------------------------------------------------]
99  //[ Protected virtual qsf::Component methods ]
100  //[-------------------------------------------------------]
101  protected:
102  virtual void onSetSimulating(bool simulating) override;
103  virtual void onSetActive(bool active) override;
104 
105 
106  //[-------------------------------------------------------]
107  //[ Private methods ]
108  //[-------------------------------------------------------]
109  private:
110  void updateJob(const qsf::JobArguments& jobArguments);
111 
115  void setUpdateFrequency(qsf::Time updateInterval);
116 
117  void startMoveToDespawnPoint();
118 
119 
120  //[-------------------------------------------------------]
121  //[ Private definitions ]
122  //[-------------------------------------------------------]
123  private:
130  static const uint32 sNumberOfRandomTries;
131 
132 
133  //[-------------------------------------------------------]
134  //[ Private data ]
135  //[-------------------------------------------------------]
136  private:
137  uint32 mCountDespawnTries;
138  qsf::JobProxy mUpdateJobProxy;
139  uint32 mPriority;
140  uint32 mMovementMode;
141  qsf::WeakPtr<qsf::ActionComponent> mActionComponent;
142 
143  bool mStartedMovement;
144  glm::vec3 mStartPosition;
145 
146 
147  //[-------------------------------------------------------]
148  //[ CAMP reflection system ]
149  //[-------------------------------------------------------]
150  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
151 
152 
153  };
154 
155 
156 //[-------------------------------------------------------]
157 //[ Namespace ]
158 //[-------------------------------------------------------]
159 } // em5
160 
161 
162 //[-------------------------------------------------------]
163 //[ CAMP reflection system ]
164 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Abstract component class.
Definition: Component.h:105
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
#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::MoveToDespawnComponent" unique component ID
Definition: MoveToDespawnComponent.h:55
Prototype class.
Definition: Prototype.h:100
EMERGENCY 5 move to despawn point component.
Definition: MoveToDespawnComponent.h:47
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32