ELEC2645 (2018/19) / Mbed 2 deprecated el17lw

Dependencies:   mbed

Menu/Menu.h

Committer:
lewisgw
Date:
2019-04-01
Revision:
12:ebaefda53dd0
Parent:
11:b66170249a26
Child:
13:bcf6bb69c597

File content as of revision 12:ebaefda53dd0:

/** Menu Class
* @breif Class to control the overall state of the game * @author Lewis Wooltorton
* @date April 2019
*/

#ifndef MENU_H
#define MENU_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
//#include "Engine.h"
#include "EngineController.h"

struct State {
  int output;
  int next_state[4];
};

class Menu {
 public:
  Menu();
  ~Menu();
  
  void init();
  void run(N5110 &lcd, Gamepad &gamepad);
  
 private:
  void set_input(bool start, bool back);
  void run_game(N5110 &lcd, Gamepad &gamepad);
  void display_menu(N5110 &lcd, Gamepad &gamepad);
  void display_controls(N5110 &lcd, Gamepad &gamepad);
  void output(N5110 &lcd, Gamepad &gamepad);
  
  int _menu_input;
  EngineController _controller;
  bool _button;
  int _state;
  int _output;
};
#endif