Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic / ConsoleInterface / Menu.h
blob: 68037df7aa4cc67a9891b0f613f0e1e7189ba080 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef HEADER_CONSOLEINTERFACE_MENU
#define HEADER_CONSOLEINTERFACE_MENU

/*! \file Menu.h
 *  \brief Stores the declaration of class Menu
 */

#include "Command.h"
#include "../List/List.hpp"

/*! \brief Handles navigation between multiple commands
 *
 * Shows the title, then below it an Error/Warning/Success message if set,
 * lists all command options as an enumerated list, takes command index
 * and calls the chosen command's run() function.
 */
class Menu {
	List<Command> menuOptions;

public:
	//! Sets name as "Menu", leaves all flags to false and creates an empty Command list
	Menu();
	//! Copies commands
	Menu(const Command* commands, unsigned commandCount);

	//! Lists commands and after user input executes an appropriate command run() function
	void navigate() const;
};

#endif