Emergency 20 Dokumentation  4.2.0
PlacePersonAction.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 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
41 
42  enum State
43  {
49  STATE_DONE
50  };
51 
52  enum PlaceCase
53  {
57  PLACECASE_CIVILIAN
58  };
59 
60 
61  //[-------------------------------------------------------]
62  //[ Public static methods ]
63  //[-------------------------------------------------------]
64  public:
65  static void lookForIdleMedicsInArea(qsf::Entity& vehicleEntity);
66 
67 
68  //[-------------------------------------------------------]
69  //[ Public methods ]
70  //[-------------------------------------------------------]
71  public:
77 
82  virtual ~PlacePersonAction();
83 
88  void init(qsf::Entity& targetEntity, bool placeGuidedPerson = false);
89 
90  uint64 getTargetEntityId() const;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Public virtual qsf::Actions methods ]
95  //[-------------------------------------------------------]
96  public:
97  virtual void serialize(qsf::BinarySerializer& serializer) override;
98 
99 
100  //[-------------------------------------------------------]
101  //[ Protected virtual qsf::Action methods ]
102  //[-------------------------------------------------------]
103  protected:
104  virtual bool onStartup() override;
105  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
106 
107 
108  //[-------------------------------------------------------]
109  //[ Private methods ]
110  //[-------------------------------------------------------]
111  private:
112  bool checkPlacementStyle(qsf::Entity& vehicleEntity);
113  qsf::Entity* findClosestDoor(qsf::Entity& vehicleEntity);
114  void showAutoTransportHint() const;
115 
116 
117  //[-------------------------------------------------------]
118  //[ Private data ]
119  //[-------------------------------------------------------]
120  private:
121  // Configuration
122  uint64 mTargetEntityId;
123  bool mPlaceGuidedPerson;
124 
125  // Internal
126  State mCurrentState;
127  PlaceCase mPlaceCase;
128  DoorComponent::DoorType mDoorType;
129  qsf::WeakPtr<qsf::Entity> mDoorEntity;
130 
131  qsf::Time mDoorAnimationWatchDog;
132 
133 
134  //[-------------------------------------------------------]
135  //[ CAMP reflection system ]
136  //[-------------------------------------------------------]
137  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
138 
139 
140  };
141 
142 
143 //[-------------------------------------------------------]
144 //[ Namespace ]
145 //[-------------------------------------------------------]
146 } // em5
147 
148 
149 //[-------------------------------------------------------]
150 //[ CAMP reflection system ]
151 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 place person action.
Definition: PlacePersonAction.h:32
Definition: PlacePersonAction.h:47
Entity class.
Definition: Entity.h:46
Definition: PlacePersonAction.h:46
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
PlaceCase
Definition: PlacePersonAction.h:52
State
Definition: PlacePersonAction.h:42
uint64_t uint64
Definition: PlatformTypes.h:184
Definition: PlacePersonAction.h:45
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
We want to place a gangster inside a police vehicle.
Definition: PlacePersonAction.h:56
We want to place a patient inside an ambulance vehicle.
Definition: PlacePersonAction.h:55
Definition: PlacePersonAction.h:44
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
Abstract action base class.
Definition: Action.h:59
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
Definition: PlacePersonAction.h:48
static const qsf::NamedIdentifier ACTION_ID
"em5::PlacePersonAction" unique action identifier
Definition: PlacePersonAction.h:40
Binary serializer class.
Definition: BinarySerializer.h:35
Definition: PlacePersonAction.h:54
Result
Definition: ActionResult.h:20
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32