Ikenna Adrian Ozoemena 201157039
Dependencies: mbed
Menu/Menu.h@53:3fdc4486f672, 2019-05-09 (annotated)
- Committer:
- ikenna1
- Date:
- Thu May 09 14:52:52 2019 +0000
- Revision:
- 53:3fdc4486f672
- Parent:
- 51:2231e2e141b9
Final Submission
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ikenna1 | 9:241a1a7d8527 | 1 | #ifndef MENU_H |
ikenna1 | 9:241a1a7d8527 | 2 | #define MENU_H |
ikenna1 | 9:241a1a7d8527 | 3 | |
ikenna1 | 9:241a1a7d8527 | 4 | #include "mbed.h" |
ikenna1 | 9:241a1a7d8527 | 5 | #include "N5110.h" |
ikenna1 | 9:241a1a7d8527 | 6 | #include "Gamepad.h" |
ikenna1 | 44:a6a361bea806 | 7 | #include "Ship.h" |
ikenna1 | 9:241a1a7d8527 | 8 | |
ikenna1 | 45:fe5fc85a5c73 | 9 | /** Menu Class |
ikenna1 | 45:fe5fc85a5c73 | 10 | @brief Library for displaying menu screen |
ikenna1 | 45:fe5fc85a5c73 | 11 | @author Ozoemena Adrian Ikenna |
ikenna1 | 45:fe5fc85a5c73 | 12 | @date 8th May 2019 |
ikenna1 | 45:fe5fc85a5c73 | 13 | */ |
ikenna1 | 9:241a1a7d8527 | 14 | class Menu |
ikenna1 | 9:241a1a7d8527 | 15 | { |
ikenna1 | 9:241a1a7d8527 | 16 | public: |
ikenna1 | 45:fe5fc85a5c73 | 17 | /** constructor */ |
ikenna1 | 9:241a1a7d8527 | 18 | Menu(); |
ikenna1 | 45:fe5fc85a5c73 | 19 | /** deconstructor */ |
ikenna1 | 9:241a1a7d8527 | 20 | ~Menu(); |
ikenna1 | 9:241a1a7d8527 | 21 | |
ikenna1 | 45:fe5fc85a5c73 | 22 | /** A mutator method that initializes the cursor used to select options in the menu |
ikenna1 | 47:5ae8668af63f | 23 | *@param ycursor the yposition of the rectangle used as a cursor |
ikenna1 | 45:fe5fc85a5c73 | 24 | */ |
ikenna1 | 9:241a1a7d8527 | 25 | void init(int ycursor); |
ikenna1 | 45:fe5fc85a5c73 | 26 | /** Displays the title screen and changes the displayed ship based on ship selected |
ikenna1 | 51:2231e2e141b9 | 27 | *@param &lcd address of the N5110 library used for the lcd display |
ikenna1 | 47:5ae8668af63f | 28 | *@param shipUsed a variable of enum SHIP which contains the ship currently being used |
ikenna1 | 45:fe5fc85a5c73 | 29 | */ |
ikenna1 | 44:a6a361bea806 | 30 | void title(N5110 &lcd, SHIP shipUsed); |
ikenna1 | 45:fe5fc85a5c73 | 31 | /** A mutator method that updates the x and y cursor values based on joystick movemnt |
ikenna1 | 47:5ae8668af63f | 32 | *@param d the current direction of the joystick |
ikenna1 | 47:5ae8668af63f | 33 | *@param joystick a 2D vector of the x and y joystick value |
ikenna1 | 45:fe5fc85a5c73 | 34 | */ |
ikenna1 | 45:fe5fc85a5c73 | 35 | void update(Direction d,Vector2D joystick); |
ikenna1 | 45:fe5fc85a5c73 | 36 | /** Accessor method to get tthe current ycursor position used to select options |
ikenna1 | 45:fe5fc85a5c73 | 37 | *from the menu |
ikenna1 | 45:fe5fc85a5c73 | 38 | *@returns the ycursor value |
ikenna1 | 45:fe5fc85a5c73 | 39 | */ |
ikenna1 | 13:e114d362186d | 40 | int get_ycursor(); |
ikenna1 | 45:fe5fc85a5c73 | 41 | /** Accessor method to get the current xcursor position used to select a ship |
ikenna1 | 45:fe5fc85a5c73 | 42 | *in the ship section of the menu |
ikenna1 | 45:fe5fc85a5c73 | 43 | *@returns the xcursor value |
ikenna1 | 45:fe5fc85a5c73 | 44 | */ |
ikenna1 | 13:e114d362186d | 45 | int get_xcursor(); |
ikenna1 | 45:fe5fc85a5c73 | 46 | /** Displays the ship in the menu home screen |
ikenna1 | 51:2231e2e141b9 | 47 | *@param &lcd address of the N5110 library used for the lcd display |
ikenna1 | 45:fe5fc85a5c73 | 48 | */ |
ikenna1 | 12:47578eb9ea73 | 49 | void disp_ships(N5110 &lcd); |
ikenna1 | 9:241a1a7d8527 | 50 | //void Menu::scroll(N5110 &lcd, Direction d); |
ikenna1 | 9:241a1a7d8527 | 51 | |
ikenna1 | 9:241a1a7d8527 | 52 | private: |
ikenna1 | 45:fe5fc85a5c73 | 53 | //_______________Private-Variables__________________________________________ |
ikenna1 | 51:2231e2e141b9 | 54 | int _xcursor; // the x_cursor used in ship select |
ikenna1 | 51:2231e2e141b9 | 55 | int _ycursor; // the y cursor used in main menu |
ikenna1 | 12:47578eb9ea73 | 56 | |
ikenna1 | 9:241a1a7d8527 | 57 | |
ikenna1 | 9:241a1a7d8527 | 58 | }; |
ikenna1 | 9:241a1a7d8527 | 59 | #endif |