Emergency 20 Dokumentation  4.2.0
GetDogFromVehicleAction.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 
15 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21  class RoadVehicleComponent;
22 }
23 
24 
25 //[-------------------------------------------------------]
26 //[ Namespace ]
27 //[-------------------------------------------------------]
28 namespace em5
29 {
30 
31 
32  //[-------------------------------------------------------]
33  //[ Classes ]
34  //[-------------------------------------------------------]
40  {
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public definitions ]
45  //[-------------------------------------------------------]
46  public:
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public methods ]
52  //[-------------------------------------------------------]
53  public:
59 
64  virtual ~GetDogFromVehicleAction();
65 
70  void init(qsf::Entity& targetEntity, bool dogEnterVehicle);
71 
72 
73  //[-------------------------------------------------------]
74  //[ Public virtual qsf::Actions methods ]
75  //[-------------------------------------------------------]
76  public:
77  virtual void serialize(qsf::BinarySerializer& serializer) override;
78 
79 
80  //[-------------------------------------------------------]
81  //[ Protected virtual qsf::Action methods ]
82  //[-------------------------------------------------------]
83  protected:
84  virtual void onShutdown() override;
85  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
86 
87 
88  //[-------------------------------------------------------]
89  //[ Protected virtual em5::GetEquipmentAction methods ]
90  //[-------------------------------------------------------]
91  protected:
92  virtual std::vector<DoorComponent*> getEquipmentDoorsFromTarget() const override;
93 
94 
95  //[-------------------------------------------------------]
96  //[ Private methods ]
97  //[-------------------------------------------------------]
98  private:
99  void playRescueDogAnimation();
100  void getRescueDogFromGameLogic();
101  void deleteEnteredDog() const;
102 
103 
104  //[-------------------------------------------------------]
105  //[ Private data ]
106  //[-------------------------------------------------------]
107  private:
108  qsf::WeakPtr<qsf::Entity> mTargetEntity;
109  qsf::WeakPtr<em5::RoadVehicleComponent> mRoadVehicleComponent; // Road vehicle component from target
110  qsf::WeakPtr<qsf::Entity> mRescueDogEntity;
111  bool mDogEnterVehicle;
112  bool mPreventUpdateAnimationsActive;
113 
114 
115  //[-------------------------------------------------------]
116  //[ CAMP reflection system ]
117  //[-------------------------------------------------------]
118  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
119 
120 
121  };
122 
123 
124 //[-------------------------------------------------------]
125 //[ Namespace ]
126 //[-------------------------------------------------------]
127 } // em5
128 
129 
130 //[-------------------------------------------------------]
131 //[ CAMP reflection system ]
132 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 get dog from vehicle action.
Definition: GetDogFromVehicleAction.h:39
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
#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::GetDogFromVehicleAction" unique action identifier
Definition: GetDogFromVehicleAction.h:47
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
EMERGENCY 5 get equipment action.
Definition: GetEquipmentAction.h:44
Binary serializer class.
Definition: BinarySerializer.h:35
Result
Definition: ActionResult.h:20