Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed FATFileSystem
Menu/Menu.h
- Committer:
- ellisbhastroud
- Date:
- 2019-03-29
- Revision:
- 3:a8960004d261
- Parent:
- 2:81cfa8310f55
- Child:
- 4:035448357749
File content as of revision 3:a8960004d261:
#ifndef MENU_H
#define MENU_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
/** Enum for menu options */
enum MenuChoices {
START, /**< Begin Game */
HIGHSCORES, /**< View Highscores */
SETTINGS, /**< View Settings */
};
/** Menu Class
* @brief Library for navigating menu options
* @author Ellis Blackford Stroud
* @date May, 2018
*/
class Menu {
public:
/** Constructor */
Menu();
/** Destructor */
~Menu();
void init();
/** Prints opening message */
void print_welcome(N5110 &lcd);
/** Prints menu screen */
void print_menu(N5110 &lcd);
/** Prints start screen */
bool check_start(N5110 &lcd, Gamepad &pad);
/** Prints highscore screen */
void print_highscores(N5110 &lcd);
/** Prints settings screen */
void print_settings(N5110 &lcd);
/** Changes screen to menu choice and returns start game message
* @returns a bool: true to start game, false to stay in menu
*/
bool menu_change(N5110 &lcd, Gamepad &pad);
/** Returns to menu screen */
void menu_return(N5110 &lcd, Gamepad &pad);
/** Updates cursor and returns menu choice
* @returns an enum: START, HIGHSCORES, SETTINGS
*/
void menu_select(Gamepad &pad, N5110 &lcd);
private:
void draw_cursor(N5110 &lcd);
MenuChoices _cursor_pos;
};
#endif