Emergency 20 Dokumentation  4.2.0
HealthSystem.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 
15 #include <qsf/base/System.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Forward declarations ]
21 //[-------------------------------------------------------]
22 namespace qsf
23 {
24  class StringHash;
25 }
26 namespace em5
27 {
28  class DiagnosisManager;
29  class InjuryManager;
30  class MedicalCareManager;
31  class Injury;
32  class Diagnosis;
33  class MedicalCare;
34 }
35 
36 
37 //[-------------------------------------------------------]
38 //[ Namespace ]
39 //[-------------------------------------------------------]
40 namespace em5
41 {
42 
43 
44  //[-------------------------------------------------------]
45  //[ Classes ]
46  //[-------------------------------------------------------]
52  {
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public methods ]
57  //[-------------------------------------------------------]
58  public:
63  HealthSystem();
64 
69  virtual ~HealthSystem();
70 
71  // Get injury by ID
72  const Injury* getInjuryById(const qsf::StringHash& id) const;
73 
74  // Get diagnosis by ID
75  const Diagnosis* getDiagnosisById(const qsf::StringHash& id) const;
76 
77  // Get medical care by ID
78  const MedicalCare* getMedicalCareById(const qsf::StringHash& id) const;
79 
84  inline InjuryManager& getInjuryManager() const;
85 
90  inline DiagnosisManager& getDiagnosisManager() const;
91 
96  inline MedicalCareManager& getMedicalCareManager() const;
97 
98  inline bool getHealthSimulationActive() const;
99  void setHealthSimulationActive(bool healthSimulationEnabled);
100 
101  float getEnergyLossMultiplier() const;
102  void setEnergyLossMultiplier(float multiplier);
103 
104 
105  //[-------------------------------------------------------]
106  //[ Public virtual qsf::System methods ]
107  //[-------------------------------------------------------]
108  public:
109  inline virtual const char* getName() const override;
110 
111  //[-------------------------------------------------------]
112  //[ Lifecycle ]
113  //[-------------------------------------------------------]
114  virtual bool onStartup(bool serverMode) override;
115  virtual void onShutdown() override;
116 
117 
118  //[-------------------------------------------------------]
119  //[ Private data ]
120  //[-------------------------------------------------------]
121  private:
122  DiagnosisManager* mDiagnosisManager;
123  InjuryManager* mInjuryManager;
124  MedicalCareManager* mMedicalCareManager;
125  bool mHealthSimulationActive;
126  float mEnergyLossMultiplier;
127 
128 
129  //[-------------------------------------------------------]
130  //[ CAMP reflection system ]
131  //[-------------------------------------------------------]
132  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
133 
134 
135  };
136 
137 
138 //[-------------------------------------------------------]
139 //[ Namespace ]
140 //[-------------------------------------------------------]
141 } // em5
142 
143 
144 //[-------------------------------------------------------]
145 //[ Implementation ]
146 //[-------------------------------------------------------]
148 
149 
150 //[-------------------------------------------------------]
151 //[ CAMP reflection system ]
152 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
#define EM5_API_EXPORT
Definition: Export.h:28
Manager for medical care definitions.
Definition: MedicalCareManager.h:32
Definition: PickupPersonByParamedicAction.h:21
Abstract system class.
Definition: System.h:48
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
Manager for diagnosis definitions.
Definition: DiagnosisManager.h:32
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Diagnosis definition class.
Definition: Diagnosis.h:30
Compile time string hash class.
Definition: StringHash.h:59
Injury definition class.
Definition: Injury.h:44
Manager for injury definitions.
Definition: InjuryManager.h:32
Health system.
Definition: HealthSystem.h:51
Medical care step definition class.
Definition: MedicalCare.h:30