Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Event.cpp
blob: 034e4b342609f1328d768f13f4901b24daff2419 (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
#include "Event.h"
#include "Reservation.h"

Event::Event() : hall(), name(), date() {}

Event::Event(const Hall& hall, String name, Date date) : tickets(), reservations() {
	this->hall = &hall;
	this->name = name;
	this->date = date;
}

const OrderedList<Ticket>& Event::get_tickets() const {
	return tickets;
}

const OrderedList<Reservation>& Event::get_reservations() const {
	return reservations;
}

const Hall& Event::get_hall() const {
	return *hall;
}

const String& Event::get_name() const {
	return name;
}

const Date& Event::get_date() const {
	return date;
}

int Event::compare(const Event& other) {
	if (hall == other.hall)
		return date.compare(other.date);
	return hall->compare(*other.hall);
}