nsnake
Classic snake game for the terminal
|
Container for global settings on the game. More...
Functions | |
void | init () |
Initializes global variables with default values. More... | |
void | loadFile () |
Loads global variables from the default file. More... | |
void | saveFile () |
Loads global variables to the default file. More... | |
void | warnErrors () |
Warns the user about any errors and warnings found during the program's execution. More... | |
Variables | |
char | version [3] |
Game version (format MMP - Major Minor Patch). More... | |
Container for global settings on the game.
It holds all global variables, properly initializing their default values.
Global variables are spread across inner namespaces.
Make sure to follow this order:
Globals::init(); Globals::loadFile(); // Run your game... Globals::saveFile(); Globals::exit();
void Globals::init | ( | ) |
Initializes global variables with default values.
HACK Initializing the default level file directory. I know this is hacky, but couldn't find another way to initialize it.
Making sure they both exist...!
Definition at line 78 of file Globals.cpp.
void Globals::loadFile | ( | ) |
Loads global variables from the default file.
Check Globals::Config::file
for its filename.
Definition at line 141 of file Globals.cpp.
void Globals::saveFile | ( | ) |
Loads global variables to the default file.
Check Globals::Config::file
for its filename.
Definition at line 262 of file Globals.cpp.
void Globals::warnErrors | ( | ) |
Warns the user about any errors and warnings found during the program's execution.
Definition at line 371 of file Globals.cpp.
char Globals::version |
Game version (format MMP - Major Minor Patch).
On the Makefile we define a constant VERSION which is a string like "2.0.8". It contains the current game version on MAJOR.MINOR.PATCH format.
This variable contains the same info, but without the dots.
Definition at line 15 of file Globals.cpp.