Emergency 20 Dokumentation  4.2.0
RescuePersonFromBuildingAction.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 //[-------------------------------------------------------]
14 #include <qsf/math/Transform.h>
15 
16 
17 //[-------------------------------------------------------]
18 //[ Namespace ]
19 //[-------------------------------------------------------]
20 namespace em5
21 {
22 
23 
24  //[-------------------------------------------------------]
25  //[ Classes ]
26  //[-------------------------------------------------------]
32  {
33 
34 
35  //[-------------------------------------------------------]
36  //[ Public definitions ]
37  //[-------------------------------------------------------]
38  public:
40 
41 
42  //[-------------------------------------------------------]
43  //[ Public methods ]
44  //[-------------------------------------------------------]
45  public:
51 
57 
62  void init(const qsf::Entity& targetEntity);
63 
64 
65  //[-------------------------------------------------------]
66  //[ Public virtual qsf::Actions methods ]
67  //[-------------------------------------------------------]
68  public:
69  virtual void serialize(qsf::BinarySerializer& serializer) override;
70 
71 
72  //[-------------------------------------------------------]
73  //[ Protected virtual qsf::Action methods ]
74  //[-------------------------------------------------------]
75  protected:
76  virtual bool onStartup() override;
77  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
78 
79 
80  //[-------------------------------------------------------]
81  //[ Private definitions ]
82  //[-------------------------------------------------------]
83  private:
84  enum State
85  {
86  STATE_INIT,
87  STATE_ENTER,
88  STATE_WAIT_FOR_COMPLETE_TEAM,
89  STATE_RESCUE_PERSONS,
90  STATE_DONE
91  };
92 
93 
94  //[-------------------------------------------------------]
95  //[ Private data ]
96  //[-------------------------------------------------------]
97  private:
98  uint64 mTargetEntityId; // ID of the building
99  State mCurrentState;
100  qsf::Time mCurrentTime;
101  qsf::Time mTotalTime;
102  qsf::Transform mOldTransform;
103  bool mNeedsToHideOverlay;
104 
105 
106  //[-------------------------------------------------------]
107  //[ CAMP reflection system ]
108  //[-------------------------------------------------------]
109  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
110 
111 
112  };
113 
114 
115 //[-------------------------------------------------------]
116 //[ Namespace ]
117 //[-------------------------------------------------------]
118 } // em5
119 
120 
121 //[-------------------------------------------------------]
122 //[ CAMP reflection system ]
123 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
EMERGENCY 5 rescue from building action.
Definition: RescuePersonFromBuildingAction.h:31
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
3D transform class
Definition: Transform.h:45
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
static const qsf::NamedIdentifier ACTION_ID
"em5::RescuePersonFromBuildingAction" unique action identifier
Definition: RescuePersonFromBuildingAction.h:39
State
Definition: ProcessState.h:20
#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
Abstract action base class.
Definition: Action.h:59
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32