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
Diff: UserInteraction/UX.h
- Revision:
- 30:43aace0fdbdf
- Parent:
- 29:f7a2d2a755ec
- Child:
- 31:eefa1d23a843
diff -r f7a2d2a755ec -r 43aace0fdbdf UserInteraction/UX.h
--- a/UserInteraction/UX.h Tue May 07 18:38:54 2019 +0000
+++ b/UserInteraction/UX.h Wed May 08 01:20:06 2019 +0000
@@ -7,77 +7,96 @@
/** Ball UX
@author Shahid Zubin Sajid
-@brief Class for menus and display's user convenience
+@brief Class for menus and display's user convenience
@date Febraury 2017
-*/
+*/
class UX
{
public:
UX();
~UX();
- /**
+ /**
* @brief Initlialises the UX class
*/
void init();
- /**
+ /**
* @brief checks if the Button A is pressed
* @returns returns an int, 1 if the button is pressed 0 if false
*/
int get_a_pressed();
- /**
+ /**
* @brief checks if the Button L is pressed
* @returns returns an int, 1 if the button is pressed 0 if false
*/
- int get_l_pressed();
- /**
+ int get_l_pressed();
+ /**
*@brief prints the introuction screen for the game
*@param &menu_lcd @details reference object for a N5110 class object
*/
void first_menu(N5110 &menu_lcd);
- /**
+ /**
*@brief prints options menu and takes user input for which option they would like to choose
*@param &menu_lcd @details reference object for a N5110 class object
*/
void second_menu(N5110 &menu_lcd);
- /**
+ /**
*@brief prints options menu and takes user input for which option they would like to choose
*@param &menu_lcd @details reference object for a N5110 class object
*/
void menu_options(N5110 &menu_lcd);
- /**
+ /**
*@brief prints the rules for the game across multiple displays
*@param &menu_lcd @details reference object for a N5110 class object
*/
void rules_menu(N5110 &menu_lcd);
- /**
+ /**
*@brief prints the controls for the game across 3 displays
*@param &menu_lcd @details reference object for a N5110 class object
*/
void controls_menu(N5110 &menu_lcd);
- /**
+ /**
*@brief prints the screen for when game is over
*@param &menu_lcd @details reference object for a N5110 class object
*@param option @details option integer which denotes the manner in which the batsman was out
*/
void game_over_menu(N5110 &menu_lcd,int option);
- /**
+ /**
*@brief prints the screen when player wins the game
*@param &menu_lcd @details reference object for a N5110 class object
*/
void victory_menu(N5110 &menu_lcd);
void info_screen(N5110 &menu_lcd, int target);
-
+ /**
+ *@brief Prints the rules for the game on the screen, called in rules_menu()
+ *@param &menu_lcd @details reference object for a N5110 class object
+ */
+ void rules_menu_game(N5110 &menu_lcd);
+ /**
+ *@brief Prints the rules for scoring runs during the game
+ *@param &menu_lcd @details reference object for a N5110 class object
+ */
+ void rules_menu_screen_out(N5110 &menu_lcd);
+ /**
+ *@brief Prints the rules for how a player can get out and lose the game
+ *@param &menu_lcd @details reference object for a N5110 class object
+ */
+ void rules_menu_screen_scoring_runs(N5110 &menu_lcd);
+ /**
+ * @brief resets the button_pressed boolean variable to false
+ */
+ void reset();
+
private:
/*Seperate Gamepad has been used in this class because Gamepad obect
- f rom the main class had issues with the CHECK_EVENT Function. The function was not responsive
+ from the main class had issues with the CHECK_EVENT Function. The function was not responsive
and could not be resolved and as a result the only suitable solution was to create another object
- this explains why a ux object was passed in the Bat class to check if ball was hit or lofted as the
+ this explains why a ux object was passed in the Bat class to check if ball was hit or lofted as the
CHECK_EVENT was not responsive in the BAT class
*/
Gamepad batPad;
-
- // boolean variable used in get_a_pressed() get_l_pressed() to check if button is pressed
+
+ // boolean variable used in get_a_pressed() get_l_pressed() to check if button is pressed
bool _button_pressed;
};
-#endif
\ No newline at end of file
+#endif