Emergency 20 Dokumentation  4.2.0
BreakBuildingDoorOpenAction.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 BuildingComponent;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Classes ]
36  //[-------------------------------------------------------]
42  {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public definitions ]
47  //[-------------------------------------------------------]
48  public:
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
61 
66  virtual ~BreakBuildingDoorOpenAction();
67 
72  void init(const qsf::Entity& targetEntity);
73 
74  uint64 getTargetEntityId() const;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Public virtual qsf::Actions methods ]
79  //[-------------------------------------------------------]
80  public:
81  virtual void serialize(qsf::BinarySerializer& serializer) override;
82 
83 
84  //[-------------------------------------------------------]
85  //[ Protected virtual qsf::Action methods ]
86  //[-------------------------------------------------------]
87  protected:
88  virtual bool onStartup() override;
89  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
90  virtual void onShutdown() override;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Private definitions ]
95  //[-------------------------------------------------------]
96  private:
97  enum State
98  {
99  STATE_INIT,
100  STATE_ANIMATION_1,
101  STATE_ANIMATION_2,
102  STATE_ANIMATION_3,
103  STATE_SET_PERSONS_FREE,
104  STATE_FINISHED
105  };
106 
107 
108  //[-------------------------------------------------------]
109  //[ Private methods ]
110  //[-------------------------------------------------------]
111  private:
112  void createBreakDoorEffect();
113  void teleportToBuildingDoor();
114  void playAxe2Animation();
115  void sendMessageStart();
116  void sendMessageEnd();
117 
118 
119  //[-------------------------------------------------------]
120  //[ Private data ]
121  //[-------------------------------------------------------]
122  private:
123  uint64 mTargetEntityId;
124  State mState;
125  qsf::Time mTime;
126  qsf::WeakPtr<BuildingComponent> mTargetBuildingComponent;
127  qsf::WeakPtr<qsf::Entity> mEffectEntity;
128 
129 
130  //[-------------------------------------------------------]
131  //[ CAMP reflection system ]
132  //[-------------------------------------------------------]
133  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
134 
135 
136  };
137 
138 
139 //[-------------------------------------------------------]
140 //[ Namespace ]
141 //[-------------------------------------------------------]
142 } // em5
143 
144 
145 //[-------------------------------------------------------]
146 //[ CAMP reflection system ]
147 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
static const qsf::NamedIdentifier ACTION_ID
"em5::BreakBuildingDoorOpenAction" unique action identifier
Definition: BreakBuildingDoorOpenAction.h:49
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 break building door open action.
Definition: BreakBuildingDoorOpenAction.h:41
uint64_t uint64
Definition: PlatformTypes.h:184
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
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