Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Options_Engine/OptionsEngine.h
- Committer:
- JamesCummins
- Date:
- 2019-05-04
- Revision:
- 35:138ad0faa42b
- Parent:
- 26:0dc10374546f
- Child:
- 37:de1f584bce71
File content as of revision 35:138ad0faa42b:
#ifndef OPTIONSENGINE_H
#define OPTIONSENGINE_H
#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include "Ball.h"
#include "Pause.h"
#include "SDFileSystem.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 display_options(N5110 &lcd);
Option option_selection(Gamepad &gamepad, N5110 &lcd);
void change_brightness(Gamepad &gamepad, N5110 &lcd);
void change_ball_speed(Gamepad &gamepad, N5110 &lcd, Ball &ball);
void view_high_scores(Gamepad &gamepad, N5110 &lcd);
private:
void read_brightness_input(Gamepad &gamepad);
void read_ball_speed_input(Gamepad &gamepad);
void print_high_scores(N5110 &lcd);
void read_classic_high_scores();
void read_bb_high_scores();
Option _state;
int _next_state;
float _brightness;
int _ball_speed;
Mode _leaderboard;
int _classic_index[6];
float _classic_values[6];
int _bb_index[6];
float _bb_values[6];
};
#endif