Yang Zhenye 201199680

Dependencies:   mbed

Menu/Menu.h

Committer:
yangzhenye
Date:
2020-05-15
Revision:
9:a5a82b3d1102
Parent:
5:fcad75e9b9e1

File content as of revision 9:a5a82b3d1102:

#ifndef MENU_H
#define MENU_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "RooneyEngine.h"

struct State {
    int output;
    int next_state[4]; };
        
class Menu {
    public:
    // Constructor and destructor.
    /**
    * @brief Constructor @details Non user specified.
    */
    Menu();
    /**
    * @brief Destructor @details Non user specified.
    */
    ~Menu();
  // Mutators
  /**
  * @brief Initialises the Menu.
  */
    void init();
  /**
  * @brief Runs the menu and a state machine.
  * @param &lcd @details The lcd object from the N5110 class
  * @param &gamepad @details The gamepad object from Gamepad class
  */
    void run_engine(N5110 &lcd, Gamepad &gamepad);
  /**
  * @brief Runs the game.
  * @param &lcd @details The lcd object from the N5110 class
  * @param &gamepad @details The gamepad object from Gamepad class
  */
    void run_game(N5110 &lcd, Gamepad &gamepad);
    
    private:
    void display_page1(N5110 &lcd, Gamepad &gamepad);
   // void display_page2(N5110 &lcd, Gamepad &gamepad);
    void display_page3(N5110 &lcd, Gamepad &gamepad);
    void get_output(N5110 &lcd, Gamepad &gamepad);
    void get_input(bool start, bool back, bool x);
    int _output;
    int _state;
    int _input;
    RooneyEngine _engine;
    };
    #endif