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: N5110 PinDetect PowerControl mbed
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) 00020 : State(fsm, lcd, input, sound) {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 00034 // Variables 00035 private: 00036 /// States for the main menu's internal finite state machine 00037 enum MenuState {SELECT_PLAY, SELECT_HIGHSCORES, SELECT_CONTROLS, LOAD_GAME, HIGHSCORES, CONTROLS}; 00038 00039 /// Current state of the internal finite state machine 00040 static int currentState; 00041 00042 /** Transition table for internal fsm 00043 * Each row corresponds to a state 00044 * Each column corresponds to the button pressed 00045 */ 00046 static const int MENU_FSM[6][3]; 00047 }; 00048 00049 #endif
Generated on Tue Jul 12 2022 21:59:47 by
1.7.2