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@35:138ad0faa42b, 2019-05-04 (annotated)
- Committer:
- JamesCummins
- Date:
- Sat May 04 18:56:38 2019 +0000
- Revision:
- 35:138ad0faa42b
- Parent:
- 26:0dc10374546f
- Child:
- 37:de1f584bce71
High scores working, just a few finishing touches required now
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 | 25:b52aa23df120 | 28 | void display_options(N5110 &lcd); |
| JamesCummins | 25:b52aa23df120 | 29 | Option option_selection(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 30 | void change_brightness(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 23:61fa82f76808 | 31 | void change_ball_speed(Gamepad &gamepad, N5110 &lcd, Ball &ball); |
| JamesCummins | 26:0dc10374546f | 32 | void view_high_scores(Gamepad &gamepad, N5110 &lcd); |
| JamesCummins | 22:4e305ff8a050 | 33 | |
| JamesCummins | 22:4e305ff8a050 | 34 | private: |
| JamesCummins | 22:4e305ff8a050 | 35 | void read_brightness_input(Gamepad &gamepad); |
| JamesCummins | 23:61fa82f76808 | 36 | void read_ball_speed_input(Gamepad &gamepad); |
| JamesCummins | 26:0dc10374546f | 37 | void print_high_scores(N5110 &lcd); |
| JamesCummins | 35:138ad0faa42b | 38 | void read_classic_high_scores(); |
| JamesCummins | 26:0dc10374546f | 39 | void read_bb_high_scores(); |
| JamesCummins | 22:4e305ff8a050 | 40 | Option _state; |
| JamesCummins | 22:4e305ff8a050 | 41 | int _next_state; |
| JamesCummins | 22:4e305ff8a050 | 42 | float _brightness; |
| JamesCummins | 22:4e305ff8a050 | 43 | int _ball_speed; |
| JamesCummins | 24:c6415cc74b17 | 44 | Mode _leaderboard; |
| JamesCummins | 35:138ad0faa42b | 45 | int _classic_index[6]; |
| JamesCummins | 35:138ad0faa42b | 46 | float _classic_values[6]; |
| JamesCummins | 35:138ad0faa42b | 47 | int _bb_index[6]; |
| JamesCummins | 35:138ad0faa42b | 48 | float _bb_values[6]; |
| JamesCummins | 22:4e305ff8a050 | 49 | |
| JamesCummins | 22:4e305ff8a050 | 50 | }; |
| JamesCummins | 22:4e305ff8a050 | 51 | #endif |