Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic / ConsoleInterface / Command.cpp
blob: d3d058c2e0e97e0302b4f531b83cb6ea68634d71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#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 {
	if (exec != nullptr)
		exec();
}

const char* Command::get_nameInMenu() const {
	return nameInMenu;
}