Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem
diff options
context:
space:
mode:
Commit19dc8457df9a9f9b79ff65f1c259c2ec537ba4cc (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 22:51:04 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 22:51:04 +0300
Files8f4ed60ce908bd735c99cdaef3b7f58b55b08503 /src/EventSystem
FMI-OOP-P1_TicketSystem-19dc8457df9a9f9b79ff65f1c259c2ec537ba4cc.tar
FMI-OOP-P1_TicketSystem-19dc8457df9a9f9b79ff65f1c259c2ec537ba4cc.tar.gz
FMI-OOP-P1_TicketSystem-19dc8457df9a9f9b79ff65f1c259c2ec537ba4cc.zip
Parent937571f084013735b53f1c3bd843251742a3033d (diff)
Minor naming changes
3 files changed, 6 insertions, 17 deletions
-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/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);
};