Emergency 20 Dokumentation  4.2.0
PlagueQuickTestAction.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 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class HealthComponent;
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 
66  virtual ~PlagueQuickTestAction();
67 
72  void init(qsf::Entity& targetEntity);
73 
74  uint64 getTargetEntityId() const;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Public virtual qsf::Actions methods ]
79  //[-------------------------------------------------------]
80  public:
81  virtual void serialize(qsf::BinarySerializer& serializer) override;
82 
83 
84  //[-------------------------------------------------------]
85  //[ Protected virtual qsf::Action methods ]
86  //[-------------------------------------------------------]
87  protected:
88  virtual bool onStartup() override;
89  virtual qsf::action::Result updateAction(const qsf::Clock& clock) override;
90  virtual void onShutdown() override;
91 
92 
93  //[-------------------------------------------------------]
94  //[ Private definitions ]
95  //[-------------------------------------------------------]
96  private:
97  enum State
98  {
99  STATE_INIT,
100  STATE_TURNTO,
101  STATE_WAIT,
102  STATE_DONE
103  };
104 
105 
106  //[-------------------------------------------------------]
107  //[ Private data ]
108  //[-------------------------------------------------------]
109  private:
110  State mState;
111  bool mIsDoctor;
112  qsf::WeakPtr<qsf::Entity> mMedicationEquipment;
113  qsf::WeakPtr<qsf::Entity> mTargetEntity;
114  qsf::WeakPtr<HealthComponent> mTargetHealthComponent;
115 
116 
117  //[-------------------------------------------------------]
118  //[ CAMP reflection system ]
119  //[-------------------------------------------------------]
120  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
121 
122 
123  };
124 
125 
126 //[-------------------------------------------------------]
127 //[ Namespace ]
128 //[-------------------------------------------------------]
129 } // em5
130 
131 
132 //[-------------------------------------------------------]
133 //[ CAMP reflection system ]
134 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 plague quick test action.
Definition: PlagueQuickTestAction.h:41
static const qsf::NamedIdentifier ACTION_ID
"em5::PlagueQuickTestAction" unique action identifier
Definition: PlagueQuickTestAction.h:49
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
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
#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