Emergency 20 Dokumentation  4.2.0
DLKSavePersonAction.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 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class DlkLadderComponent;
24 }
25 namespace qsf
26 {
27  class GameLogicComponent;
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Classes ]
40  //[-------------------------------------------------------]
46  {
47 
48 
49  //[-------------------------------------------------------]
50  //[ Public definitions ]
51  //[-------------------------------------------------------]
52  public:
54 
55  enum State
56  {
67  STATE_DONE
68  };
69 
70 
71  //[-------------------------------------------------------]
72  //[ Public methods ]
73  //[-------------------------------------------------------]
74  public:
80 
85  virtual ~DLKSavePersonAction();
86 
91  void init(uint64 targetEntityId);
92 
93  uint64 getTargetEntityId() const;
94 
95 
96  //[-------------------------------------------------------]
97  //[ Public virtual qsf::Actions methods ]
98  //[-------------------------------------------------------]
99  public:
100  virtual void serialize(qsf::BinarySerializer& serializer) override;
101 
102 
103  //[-------------------------------------------------------]
104  //[ Protected virtual qsf::Action methods ]
105  //[-------------------------------------------------------]
106  protected:
107  virtual bool onStartup() override;
108  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
109  virtual void onShutdown() override;
110 
111 
112  //[-------------------------------------------------------]
113  //[ Private methods ]
114  //[-------------------------------------------------------]
115  private:
116  void fadeOutPerson();
117  void rescuePersonFromBuilding();
118  void rescuePersonFromDlk();
119  void updateGameLogicComponent();
120  void putEntityOnDlk(qsf::Entity* entity);
121  glm::vec3 getTargetPosition(qsf::Entity& targetEntity);
122 
123 
124  //[-------------------------------------------------------]
125  //[ Private data ]
126  //[-------------------------------------------------------]
127  private:
128  uint64 mTargetEntityId;
129  State mCurrentState;
130  float mSecondsPassed;
131  qsf::GameLogicComponent* mGameLogicComponent;
132  bool mInjurePersonAfterRescue;
133  bool mActivateFireReceiverAfterRescue;
134  qsf::WeakPtr<DlkLadderComponent> mDlkLadderComponent;
135 
136 
137  //[-------------------------------------------------------]
138  //[ CAMP reflection system ]
139  //[-------------------------------------------------------]
140  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
141 
142 
143  };
144 
145 
146 //[-------------------------------------------------------]
147 //[ Namespace ]
148 //[-------------------------------------------------------]
149 } // em5
150 
151 
152 //[-------------------------------------------------------]
153 //[ CAMP reflection system ]
154 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Definition: DLKSavePersonAction.h:61
Definition: DLKSavePersonAction.h:64
Definition: DLKSavePersonAction.h:62
Entity class.
Definition: Entity.h:46
Definition: DLKSavePersonAction.h:58
Definition: DLKSavePersonAction.h:66
Definition: DLKSavePersonAction.h:65
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
Game logic component class.
Definition: GameLogicComponent.h:45
Definition: DLKSavePersonAction.h:60
State
Definition: DLKSavePersonAction.h:55
uint64_t uint64
Definition: PlatformTypes.h:184
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
Definition: DLKSavePersonAction.h:63
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Definition: PickupPersonByParamedicAction.h:21
static const qsf::NamedIdentifier ACTION_ID
"em5::DLKSavePersonAction" unique action identifier
Definition: DLKSavePersonAction.h:53
State
Definition: ProcessState.h:20
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
Definition: DLKSavePersonAction.h:59
#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
EMERGENCY 5 DLK save person action.
Definition: DLKSavePersonAction.h:45
Definition: DLKSavePersonAction.h:57
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20