Emergency 20 Dokumentation  4.2.0
ReanimationTreatmentLogic.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 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
40  static const uint32 GAMELOGIC_TYPE_ID; // "em5::ReanimationTreatmentLogic" game logic type ID
41 
43  {
52  FINISH_ALL
53  };
54 
55 
56  //[-------------------------------------------------------]
57  //[ Public methods ]
58  //[-------------------------------------------------------]
59  public:
65 
70  virtual ~ReanimationTreatmentLogic();
71 
72  void init(qsf::Entity& doctorEntity, qsf::Entity& targetEntity);
73  void stopReanimation();
74 
75 
76  //[-------------------------------------------------------]
77  //[ Public virtual qsf::Actions methods ]
78  //[-------------------------------------------------------]
79  public:
80  virtual void serialize(qsf::BinarySerializer& serializer) override;
81 
82 
83  //[-------------------------------------------------------]
84  //[ Protected virtual methods ]
85  //[-------------------------------------------------------]
86  protected:
87  // Job update
88  virtual void updateSimulation(const qsf::JobArguments& jobArguments);
89 
90 
91  //[-------------------------------------------------------]
92  //[ Private methods ]
93  //[-------------------------------------------------------]
94  private:
95  void getDefibrillatorPads();
96  bool playReanimationLoop();
97  void putPadsBack();
98 
99  /*
100  * @brief
101  * Search the doctor equipment for the defibrillator pads and safe them
102  */
103  void findDefibrillatorPads();
104  void linkEquipmentToTarget(qsf::Entity& equipmentToLink, uint64 targetId, const std::string& boneName, const std::string& childBoneName);
105 
106 
107  //[-------------------------------------------------------]
108  //[ Private data ]
109  //[-------------------------------------------------------]
110  private:
111  TREATMENT_STATE mCurrentState;
112  bool mLoopReanimationAnimation;
113  bool mFirstReanimationLoop;
114  qsf::WeakPtr<qsf::Entity> mDefibrillatorPadRight;
115  qsf::WeakPtr<qsf::Entity> mDefibrillatorPadLeft;
116 
117  qsf::WeakPtr<qsf::Entity> mDefibrillatorPadRightInHand;
118  qsf::WeakPtr<qsf::Entity> mDefibrillatorPadLeftInHand;
119 
120  AudioProxy mDefibrillatorAudioProxy;
121  AudioProxy mEKGAudioProxy;
122 
123 
124  //[-------------------------------------------------------]
125  //[ CAMP reflection system ]
126  //[-------------------------------------------------------]
127  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
128 
129 
130  };
131 
132 
133 //[-------------------------------------------------------]
134 //[ Namespace ]
135 //[-------------------------------------------------------]
136 } // em5
137 
138 
139 //[-------------------------------------------------------]
140 //[ CAMP reflection system ]
141 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 base treatment logic Parent class for treatment process with doctor and target patient...
Definition: BaseTreatmentLogic.h:45
static const uint32 GAMELOGIC_TYPE_ID
Definition: ReanimationTreatmentLogic.h:40
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
Definition: ReanimationTreatmentLogic.h:47
Definition: ReanimationTreatmentLogic.h:45
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
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
TREATMENT_STATE
Definition: ReanimationTreatmentLogic.h:42
Extended audio proxy for easier multiplay usage.
Definition: AudioProxy.h:47
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Definition: ReanimationTreatmentLogic.h:46
EMERGENCY 5 reanimation treatment logic Handles all visual effects, equipments and animations for the...
Definition: ReanimationTreatmentLogic.h:32
Definition: ReanimationTreatmentLogic.h:44
Definition: ReanimationTreatmentLogic.h:48
Definition: ReanimationTreatmentLogic.h:49
Definition: ReanimationTreatmentLogic.h:51
Binary serializer class.
Definition: BinarySerializer.h:35
Definition: ReanimationTreatmentLogic.h:50