Emergency 20 Dokumentation  4.2.0
ChangeSuitAction.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/asset/AssetProxy.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public definitions ]
39  //[-------------------------------------------------------]
40  public:
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public methods ]
46  //[-------------------------------------------------------]
47  public:
53 
58  virtual ~ChangeSuitAction();
59 
64  void init(const qsf::AssetProxy& targetSuit, const qsf::Time& fadeOutTime, const qsf::Time& fadeInTime);
65 
66 
67  //[-------------------------------------------------------]
68  //[ Public virtual qsf::Actions methods ]
69  //[-------------------------------------------------------]
70  public:
71  virtual void serialize(qsf::BinarySerializer& serializer) override;
72 
73 
74  //[-------------------------------------------------------]
75  //[ Protected virtual qsf::Action methods ]
76  //[-------------------------------------------------------]
77  protected:
78  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
79 
80 
81  //[-------------------------------------------------------]
82  //[ Private definitions ]
83  //[-------------------------------------------------------]
84  private:
85  enum State
86  {
87  STATE_INIT,
88  STATE_FADE_OUT_EQUIPMENT,
89  STATE_FADE_OUT_START,
90  STATE_FADE_OUT,
91  STATE_FADE_IN,
92  STATE_FADE_IN_EQUIPMENT
93  };
94 
95 
96  //[-------------------------------------------------------]
97  //[ Private data ]
98  //[-------------------------------------------------------]
99  private:
100  State mState;
101  qsf::AssetProxy mTargetSuit;
102  qsf::Time mFadeEquipmentTime;
103  qsf::Time mFadeOutTime;
104  qsf::Time mFadeInTime;
105  qsf::Time mTimeUntilStateSwitch;
106 
107 
108  //[-------------------------------------------------------]
109  //[ CAMP reflection system ]
110  //[-------------------------------------------------------]
111  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
112 
113 
114  };
115 
116 
117 //[-------------------------------------------------------]
118 //[ Namespace ]
119 //[-------------------------------------------------------]
120 } // em5
121 
122 
123 //[-------------------------------------------------------]
124 //[ CAMP reflection system ]
125 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 change suit action. Currently used for fireman switching default and ABC suit...
Definition: ChangeSuitAction.h:33
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
static const qsf::NamedIdentifier ACTION_ID
"em5::ChangeSuitAction" unique action identifier
Definition: ChangeSuitAction.h:41
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
State
Definition: ProcessState.h:20
Asset proxy class.
Definition: AssetProxy.h:57
#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