From b844597fd23bc57aa97e231fc90eecfd6322cecc Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 7 May 2022 08:28:27 +0300 Subject: Reorganized whole architecture --- src/Generic/ConsoleInterface/Command.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/Generic/ConsoleInterface/Command.cpp (limited to 'src/Generic/ConsoleInterface/Command.cpp') diff --git a/src/Generic/ConsoleInterface/Command.cpp b/src/Generic/ConsoleInterface/Command.cpp new file mode 100644 index 0000000..d3d058c --- /dev/null +++ b/src/Generic/ConsoleInterface/Command.cpp @@ -0,0 +1,18 @@ +#include "Command.h" +#include + +Command::Command() : Command("", nullptr) {} + +Command::Command(const char* nameInMenu, void (*exec)()) { + strcpy(this->nameInMenu, nameInMenu); + this->exec = exec; +} + +void Command::run() const { + if (exec != nullptr) + exec(); +} + +const char* Command::get_nameInMenu() const { + return nameInMenu; +} -- cgit v1.3.1-23-gd82d