nsnake
Classic snake game for the terminal
Functions | Variables
Globals Namespace Reference

All global settings to the game. More...

Functions

void init ()
 Allocates necessary variables. More...
 
void exit ()
 Warns the user about any errors and warnings found during the program's execution. More...
 
void loadFile ()
 Loads configuration from the default file name.
 
void saveFile ()
 Saves current configurations to the default file name.
 

Variables

char version [3]
 Game version (format MMP - Major Minor Patch). More...
 

Detailed Description

All global settings to the game.

Function Documentation

void Globals::exit ( )

Warns the user about any errors and warnings found during the program's execution.

Note
You must call this after finishing up nCurses, otherwise things will get messed up on the terminal.

Definition at line 143 of file Globals.cpp.

void Globals::init ( )

Allocates necessary variables.

Note
No need for Globals::exit() because the Operational System always frees the memory when quitting the program. And definitely this module will need to be accessed until the end of the program.

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 82 of file Globals.cpp.

Variable Documentation

char Globals::version
Initial value:
= { VERSION[0],
VERSION[2],
VERSION[4] }

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 13 of file Globals.cpp.