Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
2 files changed, 9 insertions, 5 deletions
-rw-r--r--src/Services/EventService.cpp6
-rw-r--r--src/Services/EventService.h8
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index 912b66b..c3124cc 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -25,12 +25,14 @@ unsigned EventService::indexOfEvent(const char* name, const Date& date) {
/* Public */
-EventService::EventService() {
+EventService::EventService(const HallService* hs) {
+ this->hs = hs;
events = OrderedList<Event>();
indSoonestUpcoming = 0;
}
-EventService::EventService(const Event* events, unsigned eventCount) {
+EventService::EventService(const HallService* hs, const Event* events, unsigned eventCount) {
+ this->hs = hs;
this->events = OrderedList<Event>(events, eventCount);
indSoonestUpcoming = 0;
updateSoonestUpcoming();
diff --git a/src/Services/EventService.h b/src/Services/EventService.h
index f0dd5b3..35be080 100644
--- a/src/Services/EventService.h
+++ b/src/Services/EventService.h
@@ -3,21 +3,23 @@
#include "../Generic/List/OrderedList.hpp"
#include "../Generic/Date/Date.h"
-
#include "../Models/Event.h"
+#include "HallService.h"
#include "StatusCode.h"
class EventService {
OrderedList<Event> events;
unsigned indSoonestUpcoming;
+ const HallService* hs;
+
void updateSoonestUpcoming();
unsigned indexOfEvent(const Date& date);
unsigned indexOfEvent(const char* name, const Date& date);
public:
- EventService();
- EventService(const Event* events, unsigned eventCount);
+ EventService(const HallService* hs);
+ EventService(const HallService* hs, const Event* events, unsigned eventCount);
StatusCode createEvent(int hallNumber, const String& name, const Date& date);
StatusCode cancelEvent(const char* name, const Date& date);