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 N5110 ShiftReg PinDetect
MainMenu.h
00001 #ifndef MAIN_MENU_H 00002 #define MAIN_MENU_H 00003 00004 /** @file MainMenu.h 00005 * @author Andreas Garmannslund 00006 * @date April 2015 00007 */ 00008 00009 #include "State.h " 00010 #include "Global.h" 00011 #include <string> 00012 #include <sstream> 00013 00014 /// State: Main Menu 00015 class MainMenu : public State 00016 { 00017 public: 00018 /// Creates a new MainMenu object 00019 MainMenu(StateManager* fsm, N5110 *lcd, InputManager* input, Sound *sound, ShiftReg *shiftreg) 00020 : State(fsm, lcd, input, sound, shiftreg) {init();} 00021 00022 /// Update logic 00023 virtual void update(float dt); 00024 00025 /// Draw MainMenu to screen 00026 virtual void render(); 00027 00028 private: 00029 void init(); 00030 static void btnAPress(); // Interrupt callback function when button A is pressed 00031 static void btnBPress(); // Interrupt callback function when button B is pressed 00032 static void btnCPress(); // Interrupt callback function when button C is pressed 00033 static void btnDPress(); // Interrupt callback function when button D is pressed 00034 00035 // Variables 00036 private: 00037 /// States for the main menu's internal finite state machine 00038 enum MenuState {SELECT_PLAY, SELECT_HIGHSCORES, SELECT_CONTROLS, LOAD_GAME, HIGHSCORES, CONTROLS}; 00039 00040 /// Current state of the internal finite state machine 00041 static int currentState; 00042 00043 /** Transition table for internal fsm 00044 * Each row corresponds to a state 00045 * Each column corresponds to the button pressed 00046 */ 00047 static const int MENU_FSM[6][3]; 00048 }; 00049 00050 #endif
Generated on Tue Jul 12 2022 21:30:55 by
