ELEC2645 (2018/19) / Mbed 2 deprecated el17lw

Dependencies:   mbed

Menu/Menu.h

Committer:
lewisgw
Date:
2019-04-16
Revision:
20:a8cad4e044ea
Parent:
13:bcf6bb69c597
Child:
21:20478f086bc2

File content as of revision 20:a8cad4e044ea:

/** 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 "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, bool x);
  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);
  void play_tone(Gamepad &gamepad);
  void play_tune_a(Gamepad &gamepad);
  void play_tune_b(Gamepad &gamepad);
  
  int _menu_input;
  EngineController _controller;
  bool _button;
  int _state;
  int _output;
  bool _tone_flag;
  int _tone_counter;
  int _tune_counter;
};
#endif