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@26:0dc10374546f, 2019-04-23 (annotated)
- Committer:
- JamesCummins
- Date:
- Tue Apr 23 23:55:05 2019 +0000
- Revision:
- 26:0dc10374546f
- Parent:
- 25:b52aa23df120
- Child:
- 35:138ad0faa42b
Big array for classic mode's map [200x500] approx 55% complete
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 | 26:0dc10374546f | 38 | void read_bb_high_scores(); |
| 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 | 26:0dc10374546f | 44 | int _bbarray[5]; |
| JamesCummins | 22:4e305ff8a050 | 45 | |
| JamesCummins | 22:4e305ff8a050 | 46 | }; |
| JamesCummins | 22:4e305ff8a050 | 47 | #endif |