Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
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);