Emergency 20 Dokumentation  4.2.0
CutTreeAction.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/audio/AudioProxy.h"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class PropertyDictionary;
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  // Key definitions for use with the generic object constructor
53 
54  enum State
55  {
58  STATE_CUT_TREE
59  };
60 
61 
62  //[-------------------------------------------------------]
63  //[ Public methods ]
64  //[-------------------------------------------------------]
65  public:
70  CutTreeAction();
71 
76  explicit CutTreeAction(qsf::PropertyDictionary* parameters);
77 
82  virtual ~CutTreeAction();
83 
88  void init(qsf::Entity& targetEntity);
89 
99  void initByPointer(qsf::Entity* target);
100 
101  uint64 getTargetEntityId() const;
102 
103 
104  //[-------------------------------------------------------]
105  //[ Public virtual qsf::Actions methods ]
106  //[-------------------------------------------------------]
107  public:
108  virtual void serialize(qsf::BinarySerializer& serializer) override;
109 
110 
111  //[-------------------------------------------------------]
112  //[ Protected virtual qsf::Action methods ]
113  //[-------------------------------------------------------]
114  protected:
115  virtual bool onStartup() override;
116  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
117 
118 
119  //[-------------------------------------------------------]
120  //[ Private methods ]
121  //[-------------------------------------------------------]
122  private:
123  void playBeginUseChainSawAnimation();
124  void playUseChainSawAnimation();
125  void playEndUseChainSawAnimation();
126  void startFallTreeEffect();
127  void startChainsawEffect();
128  void stopChainsawEffect();
129  void unburyTarget();
130 
131 
132  //[-------------------------------------------------------]
133  //[ Private data ]
134  //[-------------------------------------------------------]
135  private:
136  // Configuration
137  qsf::WeakPtr<qsf::Entity> mTargetEntity;
138  qsf::Time mTimeRunning;
139  State mState;
140  qsf::WeakPtr<qsf::Entity> mParticleEffectEntity;
141  qsf::WeakPtr<qsf::Entity> mParticleSmokeEffectEntity;
142  AudioProxy mAudioProxy;
143  bool mReactivateFireComponent; // "true" if we have to reactivate the fire component
144 
145 
146  //[-------------------------------------------------------]
147  //[ CAMP reflection system ]
148  //[-------------------------------------------------------]
149  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
150 
151 
152  };
153 
154 
155 //[-------------------------------------------------------]
156 //[ Namespace ]
157 //[-------------------------------------------------------]
158 } // em5
159 
160 
161 //[-------------------------------------------------------]
162 //[ CAMP reflection system ]
163 //[-------------------------------------------------------]
static const qsf::NamedIdentifier ACTION_ID
"em5::CutTreeAction" unique action identifier
Definition: CutTreeAction.h:49
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
EMERGENCY 5 cut tree action.
Definition: CutTreeAction.h:41
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Definition: CutTreeAction.h:56
Definition: PickupPersonByParamedicAction.h:21
State
Definition: ProcessState.h:20
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
Extended audio proxy for easier multiplay usage.
Definition: AudioProxy.h:47
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
State
Definition: CutTreeAction.h:54
Definition: CutTreeAction.h:57
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
Generic key-value pair container.
Definition: PropertyDictionary.h:46
static const qsf::NamedIdentifier PARAMETER_TARGET_ENTITYID
"targetEntityId" action parameter
Definition: CutTreeAction.h:52
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32