Ben Evans University Second Year Project. Game Called Defender.
SavedGames Class Reference
SavedGames class. More...
#include <SavedGames.h>
Inherits SDErrors.
Public Member Functions | |
| SavedGames () | |
| Constructor. | |
| ~SavedGames () | |
| Destructor. | |
| void | init () |
| Initialises SavedGames. | |
| void | add_saved_data (SDFileSystem &sd, SavedGamesData data, N5110 &lcd) |
| Adds saved data to sd card. | |
| SavedGamesData | read_saved_data (SDFileSystem &sd, N5110 &lcd) |
| Reads saved data from sd card and return it as a struct. | |
| void | saved_games_scroll (Direction d_) |
| Scrolls through the different saved games parts. | |
| void | display_saved_games (N5110 &lcd) |
| Draws the saved game screen. | |
| void | save_game_screen (N5110 &lcd) |
| Draws the select save game select screen. | |
| void | run_save_test (SDFileSystem &sd, N5110 &lcd) |
| Runs the save test unit test. | |
| int | get_display_data_number () |
| Gets the displayed saved game number. | |
| bool | get_error () |
| Gets error flag. | |
| void | set_error (bool error) |
| Set error. | |
Protected Attributes | |
| bool | error_ |
| Flag for error,. | |
Detailed Description
SavedGames class.
Stores saved games on sd card, stores score, lives, smart bombs and number of current alliens
- Date:
- May 2020
Definition at line 24 of file SavedGames.h.
Constructor & Destructor Documentation
| SavedGames | ( | ) |
Constructor.
Definition at line 3 of file SavedGames.cpp.
| ~SavedGames | ( | ) |
Destructor.
Definition at line 7 of file SavedGames.cpp.
Member Function Documentation
| void add_saved_data | ( | SDFileSystem & | sd, |
| SavedGamesData | data, | ||
| N5110 & | lcd | ||
| ) |
Adds saved data to sd card.
- Parameters:
-
sd sd card object data SavedGamesData struct lcd N5110 object
Definition at line 104 of file SavedGames.cpp.
| void display_saved_games | ( | N5110 & | lcd ) |
Draws the saved game screen.
- Parameters:
-
lcd N5110 object
Definition at line 173 of file SavedGames.cpp.
| int get_display_data_number | ( | ) |
Gets the displayed saved game number.
- Returns:
- display_data_number_;
Definition at line 227 of file SavedGames.cpp.
| bool get_error | ( | ) | [inherited] |
| void init | ( | ) |
Initialises SavedGames.
Definition at line 67 of file SavedGames.cpp.
| SavedGamesData read_saved_data | ( | SDFileSystem & | sd, |
| N5110 & | lcd | ||
| ) |
Reads saved data from sd card and return it as a struct.
- Parameters:
-
sd sd card object lcd N5110 object
- Returns:
- data
SavedGamesData struct
Definition at line 137 of file SavedGames.cpp.
| void run_save_test | ( | SDFileSystem & | sd, |
| N5110 & | lcd | ||
| ) |
Runs the save test unit test.
- Parameters:
-
lcd N5110 object sd sd card object
Definition at line 47 of file SavedGames.cpp.
| void save_game_screen | ( | N5110 & | lcd ) |
Draws the select save game select screen.
- Parameters:
-
lcd N5110 object
Definition at line 190 of file SavedGames.cpp.
| void saved_games_scroll | ( | Direction | d_ ) |
Scrolls through the different saved games parts.
- Parameters:
-
d_ Direction of joystick
Definition at line 207 of file SavedGames.cpp.
| void set_error | ( | bool | error ) | [inherited] |
Field Documentation
bool error_ [protected, inherited] |
Generated on Fri Aug 5 2022 06:55:08 by
1.7.2