Implement 75% off menu

This commit is contained in:
2022-01-19 09:13:53 +01:00
parent 4ba7995bb4
commit 241123e6c9
6 changed files with 197 additions and 27 deletions
+19 -2
View File
@@ -19,20 +19,37 @@ MenuEntry::MenuEntry(const char* name, void (*function) (), void (*callback) ())
MenuEntry::MenuEntry(const char* name, void (*function) ()) {
this->name = name;
this->function = function;
this->callback = nullptr;
}
MenuEntry::MenuEntry(const char* name, Menu* menu) {
this->name = name;
this->menu = menu;
this->isMenu = true;
this->callback = nullptr;
}
void MenuEntry::run() {
void MenuEntry::runAction() {
if (isMenu)
{}
this->menu->printMenu();
else
this->function();
if (this->callback)
this->callback();
}
const char* MenuEntry::getName() {
return this->name;
}
bool MenuEntry::getIsMenu() {
return this->isMenu;
}
Menu* MenuEntry::getMenu() {
if (isMenu)
return this->menu;
else
return nullptr;
}