Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Services
diff options
context:
space:
mode:
2 files changed, 4 insertions, 2 deletions
-rw-r--r--src/Services/EventService.cpp4
-rw-r--r--src/Services/EventService.h2
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index fc62c64..a1ba34e 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -135,12 +135,14 @@ StatusCode EventService::buyTicket(const char* name, const Date& date, const Tic
return Success;
}
-String EventService::createSeatingString(const char* name, const Date& date) {
+String EventService::createSeatingString(const char* name, const Date& date, unsigned* seatsPerRow) {
unsigned eInd = indexOfEvent(name, date);
if (eInd == events.get_count())
return "";
unsigned rowCount = events[eInd].get_hall().get_rows(), seatsCount = events[eInd].get_hall().get_seatsPerRow();
+ *seatsPerRow = seatsCount;
+
String out;
for (unsigned row = 1; row <= rowCount; row++) {
for (unsigned seat = 1; seat <= seatsCount; seat++) {
diff --git a/src/Services/EventService.h b/src/Services/EventService.h
index 6e7b970..214d6ff 100644
--- a/src/Services/EventService.h
+++ b/src/Services/EventService.h
@@ -34,7 +34,7 @@ public:
StatusCode buyTicket(const char* name, const Date& date, unsigned row, unsigned seat);
StatusCode buyTicket(const char* name, const Date& date, const Ticket& ticket);
- String createSeatingString(const char* name, const Date& date);
+ String createSeatingString(const char* name, const Date& date, unsigned* seatsPerRow = nullptr);
void queryMostVisited();
void queryInsufficientlyVisited();