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.
Dependencies: mbed FATFileSystem
Menu/Menu.h@2:81cfa8310f55, 2019-03-20 (annotated)
- Committer:
- ellisbhastroud
- Date:
- Wed Mar 20 18:23:22 2019 +0000
- Revision:
- 2:81cfa8310f55
- Parent:
- 1:6179c2d67d19
- Child:
- 3:a8960004d261
Main menu selection developed.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ellisbhastroud | 1:6179c2d67d19 | 1 | #ifndef MENU_H |
| ellisbhastroud | 1:6179c2d67d19 | 2 | #define MENU_H |
| ellisbhastroud | 1:6179c2d67d19 | 3 | |
| ellisbhastroud | 1:6179c2d67d19 | 4 | #include "mbed.h" |
| ellisbhastroud | 1:6179c2d67d19 | 5 | #include "N5110.h" |
| ellisbhastroud | 1:6179c2d67d19 | 6 | #include "Gamepad.h" |
| ellisbhastroud | 1:6179c2d67d19 | 7 | |
| ellisbhastroud | 1:6179c2d67d19 | 8 | /** Enum for menu options */ |
| ellisbhastroud | 1:6179c2d67d19 | 9 | enum MenuChoices { |
| ellisbhastroud | 2:81cfa8310f55 | 10 | START, /**< Begin Game */ |
| ellisbhastroud | 2:81cfa8310f55 | 11 | HIGHSCORES, /**< View Highscores */ |
| ellisbhastroud | 2:81cfa8310f55 | 12 | SETTINGS, /**< View Settings */ |
| ellisbhastroud | 1:6179c2d67d19 | 13 | }; |
| ellisbhastroud | 1:6179c2d67d19 | 14 | |
| ellisbhastroud | 1:6179c2d67d19 | 15 | /** Menu Class |
| ellisbhastroud | 1:6179c2d67d19 | 16 | * @brief Library for controlling menu options |
| ellisbhastroud | 1:6179c2d67d19 | 17 | * @author Ellis Blackford Stroud |
| ellisbhastroud | 1:6179c2d67d19 | 18 | * @date May, 2018 |
| ellisbhastroud | 1:6179c2d67d19 | 19 | */ |
| ellisbhastroud | 1:6179c2d67d19 | 20 | |
| ellisbhastroud | 1:6179c2d67d19 | 21 | class Menu { |
| ellisbhastroud | 1:6179c2d67d19 | 22 | |
| ellisbhastroud | 1:6179c2d67d19 | 23 | public: |
| ellisbhastroud | 1:6179c2d67d19 | 24 | |
| ellisbhastroud | 1:6179c2d67d19 | 25 | /** Constructor */ |
| ellisbhastroud | 1:6179c2d67d19 | 26 | Menu(); |
| ellisbhastroud | 1:6179c2d67d19 | 27 | |
| ellisbhastroud | 1:6179c2d67d19 | 28 | /** Destructor */ |
| ellisbhastroud | 1:6179c2d67d19 | 29 | ~Menu(); |
| ellisbhastroud | 1:6179c2d67d19 | 30 | |
| ellisbhastroud | 1:6179c2d67d19 | 31 | /** Prints opening message */ |
| ellisbhastroud | 1:6179c2d67d19 | 32 | void print_welcome(N5110 &lcd); |
| ellisbhastroud | 1:6179c2d67d19 | 33 | |
| ellisbhastroud | 1:6179c2d67d19 | 34 | /** Prints menu screen */ |
| ellisbhastroud | 1:6179c2d67d19 | 35 | void print_menu(N5110 &lcd); |
| ellisbhastroud | 1:6179c2d67d19 | 36 | |
| ellisbhastroud | 2:81cfa8310f55 | 37 | /** Prints highscore screen */ |
| ellisbhastroud | 2:81cfa8310f55 | 38 | void print_highscores(N5110 &lcd); |
| ellisbhastroud | 2:81cfa8310f55 | 39 | |
| ellisbhastroud | 2:81cfa8310f55 | 40 | /** Prints settings screen */ |
| ellisbhastroud | 2:81cfa8310f55 | 41 | void print_settings(N5110 &lcd); |
| ellisbhastroud | 2:81cfa8310f55 | 42 | |
| ellisbhastroud | 2:81cfa8310f55 | 43 | /** Prints start screen */ |
| ellisbhastroud | 2:81cfa8310f55 | 44 | void print_start(N5110 &lcd); |
| ellisbhastroud | 2:81cfa8310f55 | 45 | |
| ellisbhastroud | 2:81cfa8310f55 | 46 | |
| ellisbhastroud | 2:81cfa8310f55 | 47 | /** Updates and returns menu choice |
| ellisbhastroud | 2:81cfa8310f55 | 48 | * @returns an enum: START, HIGHSCORES, SETTINGS |
| ellisbhastroud | 2:81cfa8310f55 | 49 | */ |
| ellisbhastroud | 2:81cfa8310f55 | 50 | MenuChoices menu_choice(MenuChoices menu, Gamepad &pad, N5110 &lcd); |
| ellisbhastroud | 2:81cfa8310f55 | 51 | |
| ellisbhastroud | 2:81cfa8310f55 | 52 | |
| ellisbhastroud | 1:6179c2d67d19 | 53 | private: |
| ellisbhastroud | 1:6179c2d67d19 | 54 | |
| ellisbhastroud | 1:6179c2d67d19 | 55 | }; |
| ellisbhastroud | 1:6179c2d67d19 | 56 | |
| ellisbhastroud | 1:6179c2d67d19 | 57 | #endif |