diff options
Moved templated stuff into hpp files and added a blank main.cpp file
1 files changed, 4 insertions, 1 deletions
| -rw-r--r-- | src/ConsoleInterface/Command.cpp | 5 |
diff --git a/src/ConsoleInterface/Command.cpp b/src/ConsoleInterface/Command.cpp index da8915f..d3d058c 100644 --- a/src/ConsoleInterface/Command.cpp +++ b/src/ConsoleInterface/Command.cpp @@ -1,13 +1,16 @@ #include "Command.h" #include <cstring> +Command::Command() : Command("", nullptr) {} + Command::Command(const char* nameInMenu, void (*exec)()) { strcpy(this->nameInMenu, nameInMenu); this->exec = exec; } void Command::run() const { - exec(); + if (exec != nullptr) + exec(); } const char* Command::get_nameInMenu() const { |
