Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit6045cd3f5e08d4f8121c6536552d32f6483ed9b1 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-02 20:30:14 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-02 20:30:14 +0300
Filesd35675e1177d367b5c54ee9663597a7eadf90bc9 /src
FMI-OOP-P1_TicketSystem-6045cd3f5e08d4f8121c6536552d32f6483ed9b1.tar
FMI-OOP-P1_TicketSystem-6045cd3f5e08d4f8121c6536552d32f6483ed9b1.tar.gz
FMI-OOP-P1_TicketSystem-6045cd3f5e08d4f8121c6536552d32f6483ed9b1.zip
Parente610920638595f07e3b36d67d947dac3d4f6a766 (diff)
Autocommit at 02.05.2022 @ 20:30
6 files changed, 15 insertions, 3 deletions
-rw-r--r--src/.!lazygit.swobin24576 -> 24576 bytes
-rw-r--r--src/DateTime/DateTime.cpp2
-rw-r--r--src/DateTime/DateTime.h1
-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/.!lazygit.swo b/src/.!lazygit.swo
index f672dc5..939e762 100644
--- a/src/.!lazygit.swo
+++ b/src/.!lazygit.swo
Binary files differ
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,