Yang Zhenye 201199680

Dependencies:   mbed

Committer:
yangzhenye
Date:
Thu May 14 14:13:03 2020 +0000
Revision:
5:fcad75e9b9e1
Parent:
4:eb8dca1dc341
Child:
9:a5a82b3d1102
first

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yangzhenye 2:baca89f466bc 1 #ifndef MENU_H
yangzhenye 2:baca89f466bc 2 #define MENU_H
yangzhenye 2:baca89f466bc 3
yangzhenye 2:baca89f466bc 4 #include "mbed.h"
yangzhenye 2:baca89f466bc 5 #include "N5110.h"
yangzhenye 2:baca89f466bc 6 #include "Gamepad.h"
yangzhenye 4:eb8dca1dc341 7 #include "RooneyEngine.h"
yangzhenye 2:baca89f466bc 8
yangzhenye 2:baca89f466bc 9 struct State {
yangzhenye 2:baca89f466bc 10 int output;
yangzhenye 5:fcad75e9b9e1 11 int next_state[4]; };
yangzhenye 5:fcad75e9b9e1 12
yangzhenye 2:baca89f466bc 13 class Menu {
yangzhenye 2:baca89f466bc 14 public:
yangzhenye 5:fcad75e9b9e1 15 // Constructor and destructor.
yangzhenye 5:fcad75e9b9e1 16 /**
yangzhenye 5:fcad75e9b9e1 17 * @brief Constructor @details Non user specified.
yangzhenye 5:fcad75e9b9e1 18 */
yangzhenye 2:baca89f466bc 19 Menu();
yangzhenye 5:fcad75e9b9e1 20 /**
yangzhenye 5:fcad75e9b9e1 21 * @brief Destructor @details Non user specified.
yangzhenye 5:fcad75e9b9e1 22 */
yangzhenye 2:baca89f466bc 23 ~Menu();
yangzhenye 2:baca89f466bc 24 void init();
yangzhenye 5:fcad75e9b9e1 25 void run_engine(N5110 &lcd, Gamepad &gamepad);
yangzhenye 5:fcad75e9b9e1 26 void run_game(N5110 &lcd, Gamepad &gamepad);
yangzhenye 2:baca89f466bc 27
yangzhenye 2:baca89f466bc 28 private:
yangzhenye 5:fcad75e9b9e1 29 void display_page1(N5110 &lcd, Gamepad &gamepad);
yangzhenye 5:fcad75e9b9e1 30 void display_page2(N5110 &lcd, Gamepad &gamepad);
yangzhenye 5:fcad75e9b9e1 31 void display_page3(N5110 &lcd, Gamepad &gamepad);
yangzhenye 5:fcad75e9b9e1 32 void get_output(N5110 &lcd, Gamepad &gamepad);
yangzhenye 5:fcad75e9b9e1 33 void get_input(bool start, bool back, bool x);
yangzhenye 2:baca89f466bc 34 int _output;
yangzhenye 2:baca89f466bc 35 int _state;
yangzhenye 2:baca89f466bc 36 int _input;
yangzhenye 5:fcad75e9b9e1 37 RooneyEngine _engine;
yangzhenye 2:baca89f466bc 38 };
yangzhenye 2:baca89f466bc 39 #endif
yangzhenye 2:baca89f466bc 40