Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem / EventSystem.cpp
diff options
context:
space:
mode:
Commit57ad84517cd258d7df6ef8b63fbac6c9cb6fcba9 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 16:58:16 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 16:58:16 +0300
Files16768dac5ed21c69224282560e0bc7e788c39f17 /src/EventSystem/EventSystem.cpp
FMI-OOP-P1_TicketSystem-57ad84517cd258d7df6ef8b63fbac6c9cb6fcba9.tar
FMI-OOP-P1_TicketSystem-57ad84517cd258d7df6ef8b63fbac6c9cb6fcba9.tar.gz
FMI-OOP-P1_TicketSystem-57ad84517cd258d7df6ef8b63fbac6c9cb6fcba9.zip
Parenta10d94997c0019f815d83da5dc2ff07167868957 (diff)
Autocommit at 05.05.2022 @ 16:58
1 files changed, 11 insertions, 3 deletions
-rw-r--r--src/EventSystem/EventSystem.cpp14
diff --git a/src/EventSystem/EventSystem.cpp b/src/EventSystem/EventSystem.cpp
index 2f14707..dc64c3b 100644
--- a/src/EventSystem/EventSystem.cpp
+++ b/src/EventSystem/EventSystem.cpp
@@ -33,11 +33,19 @@ StatusCode EventSystem::createEvent(const Hall* hall, String name, Date date) {
}
List<Ticket> EventSystem::queryFreeTickets(const char* name, const Date& dt) {
- List<Ticket> freeTickets();
unsigned ind = indexOfEvent(name, dt);
- if (ind < events[ind].get_count()) {
-
+ if (ind == events[ind].get_count())
+ return List<Ticket>();
+
+ List<Ticket> freeTickets = List<Ticket>();
+
+ unsigned nextInd = 0;
+ for (unsigned r = 1; r <= events[ind].get_hall().get_rowCount(); r++) {
+ for (unsigned s = 1; s <= events[ind].get_hall().get_seatsPerRow(); s++) {
+
+ }
}
+
return freeTickets;
}