From ce04174c09a20d9c28027095a0e5f1ab56d7d6ed Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 5 May 2022 14:08:36 +0300 Subject: Autocommit at 05.05.2022 @ 14:08 --- src/ConsoleInterface/Menu.cpp | 6 ++++++ src/ConsoleInterface/Menu.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'src/ConsoleInterface') 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(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 menuOptions; public: + Menu(); Menu(const Command* commands, unsigned commandCount); + + void addCommand(const Command* command); void navigate() const; }; -- cgit v1.3.1-25-g4e2f