James Cummins / Mbed 2 deprecated el17jnc

Dependencies:   mbed

Options_Engine/OptionsEngine.h

Committer:
JamesCummins
Date:
2019-04-18
Revision:
23:61fa82f76808
Parent:
22:4e305ff8a050
Child:
24:c6415cc74b17

File content as of revision 23:61fa82f76808:

#ifndef OPTIONSENGINE_H
#define OPTIONSENGINE_H

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

enum Option{
    BRIGHTNESS,
    BALL_SPEED,
    HIGH_SCORES
    };

struct OptionSelection{
    int output;
    Option next_state[3];
    };
    
class OptionsEngine {

public:
    OptionsEngine();    //constructor
    ~OptionsEngine();   //destructor
    void init();        //initialiser
    void options_menu(Gamepad &gamepad, N5110 &lcd, Ball &ball);
    void change_brightness(Gamepad &gamepad, N5110 &lcd);
    void change_ball_speed(Gamepad &gamepad, N5110 &lcd, Ball &ball);

private:
    void display_options(N5110 &lcd);
    Option option_selection(Gamepad &gamepad, N5110 &lcd);
    void read_brightness_input(Gamepad &gamepad);
    void read_ball_speed_input(Gamepad &gamepad);
    Option _state;
    int _next_state;
    float _brightness;
    int _ball_speed;
    
};
#endif