Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem / Event.h
blob: 9dd1218c8e978aee307b7b324fcd43b103db59c0 (plain) (blame)
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
#ifndef HEADER_EVENTSYSTEM_EVENT
#define HEADER_EVENTSYSTEM_EVENT

#include "../List/OrderedList.hpp"
#include "../Date/Date.h"
#include "../String/String.h"
#include "../Venue/Hall.h"
#include "Ticket.h"
#include "Reservation.h"
#include "StatusCodes.h"

class Event {
	OrderedList<Ticket> tickets;
	OrderedList<Reservation> reservations;
	Date date;
	String name;
	const Hall* hall;

	unsigned freeSeats;

public:
	Event();
	Event(const Hall* hall, String name, Date date);

	const Hall& get_hall() const;
	const String& get_name() const;
	const Date& get_date() const;

	StatusCode reserveTicket(const Ticket& ticket, const char* password, const char* note);

	StatusCode cancelReservation(unsigned row, unsigned seat);
	StatusCode cancelReservation(const Ticket& ticket);

	StatusCode buyTicket(const Ticket& ticket);

	StatusCode buyTicketFromReservation(const Reservation& reservation, const char* password);

	bool ticketIsFree(unsigned row, unsigned seat);
	bool ticketIsFree(const Ticket& ticket);

	int compare(const Event& other);
};

#endif