Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem
diff options
context:
space:
mode:
5 files changed, 12 insertions, 4 deletions
-rw-r--r--src/EventSystem/Event.cpp2
-rw-r--r--src/EventSystem/Event.h2
-rw-r--r--src/EventSystem/EventSystem.h2
-rw-r--r--src/EventSystem/Reservation.cpp8
-rw-r--r--src/EventSystem/Reservation.h2
diff --git a/src/EventSystem/Event.cpp b/src/EventSystem/Event.cpp
index 1452057..450eca9 100644
--- a/src/EventSystem/Event.cpp
+++ b/src/EventSystem/Event.cpp
@@ -39,7 +39,7 @@ StatusCode Event::buyTicketFromReservation(const Reservation& reservation, const
unsigned resInd = reservations.findIndex(reservation);
if (resInd == reservations.get_count()) return E_ReservationDoesNotExist;
- if (!reservation.checkPassword(password)) return E_WrongReservationPassword;
+ if (!reservation.validPassword(password)) return E_WrongReservationPassword;
reservations.removeAt(resInd);
tickets.insert(reservation.get_ticket());
diff --git a/src/EventSystem/Event.h b/src/EventSystem/Event.h
index ad3ae89..5b26458 100644
--- a/src/EventSystem/Event.h
+++ b/src/EventSystem/Event.h
@@ -1,7 +1,7 @@
#ifndef HEADER_EVENTSYSTEM_EVENT
#define HEADER_EVENTSYSTEM_EVENT
-#include "../List/OrderedList.h"
+#include "../List/OrderedList.hpp"
#include "../DateTime/DateTime.h"
#include "../String/String.h"
#include "../Venue/Hall.h"
diff --git a/src/EventSystem/EventSystem.h b/src/EventSystem/EventSystem.h
index 5c83fd8..79fac10 100644
--- a/src/EventSystem/EventSystem.h
+++ b/src/EventSystem/EventSystem.h
@@ -1,7 +1,7 @@
#ifndef HEADER_EVENTSYSTEM
#define HEADER_EVENTSYSTEM
-#include "../List/OrderedList.h"
+#include "../List/OrderedList.hpp"
#include "../DateTime/DateTime.h"
#include "Event.h"
diff --git a/src/EventSystem/Reservation.cpp b/src/EventSystem/Reservation.cpp
index 4cc716e..26278b2 100644
--- a/src/EventSystem/Reservation.cpp
+++ b/src/EventSystem/Reservation.cpp
@@ -12,6 +12,14 @@ Reservation::Reservation(const Ticket& ticket, const char* password, const char*
strcpy(this->note, note);
}
+bool Reservation::validPassword(const char* password) const {
+ return !strcmp(this->password, password);
+}
+
+const Ticket& Reservation::get_ticket() const {
+ return ticket;
+}
+
void Reservation::read(std::istream& istr) {
ticket.read(istr);
istr.read(password, sizeof(password));
diff --git a/src/EventSystem/Reservation.h b/src/EventSystem/Reservation.h
index a73e719..ff56db6 100644
--- a/src/EventSystem/Reservation.h
+++ b/src/EventSystem/Reservation.h
@@ -15,7 +15,7 @@ public:
Reservation(const Ticket& ticket);
Reservation(const Ticket& ticket, const char* password, const char* note);
- bool checkPassword(const char* password) const;
+ bool validPassword(const char* password) const;
const Ticket& get_ticket() const;
void read(std::istream& istr);