diff options
Autocommit at 02.05.2022 @ 20:30
6 files changed, 15 insertions, 3 deletions
| -rw-r--r-- | src/.!lazygit.swo | bin | 24576 -> 24576 bytes | |||
| -rw-r--r-- | src/DateTime/DateTime.cpp | 2 | ||||
| -rw-r--r-- | src/DateTime/DateTime.h | 1 | ||||
| -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/.!lazygit.swo b/src/.!lazygit.swo Binary files differindex f672dc5..939e762 100644 --- a/src/.!lazygit.swo +++ b/src/.!lazygit.swo diff --git a/src/DateTime/DateTime.cpp b/src/DateTime/DateTime.cpp index a7f0cc5..8359f0b 100644 --- a/src/DateTime/DateTime.cpp +++ b/src/DateTime/DateTime.cpp @@ -17,6 +17,8 @@ unsigned short DateTime::daysInMonth() { /* Public */ +DateTime::DateTime() : DateTime(12, 00, 01, 05, 2022) {} + DateTime::DateTime(unsigned short hour, unsigned short minute, unsigned short day, unsigned short month, unsigned short year) { this->hour = hour; this->minute = minute; diff --git a/src/DateTime/DateTime.h b/src/DateTime/DateTime.h index 854cc2e..e9f353c 100644 --- a/src/DateTime/DateTime.h +++ b/src/DateTime/DateTime.h @@ -15,6 +15,7 @@ class DateTime { unsigned short daysInMonth(); public: + DateTime(); DateTime(unsigned short hour, unsigned short minute, unsigned short day, unsigned short month, unsigned short year); int compare(const DateTime& other) const; 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, |
