diff options
Autocommit at 06.05.2022 @ 11:36
2 files changed, 4 insertions, 5 deletions
| -rw-r--r-- | src/Venue/Hall.cpp | 1 | ||||
| -rw-r--r-- | src/VenueConsoleUI.cpp | 8 |
diff --git a/src/Venue/Hall.cpp b/src/Venue/Hall.cpp index 864ea6e..98b8cbb 100644 --- a/src/Venue/Hall.cpp +++ b/src/Venue/Hall.cpp @@ -30,6 +30,5 @@ void Hall::set_seatsPerRow(unsigned seatsPerRow) { } int Hall::compare(const Hall& other) { - // TODO: compare seats and rows return (index > other.get_index()) - (index < other.get_index()); } diff --git a/src/VenueConsoleUI.cpp b/src/VenueConsoleUI.cpp index fdac1bc..af02425 100644 --- a/src/VenueConsoleUI.cpp +++ b/src/VenueConsoleUI.cpp @@ -51,8 +51,8 @@ void command_freeSeats() { unsigned tableSize = hall->get_rowCount() * hall->get_seatsPerRow(); char tableData[tableSize + 1]; - for (unsigned ind = 0, row = 1; row < hall->get_rowCount(); row++) { - for (unsigned seat = 1; seat < hall->get_seatsPerRow(); seat++, ind++) { + for (unsigned ind = 0, row = 1; row <= hall->get_rowCount(); row++) { + for (unsigned seat = 1; seat <= hall->get_seatsPerRow(); seat++, ind++) { if (tickets.contain(Ticket(row, seat))) tableData[ind] = 'B'; else if (reservations.contain(Ticket(row, seat))) @@ -71,12 +71,12 @@ void command_reserveTicket() { inputLineBox("Enter event name: ", name, MAX_LINE_WIDTH); Date date; inputBox("Enter event date: ", &date); + Ticket tic; + inputBox("Enter row and seat: ", &tic); char password[PASSWORD_LEN]; inputBox("Enter password [Max 8 characters]: ", &password); char note[NOTE_LEN]; inputBox("Enter note [Max 32 characters]: ", ¬e); - Ticket tic; - inputBox("Enter row and seat: ", &tic); handleStatusCode(v->get_es().reserveTicket(name, date, password, note, tic), ticketManagementMenu); } |
