Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit3911efcb1588481f9d95c91e39fe470bcc5a50a5 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 09:46:16 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 09:46:16 +0300
Files5f74062c4e61395a23b68b1f13fbbde4af44933e /src
FMI-OOP-P1_TicketSystem-3911efcb1588481f9d95c91e39fe470bcc5a50a5.tar
FMI-OOP-P1_TicketSystem-3911efcb1588481f9d95c91e39fe470bcc5a50a5.tar.gz
FMI-OOP-P1_TicketSystem-3911efcb1588481f9d95c91e39fe470bcc5a50a5.zip
Parentbb77a6c8a62f677f27d9d593b5f2a45514bdb4f6 (diff)
Autocommit at 06.05.2022 @ 09:46
5 files changed, 20 insertions, 4 deletions
-rw-r--r--src/ConsoleInterface/Toolbox.cpp9
-rw-r--r--src/ConsoleInterface/Toolbox.hpp2
-rw-r--r--src/EventSystem/Event.cpp8
-rw-r--r--src/EventSystem/Event.h2
-rw-r--r--src/VenueConsoleUI.cpp3
diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp
index 42b0ffd..35aee1c 100644
--- a/src/ConsoleInterface/Toolbox.cpp
+++ b/src/ConsoleInterface/Toolbox.cpp
@@ -3,7 +3,7 @@
void clear() {
// Clears console on Linux
// Source: https://stackoverflow.com/a/52895729/12036073
- std::cout << u8"\033[2J\033[1;1H";
+ // std::cout << u8"\033[2J\033[1;1H";
}
int orderedListIndex = 1;
@@ -33,8 +33,13 @@ void errorBox(const char* message) {
}
void __printTableColumnHeader(unsigned start, unsigned count) {
+ for (unsigned i = 0; i < count - 1; i++, start++)
+ std::cout << ":" << ((start < 100) ? " " : "") << start << ((start < 10) ? " " : "");
+ std::cout << ":" << std::endl;
+
for (unsigned i = 0; i < count - 1; i++)
- std::cout << ":" <<
+ std::cout << "....";
+ std::cout << "." << std::endl;
}
void table(unsigned startNumber, unsigned columns, const char* items) {
diff --git a/src/ConsoleInterface/Toolbox.hpp b/src/ConsoleInterface/Toolbox.hpp
index bb79b9e..daf8db4 100644
--- a/src/ConsoleInterface/Toolbox.hpp
+++ b/src/ConsoleInterface/Toolbox.hpp
@@ -14,6 +14,8 @@ void successBox(const char* message);
void warningBox(const char* message);
void errorBox(const char* message);
+void table(unsigned startNumber, unsigned columns, const char* items);
+
void inputLineBox(const char* label, char* output, unsigned maxWidth);
void resetOrderedList(int starter = 1);
diff --git a/src/EventSystem/Event.cpp b/src/EventSystem/Event.cpp
index f6c63a1..9bab15b 100644
--- a/src/EventSystem/Event.cpp
+++ b/src/EventSystem/Event.cpp
@@ -10,6 +10,14 @@ Event::Event(const Hall* hall, String name, Date date) : tickets(), reservations
this->date = date;
}
+const OrderedList<Ticket>& Event::get_tickets() const {
+ return tickets;
+}
+
+const OrderedList<Reservation>& Event::get_reservations() const {
+ return reservations;
+}
+
const Hall& Event::get_hall() const {
return *hall;
}
diff --git a/src/EventSystem/Event.h b/src/EventSystem/Event.h
index d927be9..cb93fbd 100644
--- a/src/EventSystem/Event.h
+++ b/src/EventSystem/Event.h
@@ -16,8 +16,6 @@ class Event {
String name;
const Hall* hall;
- unsigned freeSeats;
-
public:
Event();
Event(const Hall* hall, String name, Date date);
diff --git a/src/VenueConsoleUI.cpp b/src/VenueConsoleUI.cpp
index 4cc80ab..137857b 100644
--- a/src/VenueConsoleUI.cpp
+++ b/src/VenueConsoleUI.cpp
@@ -33,10 +33,13 @@ void handleStatusCode(StatusCode sc, Menu menu) {
/* Ticket Management */
void command_freeSeats() {
+ table(0, 10, "");
+ /*
char name[MAX_LINE_WIDTH];
inputLineBox("Enter event name: ", name, MAX_LINE_WIDTH);
Date date;
inputBox("Enter event date: ", &date);
+ */
}
void command_reserveTicket() {