zhenye yang / Mbed 2 deprecated el17zy

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 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 #include "RooneyEngine.h"
00008 
00009 struct State {
00010     int output;
00011     int next_state[4]; };
00012         
00013 class Menu {
00014     public:
00015     // Constructor and destructor.
00016     /**
00017     * @brief Constructor @details Non user specified.
00018     */
00019     Menu();
00020     /**
00021     * @brief Destructor @details Non user specified.
00022     */
00023     ~Menu();
00024   // Mutators
00025   /**
00026   * @brief Initialises the Menu.
00027   */
00028     void init();
00029   /**
00030   * @brief Runs the menu and a state machine.
00031   * @param &lcd @details The lcd object from the N5110 class
00032   * @param &gamepad @details The gamepad object from Gamepad class
00033   */
00034     void run_engine(N5110 &lcd, Gamepad &gamepad);
00035   /**
00036   * @brief Runs the game.
00037   * @param &lcd @details The lcd object from the N5110 class
00038   * @param &gamepad @details The gamepad object from Gamepad class
00039   */
00040     void run_game(N5110 &lcd, Gamepad &gamepad);
00041     
00042     private:
00043     void display_page1(N5110 &lcd, Gamepad &gamepad);
00044    // void display_page2(N5110 &lcd, Gamepad &gamepad);
00045     void display_page3(N5110 &lcd, Gamepad &gamepad);
00046     void get_output(N5110 &lcd, Gamepad &gamepad);
00047     void get_input(bool start, bool back, bool x);
00048     int _output;
00049     int _state;
00050     int _input;
00051     RooneyEngine _engine;
00052     };
00053     #endif
00054