![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: MenuClasses/Settings/Settings.h
- Revision:
- 89:8fbb0405a916
- Parent:
- 84:9950d561fdf8
- Child:
- 91:ca8cff78f2fe
diff -r 1e2e70a484e7 -r 8fbb0405a916 MenuClasses/Settings/Settings.h --- a/MenuClasses/Settings/Settings.h Wed May 08 18:20:23 2019 +0000 +++ b/MenuClasses/Settings/Settings.h Wed May 08 19:05:30 2019 +0000 @@ -5,70 +5,59 @@ #include "N5110.h" #include "Gamepad.h" +/** Settings Class +@brief Class for selecting "Game comfort parameters" like brightness, contrast, control speeds and also features an hide option for credits. +@author Ahmed N.Adamjee +@date 8th May 2019 +*/ class Settings { public: + /** Constructor */ Settings(); + /** Destructor */ ~Settings(); - /** Initialise Settings - * - * This function passes the pointers to the settings class so that it can control the screen and the gamepad. + /** Gets pointers of lcd and pad from int main() and initialises variables used in the class. + * @param pointer to the N5110 object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function. + * @param pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function. */ void init(N5110 *lcd, Gamepad *pad); - /** Implement Settings - * - * This function is used to configure settings. - */ - float * Implement(float cs); + /** + * @brief Used to select between various settings functions using user input. + * @param controlSensitivity is the value that determines the wait time between performing menu tasks. + * @return values of controlSensitivity and showCredits are saved in an array called cs_sc which is returned to the StartScreen class as a pointer. + */ + float * Implement(float controlSensitivity); - /** Info - * - * This function shows the info for using settings. - */ + /** Shows the information for using settings.*/ void info(); - /** Call Functions - * - * This function calls respective settings menu as per the contol entries by the user. + /** Calls the respective settings menu as per the joystick entry by the user. + * @param settingsIndex is the value that is used to select the relevant settings page. */ - void CallFunctions(int st); + void CallFunctions(int settingsIndex); - /** controlSensitivity - * - * This function essentialy enables the user to select the sensitivity of the game controls - */ + /** Enables the user to select the sensitivity of the game controls and saves it in cs_sc[0]*/ void controlSensitivity(); - /** brigntness - * - * This function allows the user to set the screen brightness. - */ + /** Allows the user to set the screen brightness.*/ void brigntness(); - /** contrast - * - * This function allows the user to set the contrast of the screen. - */ + /** Allows the user to set the contrast of the screen.*/ void contrast(); - /** volume - * - * This function allows the user to set the volume of the speaker. - */ + /** Allows the user to set the volume of the speaker.*/ void volume(); - /** showCredits - * - * This function allows the user to hide/show credits. - */ + /** Allows the user to hide/show credits.*/ void showCredits(); private: float cs_sc[2]; //this array helps to return Control speeds and Show credits parameters. - + int settingsIndex; //an index for selecting from settings functions. //Pointer to the game pad object pad. Gamepad *_pad; //Pointer to the N5110 object lcd.