-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.h
53 lines (49 loc) · 1.68 KB
/
event.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
*
* Created By German Irias & Joseph Quigley 02/18/2011
* This class implements the Singleton class pattern.
*
*/
#ifndef Event_h
#define Event_h
#include "position.h"
#include "road.h"
namespace tfg
{
class Event
{
public:
// Get the only instance of an event.
static Event *Get();
// Create an event.
// Pass in a position and a bool that says whether
// the event is an accident
void CreateEvent(Position *position, bool accident = false);
// Remove an event.
// Pass in a position and a bool that says whether
// the event is an accident
void RemoveEvent(Position *position, bool accident = false);
// Create an accident event.
// Pass in a position. It calls CreateEvent() with (accident == true)
void CreateAccident(Position *position);
// Remove an accident event.
// Pass in a position. It calls RemoveEvent() with (accident == true)
void RemoveAccident(Position *position);
// Create a maintenance event. This function is called by clients; it
// means a street is closed for maintenance, so it is blocked.
// Pass in a position.
void CreateMaintenance(Position *position);
// Remove a maintenance event. This function is called by clients; it
// means maintenance on a street is done, so it is unblocked.
// Pass in a position.
void RemoveMaintenance(Position *position);
private:
//Default constructors will not work because of dynamic arrays
Event(){};
Event& operator=(Event const&);
~Event();
Event(const Event & others);
static Event *m_pInstance;
};
}
#endif