summaryrefslogtreecommitdiff
path: root/src/core/Accident.h
blob: 949d5fb93ee62d3e05271b0e4ef9dc91c76f3b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;