diff options
Autocommit at 02.05.2022 @ 20:30
3 files changed, 12 insertions, 3 deletions
| -rw-r--r-- | src/EventSystem/Event.cpp | 11 | ||||
| -rw-r--r-- | src/EventSystem/Event.h | 2 | ||||
| -rw-r--r-- | src/EventSystem/StatusCodes.h | 2 |
diff --git a/src/EventSystem/Event.cpp b/src/EventSystem/Event.cpp index e75e3fa..70ed51a 100644 --- a/src/EventSystem/Event.cpp +++ b/src/EventSystem/Event.cpp @@ -1,7 +1,16 @@ #include "Event.h" +#include "StatusCodes.h" -Event::Event() : Event(nullptr, "", "") {} +Event::Event() : Event(nullptr, "", DateTime()) {} Event::Event(const Hall* hall, String name, DateTime time) { this->hall = hall; + this->name = name; + this->time = time; +} + +StatusCode Event::reserveTicket(const Ticket& ticket, const char* password, const char* note) { + // TODO: if (reservations.contains(ticket) || tickets.contain(ticket)) return E_... + reservations.add(Reservation(ticket, password, note)); + return Success; } diff --git a/src/EventSystem/Event.h b/src/EventSystem/Event.h index 327de3b..1ea2ff2 100644 --- a/src/EventSystem/Event.h +++ b/src/EventSystem/Event.h @@ -14,7 +14,7 @@ class Event { List<Reservation> reservations; DateTime time; String name; - Hall* hall; + const Hall* hall; public: Event(); diff --git a/src/EventSystem/StatusCodes.h b/src/EventSystem/StatusCodes.h index 15363cc..a18dcd5 100644 --- a/src/EventSystem/StatusCodes.h +++ b/src/EventSystem/StatusCodes.h @@ -2,7 +2,7 @@ #define HEADER_EVENTSYSTEM_STATUSCODES enum StatusCode { - Ok, + Success, W_TicketNotReserved, |
