Emergency 20 Dokumentation  4.2.0
GettingRedirectedAction.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 
18 #include <qsf/math/Transform.h>
19 
20 
21 //[-------------------------------------------------------]
22 //[ Namespace ]
23 //[-------------------------------------------------------]
24 namespace em5
25 {
26 
27 
28  //[-------------------------------------------------------]
29  //[ Classes ]
30  //[-------------------------------------------------------]
36  {
37 
38 
39  //[-------------------------------------------------------]
40  //[ Public definitions ]
41  //[-------------------------------------------------------]
42  public:
44 
45 
46  //[-------------------------------------------------------]
47  //[ Public methods ]
48  //[-------------------------------------------------------]
49  public:
55 
60  virtual ~GettingRedirectedAction();
61 
62  void init(const qsf::ai::SpatialConfiguration3D& target);
63 
64 
65  //[-------------------------------------------------------]
66  //[ Public virtual qsf::Action methods ]
67  //[-------------------------------------------------------]
68  public:
69  virtual void serialize(qsf::BinarySerializer& serializer) override;
70 
71 
72  //[-------------------------------------------------------]
73  //[ Protected virtual qsf::Action methods ]
74  //[-------------------------------------------------------]
75  protected:
76  virtual bool onStartup() override;
77  virtual void onShutdown() override;
78  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
79 
80 
81  //[-------------------------------------------------------]
82  //[ Private methods ]
83  //[-------------------------------------------------------]
84  private:
85  void setWaitTimeForNextTry();
86 
87 
88  //[-------------------------------------------------------]
89  //[ Private data ]
90  //[-------------------------------------------------------]
91  private:
92  enum State
93  {
94  STATE_INIT,
95  STATE_FADE_OUT,
96  STATE_MOVE_TO_TARGET,
97  STATE_FADE_IN
98  };
99 
100  State mState;
102  bool mHasActiveMoveToDespawnComponent;
103  bool mHasActiveRandomMovementComponent;
104 
105  qsf::Time mCurrentWaitTime;
106 
107  qsf::Transform mTargetTransform;
108 
109 
110  //[-------------------------------------------------------]
111  //[ CAMP reflection system ]
112  //[-------------------------------------------------------]
113  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
114 
115 
116  };
117 
118 
119 //[-------------------------------------------------------]
120 //[ Namespace ]
121 //[-------------------------------------------------------]
122 } // em5
123 
124 
125 //[-------------------------------------------------------]
126 //[ CAMP reflection system ]
127 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
3D transform class
Definition: Transform.h:45
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
EMERGENCY 5 getting redirected action.
Definition: GettingRedirectedAction.h:35
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
static const qsf::NamedIdentifier ACTION_ID
"em5::GettingRedirectedAction" unique action identifier
Definition: GettingRedirectedAction.h:43
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