Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem / Event.cpp
diff options
context:
space:
mode:
1 files changed, 5 insertions, 2 deletions
-rw-r--r--src/EventSystem/Event.cpp7
diff --git a/src/EventSystem/Event.cpp b/src/EventSystem/Event.cpp
index 3deb58c..e9e0375 100644
--- a/src/EventSystem/Event.cpp
+++ b/src/EventSystem/Event.cpp
@@ -59,8 +59,11 @@ StatusCode Event::buyTicketFromReservation(const Reservation& reservation, const
}
bool Event::ticketIsFree(unsigned row, unsigned seat) {
- Ticket temp(row, seat);
- unsigned ind = tickets.findIndex(temp);
+ return ticketIsFree(Ticket(row, seat));
+}
+
+bool Event::ticketIsFree(const Ticket& ticket) {
+ return tickets.findIndex(ticket) != tickets.get_count() || reservations.findIndex(Reservation(ticket)) != reservations.get_count();
}
int Event::compare(const Event& other) {