Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
4 files changed, 8 insertions, 19 deletions
-rw-r--r--src/ConsoleInterface/Toolbox.cpp4
-rw-r--r--src/EventSystem/Event.cpp8
-rw-r--r--src/EventSystem/Event.h13
-rw-r--r--src/EventSystem/EventSystem.h2
diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp
index 11ab374..1f2e42c 100644
--- a/src/ConsoleInterface/Toolbox.cpp
+++ b/src/ConsoleInterface/Toolbox.cpp
@@ -78,7 +78,7 @@ void _printInputBoxLabel(const char* label) {
std::cout << "(+) " << label;
}
-void _printInputBoxSubLabel(const char* label) {
+void _printInputSubBoxLabel(const char* label) {
std::cout << " ";
_printInputBoxLabel(label);
}
@@ -94,6 +94,6 @@ void inputLineBox(const char* label, char* output, unsigned maxWidth) {
}
void inputLineSubBox(const char* label, char* output, unsigned maxWidth) {
- _printInputBoxSubLabel(label);
+ _printInputSubBoxLabel(label);
__inputLineBoxGetInput(output, maxWidth);
}
diff --git a/src/EventSystem/Event.cpp b/src/EventSystem/Event.cpp
index 9bab15b..e6105eb 100644
--- a/src/EventSystem/Event.cpp
+++ b/src/EventSystem/Event.cpp
@@ -70,14 +70,6 @@ StatusCode Event::buyTicketFromReservation(const Reservation& reservation, const
return Success;
}
-bool Event::ticketIsFree(unsigned row, unsigned seat) {
- return ticketIsFree(Ticket(row, seat));
-}
-
-bool Event::ticketIsFree(const Ticket& ticket) {
- return tickets.findIndex(ticket) != tickets.get_count() || reservations.findIndex(Reservation(ticket)) != reservations.get_count();
-}
-
int Event::compare(const Event& other) {
// TODO: improve
return name.compare(other.name);
diff --git a/src/EventSystem/Event.h b/src/EventSystem/Event.h
index cb93fbd..43ad5d9 100644
--- a/src/EventSystem/Event.h
+++ b/src/EventSystem/Event.h
@@ -10,21 +10,21 @@
#include "StatusCodes.h"
class Event {
+ const Hall* hall;
+ String name;
+ Date date;
OrderedList<Ticket> tickets;
OrderedList<Reservation> reservations;
- Date date;
- String name;
- const Hall* hall;
public:
Event();
Event(const Hall* hall, String name, Date date);
- const OrderedList<Ticket>& get_tickets() const;
- const OrderedList<Reservation>& get_reservations() const;
const Hall& get_hall() const;
const String& get_name() const;
const Date& get_date() const;
+ const OrderedList<Ticket>& get_tickets() const;
+ const OrderedList<Reservation>& get_reservations() const;
StatusCode reserveTicket(const Ticket& ticket, const char* password, const char* note);
@@ -35,9 +35,6 @@ public:
StatusCode buyTicketFromReservation(const Reservation& reservation, const char* password);
- bool ticketIsFree(unsigned row, unsigned seat);
- bool ticketIsFree(const Ticket& ticket);
-
int compare(const Event& other);
};
diff --git a/src/EventSystem/EventSystem.h b/src/EventSystem/EventSystem.h
index a64acec..4eeac61 100644
--- a/src/EventSystem/EventSystem.h
+++ b/src/EventSystem/EventSystem.h
@@ -37,9 +37,9 @@ public:
OrderedList<Ticket> queryTickets(const char* name, const Date& date);
OrderedList<Reservation> queryReservations(const char* name, const Date& date);
- void queryBoughtTickets(Date start, Date end, unsigned hall);
void queryMostVisited();
void queryInsufficientlyVisited();
+ void reportBoughtTickets(Date start, Date end, unsigned hall);
void reportReservations(unsigned eventIndex);
};