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.
Diff: Menu/Menu.h
- Revision:
- 14:a57a40ff9430
- Parent:
- 12:d3eef5ea3f43
- Child:
- 15:130900e5c268
--- a/Menu/Menu.h Mon May 07 19:41:09 2018 +0000
+++ b/Menu/Menu.h Tue May 08 13:15:41 2018 +0000
@@ -2,23 +2,57 @@
#include "N5110.h"
#include "Gamepad.h"
+/** The Menu class
+* @brief Handles all logic and drawing related to the menu, doesn't set any selected options in the game engine directly
+* @author Andrew J. Moore
+* @date May, 2018
+*/
+
class Menu
{
public:
+ /** Constructor */
Menu();
+
+ /** Destructor */
~Menu();
+
+ /** Initialization function */
void init();
+
+ /** Reads and stores the current inputs from the gamepad
+ * @param the current state of the gamepad (Gamepad)
+ */
void read_input(Gamepad &pad);
+
+ /** Updates the current menu state */
void update();
+
+ /** Draws the current state of the menu
+ * @param the LCD so that it can be drawn to (N5110)
+ */
void draw(N5110 &lcd);
+
+ /** Gets if 'Start' has been selected in the menu
+ * @return the value of _start
+ */
bool started();
+
+ /** Gets the current difficulty setting
+ * @return the value of _difficulty
+ */
int getDif();
+
+ /** Gets the currently selected level
+ * @return the value of _level
+ */
int getLvl();
private:
+ //Private Variables
char _d;
bool _start;
int _mainSelection;
@@ -29,5 +63,8 @@
int _difficulty;
int _level;
+ //Private Methods
+ void moveArrow();
+ void selectItem();
};
\ No newline at end of file