Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit65499bb801ce663a2bc45a3508fa32246090d0e7 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 13:43:28 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 13:43:28 +0300
Filesc454ea747b5d5643477cc5b85441d3ea2ca19483 /src
FMI-OOP-P1_TicketSystem-65499bb801ce663a2bc45a3508fa32246090d0e7.tar
FMI-OOP-P1_TicketSystem-65499bb801ce663a2bc45a3508fa32246090d0e7.tar.gz
FMI-OOP-P1_TicketSystem-65499bb801ce663a2bc45a3508fa32246090d0e7.zip
Parent0802d9d40c70e960def1fb70f650b26b75c39049 (diff)
Autocommit at 05.05.2022 @ 13:43
4 files changed, 8 insertions, 1 deletions
-rw-r--r--src/ConsoleInterface/Toolbox.hpp2
-rw-r--r--src/Venue/Venue.cpp4
-rw-r--r--src/Venue/Venue.h1
-rw-r--r--src/VenueConsoleUI.cpp2
diff --git a/src/ConsoleInterface/Toolbox.hpp b/src/ConsoleInterface/Toolbox.hpp
index a198684..dcb9459 100644
--- a/src/ConsoleInterface/Toolbox.hpp
+++ b/src/ConsoleInterface/Toolbox.hpp
@@ -55,7 +55,7 @@ void inputBoxLabel(const char* label) {
template <typename T>
void inputBox(const char* label, T* output) {
inputBoxLabel(label);
- std::cin >> output;
+ std::cin >> *output;
}
void inputLineBox(const char* label, char* output, unsigned maxWidth) {
diff --git a/src/Venue/Venue.cpp b/src/Venue/Venue.cpp
index e33af61..50fc9c1 100644
--- a/src/Venue/Venue.cpp
+++ b/src/Venue/Venue.cpp
@@ -7,6 +7,10 @@ Venue::Venue(const Hall* halls, unsigned hallCount, const EventSystem& es) {
this->es = es;
}
+bool Venue::hallExists(unsigned hallIndex) const {
+ return hallIndex < halls.get_count();
+}
+
bool Venue::hallExists(const Hall& hall) const {
return this->halls.contain(hall);
}
diff --git a/src/Venue/Venue.h b/src/Venue/Venue.h
index 8c4452a..c7ac46c 100644
--- a/src/Venue/Venue.h
+++ b/src/Venue/Venue.h
@@ -13,6 +13,7 @@ public:
Venue();
Venue(const Hall* halls, unsigned hallCount, const EventSystem& es);
+ bool hallExists(unsigned hallIndex) const;
bool hallExists(const Hall& hall) const;
const List<Hall>& get_halls() const;
diff --git a/src/VenueConsoleUI.cpp b/src/VenueConsoleUI.cpp
index 539ad4e..49654e1 100644
--- a/src/VenueConsoleUI.cpp
+++ b/src/VenueConsoleUI.cpp
@@ -6,6 +6,8 @@
Venue v;
void command_newEvent() {
+ unsigned hallIndex;
+ inputBox("Enter hall index: ", &hallIndex);
char name[MAX_LINE_WIDTH];
inputLineBox("Enter event name: ", name, MAX_LINE_WIDTH);