Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface
diff options
context:
space:
mode:
2 files changed, 9 insertions, 0 deletions
-rw-r--r--src/ConsoleInterface/Menu.cpp6
-rw-r--r--src/ConsoleInterface/Menu.h3
diff --git a/src/ConsoleInterface/Menu.cpp b/src/ConsoleInterface/Menu.cpp
index 615b722..6b99deb 100644
--- a/src/ConsoleInterface/Menu.cpp
+++ b/src/ConsoleInterface/Menu.cpp
@@ -1,10 +1,16 @@
#include "Menu.h"
#include "Toolbox.hpp"
+Menu::Menu() : menuOptions() {}
+
Menu::Menu(const Command* commands, unsigned commandCount) {
menuOptions = List<Command>(commands, commandCount);
}
+void Menu::addCommand(const Command* command) {
+ menuOptions.add(command);
+}
+
void Menu::navigate() const {
if (menuOptions.get_count() == 0) {
printLine("Menu is empty!");
diff --git a/src/ConsoleInterface/Menu.h b/src/ConsoleInterface/Menu.h
index f80636d..e81d77f 100644
--- a/src/ConsoleInterface/Menu.h
+++ b/src/ConsoleInterface/Menu.h
@@ -8,7 +8,10 @@ class Menu {
List<Command> menuOptions;
public:
+ Menu();
Menu(const Command* commands, unsigned commandCount);
+
+ void addCommand(const Command* command);
void navigate() const;
};