Emergency 20 Dokumentation  4.2.0
UseUmbrellaAction.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/time/Time.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Forward declarations ]
21 //[-------------------------------------------------------]
22 namespace qsf
23 {
24  class MeshAnimationChannel;
25 }
26 
27 
28 //[-------------------------------------------------------]
29 //[ Namespace ]
30 //[-------------------------------------------------------]
31 namespace em5
32 {
33 
34 
35  //[-------------------------------------------------------]
36  //[ Classes ]
37  //[-------------------------------------------------------]
43  {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Public definitions ]
48  //[-------------------------------------------------------]
49  public:
51 
52 
53  //[-------------------------------------------------------]
54  //[ Public methods ]
55  //[-------------------------------------------------------]
56  public:
62 
67  virtual ~UseUmbrellaAction();
68 
69 
70  //[-------------------------------------------------------]
71  //[ Public virtual qsf::Actions methods ]
72  //[-------------------------------------------------------]
73  public:
74  virtual void serialize(qsf::BinarySerializer& serializer) override;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Protected virtual qsf::Action methods ]
79  //[-------------------------------------------------------]
80  protected:
81  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
82 
83 
84  //[-------------------------------------------------------]
85  //[ Private definitions ]
86  //[-------------------------------------------------------]
87  private:
88  enum State
89  {
90  STATE_INIT,
91  STATE_START_USING_ANIMATION,
92  STATE_WAIT_FOR_OPEN,
93  STATE_WAIT_FOR_FINISH
94  };
95 
96 
97  //[-------------------------------------------------------]
98  //[ Private data ]
99  //[-------------------------------------------------------]
100  private:
101  State mCurrentState;
102  bool mCloseUmbrella;
103  qsf::Time mOpeningTime;
104  qsf::WeakPtr<qsf::MeshAnimationChannel> mAnimationChannel;
105 
106 
107  //[-------------------------------------------------------]
108  //[ CAMP reflection system ]
109  //[-------------------------------------------------------]
110  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
111 
112 
113  };
114 
115 
116 //[-------------------------------------------------------]
117 //[ Namespace ]
118 //[-------------------------------------------------------]
119 } // em5
120 
121 
122 //[-------------------------------------------------------]
123 //[ CAMP reflection system ]
124 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
static const qsf::NamedIdentifier ACTION_ID
"em5::UseUmbrellaAction" unique action identifier
Definition: UseUmbrellaAction.h:50
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
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
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
EMERGENCY 5 use umbrella (open/close) action.
Definition: UseUmbrellaAction.h:42
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