FMI Table
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |
Menu.h
Go to the documentation of this file.
1#ifndef HEADER_CONSOLEINTERFACE_MENU
2#define HEADER_CONSOLEINTERFACE_MENU
3
8#include "Command.h"
9#include "../List/List.hpp"
10
17class Menu {
18 List<Command> menuOptions;
19
20public:
22 Menu();
24 Menu(const Command* commands, unsigned commandCount);
25
27 void addCommand(const Command& command);
28
30 void navigate() const;
31};
32
33#endif
Stores the declaration of class Command.
Stores a 256 character name and a function pointer to be executed when calling run()
Definition: Command.h:12
Handles navigation between multiple commands.
Definition: Menu.h:17
void navigate() const
Lists commands and after user input executes an appropriate command run() function.
Definition: Menu.cpp:30
void addCommand(const Command &command)
Adds a command to the internal Command list.
Definition: Menu.cpp:14
Menu(const Command *commands, unsigned commandCount)
Copies commands.
Menu()
Sets name as "Menu", leaves all flags to false and creates an empty Command list.
Definition: Menu.cpp:5