Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem
diff options
context:
space:
mode:
3 files changed, 12 insertions, 3 deletions
-rw-r--r--src/EventSystem/Event.cpp11
-rw-r--r--src/EventSystem/Event.h2
-rw-r--r--src/EventSystem/StatusCodes.h2
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,