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@24:c6415cc74b17, 2019-04-19 (annotated)
- Committer:
- JamesCummins
- Date:
- Fri Apr 19 11:16:19 2019 +0000
- Revision:
- 24:c6415cc74b17
- Parent:
- 23:61fa82f76808
- Child:
- 25:b52aa23df120
Started on SD card use to generate High scores menus
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| JamesCummins | 22:4e305ff8a050 | 1 | #ifndef OPTIONSENGINE_H |
| JamesCummins | 22:4e305ff8a050 | 2 | #define OPTIONSENGINE_H |
| JamesCummins | 22:4e305ff8a050 | 3 | |
| JamesCummins | 22:4e305ff8a050 | 4 | #include "mbed.h" |
| JamesCummins | 22:4e305ff8a050 | 5 | #include "Gamepad.h" |
| JamesCummins | 22:4e305ff8a050 | 6 | #include "N5110.h" |
| JamesCummins | 22:4e305ff8a050 | 7 | #include "Ball.h" |
| JamesCummins | 24:c6415cc74b17 | 8 | #include "Pause.h" |
| JamesCummins | 24:c6415cc74b17 | 9 | #include "SDFileSystem.h" |
| JamesCummins | 22:4e305ff8a050 | 10 | |
| JamesCummins | 22:4e305ff8a050 | 11 | enum Option{ |
| JamesCummins | 22:4e305ff8a050 | 12 | BRIGHTNESS, |
| JamesCummins | 22:4e305ff8a050 | 13 | BALL_SPEED, |
| JamesCummins | 22:4e305ff8a050 | 14 | HIGH_SCORES |
| JamesCummins | 22:4e305ff8a050 | 15 | }; |
| JamesCummins | 22:4e305ff8a050 | 16 | |
| JamesCummins | 22:4e305ff8a050 | 17 | struct OptionSelection{ |
| JamesCummins | 22:4e305ff8a050 | 18 | int output; |
| JamesCummins | 22:4e305ff8a050 | 19 | Option next_state[3]; |
| JamesCummins | 22:4e305ff8a050 | 20 | }; |
| JamesCummins | 24:c6415cc74b17 | 21 | |
| JamesCummins | 22:4e305ff8a050 | 22 | class OptionsEngine { |
| JamesCummins | 22:4e305ff8a050 | 23 | |
| JamesCummins | 22:4e305ff8a050 | 24 | public: |
| JamesCummins | 22:4e305ff8a050 | 25 | OptionsEngine(); //constructor |
| JamesCummins | 22:4e305ff8a050 | 26 | ~OptionsEngine(); //destructor |
| JamesCummins | 22:4e305ff8a050 | 27 | void init(); //initialiser |
| JamesCummins | 24:c6415cc74b17 | 28 | void options_menu(Gamepad &gamepad, N5110 &lcd, Ball &ball, SDFileSystem &sd); |
| JamesCummins | 22:4e305ff8a050 | 29 | void change_brightness(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 23:61fa82f76808 | 30 | void change_ball_speed(Gamepad &gamepad, N5110 &lcd, Ball &ball); |
| JamesCummins | 24:c6415cc74b17 | 31 | void view_high_scores(Gamepad &gamepad, N5110 &lcd, SDFileSystem &sd); |
| JamesCummins | 22:4e305ff8a050 | 32 | |
| JamesCummins | 22:4e305ff8a050 | 33 | private: |
| JamesCummins | 22:4e305ff8a050 | 34 | void display_options(N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 35 | Option option_selection(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 36 | void read_brightness_input(Gamepad &gamepad); |
| JamesCummins | 23:61fa82f76808 | 37 | void read_ball_speed_input(Gamepad &gamepad); |
| JamesCummins | 24:c6415cc74b17 | 38 | void print_high_scores(N5110 &lcd, SDFileSystem &sd); |
| JamesCummins | 22:4e305ff8a050 | 39 | Option _state; |
| JamesCummins | 22:4e305ff8a050 | 40 | int _next_state; |
| JamesCummins | 22:4e305ff8a050 | 41 | float _brightness; |
| JamesCummins | 22:4e305ff8a050 | 42 | int _ball_speed; |
| JamesCummins | 24:c6415cc74b17 | 43 | Mode _leaderboard; |
| JamesCummins | 22:4e305ff8a050 | 44 | |
| JamesCummins | 22:4e305ff8a050 | 45 | }; |
| JamesCummins | 22:4e305ff8a050 | 46 | #endif |