Emergency 20 Dokumentation  4.2.0
ExitVehicleAction.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 //[-------------------------------------------------------]
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class VehicleComponent;
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 
62  explicit ExitVehicleAction(uint32 actionId);
63 
68  virtual ~ExitVehicleAction();
69 
74  void init(uint64 entityId);
75 
80  void initForUnloadUnfiltered();
81 
82 
83  //[-------------------------------------------------------]
84  //[ Public virtual qsf::Actions methods ]
85  //[-------------------------------------------------------]
86  public:
87  virtual void serialize(qsf::BinarySerializer& serializer) override;
88 
89 
90  //[-------------------------------------------------------]
91  //[ Protected virtual qsf::Action methods ]
92  //[-------------------------------------------------------]
93  protected:
94  virtual bool onStartup() override;
95  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
96 
97 
98  //[-------------------------------------------------------]
99  //[ Private methods ]
100  //[-------------------------------------------------------]
101  private:
102  void findCorrectVehicleDoor();
103  void exitEntityFromVehicle();
104  void getPlaceTransform(qsf::Transform& outTransform);
105  float getPlaceOffset(int index);
106 
107 
108  //[-------------------------------------------------------]
109  //[ Private definitions ]
110  //[-------------------------------------------------------]
111  private:
112  enum State
113  {
114  STATE_INIT,
115  STATE_OPEN_DOOR,
116  STATE_EXIT,
117  STATE_WAIT_FOR_PERSONAL,
118  STATE_CLOSE_DOOR
119  };
120 
121 
122  //[-------------------------------------------------------]
123  //[ Private data ]
124  //[-------------------------------------------------------]
125  private:
126  State mCurrentState;
127  DoorComponent::DoorType mDoorType;
128  qsf::WeakPtr<VehicleComponent> mVehicleComponent;
129  qsf::Time mWaitTillPersonsFadedIn;
130  std::vector<qsf::Entity*> mEntitiesToExit;
131  bool mSelectPersonsAfterExitVehicle;
132  uint64 mExitPersonId;
133  bool mUnloadUnfiltered;
134 
135 
136  //[-------------------------------------------------------]
137  //[ CAMP reflection system ]
138  //[-------------------------------------------------------]
139  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
140 
141 
142  };
143 
144 
145 //[-------------------------------------------------------]
146 //[ Namespace ]
147 //[-------------------------------------------------------]
148 } // em5
149 
150 
151 //[-------------------------------------------------------]
152 //[ CAMP reflection system ]
153 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
unsigned int uint32
Definition: PlatformTypes.h:181
EMERGENCY 5 exit vehicle action.
Definition: ExitVehicleAction.h:41
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
3D transform class
Definition: Transform.h:45
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
DoorType
Definition: DoorComponent.h:63
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
static const qsf::NamedIdentifier ACTION_ID
"em5::ExitVehicleAction" unique action identifier
Definition: ExitVehicleAction.h:49
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