diff options
Autocommit at 05.05.2022 @ 15:14
2 files changed, 7 insertions, 4 deletions
| -rw-r--r-- | src/ConsoleInterface/Menu.cpp | 8 | ||||
| -rw-r--r-- | src/ConsoleInterface/Menu.h | 3 |
diff --git a/src/ConsoleInterface/Menu.cpp b/src/ConsoleInterface/Menu.cpp index 3df71ae..4112ed2 100644 --- a/src/ConsoleInterface/Menu.cpp +++ b/src/ConsoleInterface/Menu.cpp @@ -2,11 +2,13 @@ #include "Toolbox.hpp" #include <cstring> -Menu::Menu() : menuOptions() { - strcpy(title, "Menu"); +Menu::Menu() : Menu("Menu") {} + +Menu::Menu(const char* title) : menuOptions() { + strcpy(this->title, title); } -Menu::Menu(const Command* commands, unsigned commandCount, const char* title) { +Menu::Menu(const char* title, const Command* commands, unsigned commandCount) { menuOptions = List<Command>(commands, commandCount); strcpy(this->title, title); } diff --git a/src/ConsoleInterface/Menu.h b/src/ConsoleInterface/Menu.h index 37bdf48..3ee4b0b 100644 --- a/src/ConsoleInterface/Menu.h +++ b/src/ConsoleInterface/Menu.h @@ -10,7 +10,8 @@ class Menu { public: Menu(); - Menu(const Command* commands, unsigned commandCount, const char* title); + Menu(const char* title); + Menu(const char* title, const Command* commands, unsigned commandCount); void addCommand(const Command& command); void navigate() const; |
