summaryrefslogtreecommitdiffstats
path: root/src/core/Accident.h
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-01-12 00:11:47 +0100
committerGitHub <noreply@github.com>2020-01-12 00:11:47 +0100
commit2d00d7b3e2026283498c6274ae2533211ea48f53 (patch)
treedc5d7e408858a5574d70d927eee670f1c9165cc6 /src/core/Accident.h
parentMerge pull request #292 from erorcun/erorcun (diff)
parentAccidentManager (diff)
downloadre3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.gz
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.bz2
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.lz
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.xz
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.tar.zst
re3-2d00d7b3e2026283498c6274ae2533211ea48f53.zip
Diffstat (limited to 'src/core/Accident.h')
-rw-r--r--src/core/Accident.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/core/Accident.h b/src/core/Accident.h
new file mode 100644
index 00000000..69889645
--- /dev/null
+++ b/src/core/Accident.h
@@ -0,0 +1,32 @@
+#pragma once
+#include "common.h"
+#include "config.h"
+
+class CPed;
+
+class CAccident
+{
+public:
+ CPed *m_pVictim;
+ uint32 m_nMedicsAttending;
+ uint32 m_nMedicsPerformingCPR;
+ CAccident() : m_pVictim(nil), m_nMedicsAttending(0), m_nMedicsPerformingCPR(0) {}
+};
+
+class CAccidentManager
+{
+ CAccident m_aAccidents[NUM_ACCIDENTS];
+ enum {
+ MAX_MEDICS_TO_ATTEND_ACCIDENT = 2
+ };
+public:
+ CAccident *GetNextFreeAccident();
+ void ReportAccident(CPed *ped);
+ void Update();
+ CAccident *FindNearestAccident(CVector vecPos, float *pDistance);
+ uint16 CountActiveAccidents();
+ bool UnattendedAccidents();
+ bool WorkToDoForMedics();
+};
+
+extern CAccidentManager& gAccidentManager; \ No newline at end of file