Dmitrijs Griskovs / Mbed 2 deprecated el17dg

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers menu.h Source File

menu.h

00001 #ifndef MENU_H
00002 #define MENU_H
00003 
00004 
00005 /**
00006  * The enumeration of available options in the menu. 
00007  */
00008 enum ScreenOption {             
00009     ScreenOption_Menu,      /**< The menu option - Choosing other options */
00010     ScreenOption_Game,      /**< The game option - To start the game */
00011     ScreenOption_Tutorial,  /**< The tutorial option - To open tutorial */
00012     ScreenOption_Settings   /**< The settings option - To open settings */
00013 };
00014 
00015 /**
00016  * Menu Class
00017  * @brief Describes the menu.
00018  * @author Dmitrijs Griskovs
00019  * @date 15/04/2019
00020  */
00021 class Menu {
00022 public:
00023     /** A constructor */
00024     Menu();    
00025     /** 
00026      * @brief Updates and Draws menu.
00027      * @details Updates and draws menu options. Also, allows to select an option availabe   
00028      * from the enum. It return "true" statment if the user picked a menu option.
00029      */                            
00030     bool updateAndDraw();  
00031 
00032     /** Returns currently selected meny option */
00033     ScreenOption getCurrentScreenSelection(); 
00034         
00035 private:
00036     int current_option;
00037     static const int total_options = 3;
00038     static const float time_delay = 50;
00039     void pointerPosition(int menu_number);
00040     void drawPointer();
00041     void DrawPressAIcon();
00042     void checkJoystick();
00043 };
00044 
00045 
00046 #endif