Survival Royale 1.0.0
A very simple yet funny card game.
Loading...
Searching...
No Matches
config.c File Reference

Implementation of functions which retrieves the game configuration from the possible sources. More...

#include "config.h"

Go to the source code of this file.

Functions

GameConfiguration getDefaultConfiguration ()
 Retrieves the default game configuration.
bool isDefaultGameConfiguration (const GameConfiguration config)
 Determines if a given game configuration is the default one.
GameConfiguration getGameConfiguration (const int code, const GameConfiguration cliGameConfiguration)
 Gets the game configuration based on the action code. If action code is ACTION_HELP, the program exits successfully. If the program is asked to save the game configuration to a file, it overwrites by default the existing game configuration file.

Detailed Description

Implementation of functions which retrieves the game configuration from the possible sources.

Definition in file config.c.

Function Documentation

◆ getDefaultConfiguration()

GameConfiguration getDefaultConfiguration ( )

Retrieves the default game configuration.

Returns
The default game configuration.

Definition at line 23 of file config.c.

◆ getGameConfiguration()

GameConfiguration getGameConfiguration ( const int code,
const GameConfiguration cliGameConfiguration )

Gets the game configuration based on the action code. If action code is ACTION_HELP, the program exits successfully. If the program is asked to save the game configuration to a file, it overwrites by default the existing game configuration file.

Parameters
codeThe action code.
cliGameConfigurationThe possible CLI game configuration.
Returns
The game configuration that the game will use.

Definition at line 46 of file config.c.

◆ isDefaultGameConfiguration()

bool isDefaultGameConfiguration ( const GameConfiguration config)

Determines if a given game configuration is the default one.

Parameters
configThe game configuration to compare.
Returns
True if the given game configuration is the default one, false otherwise.

Definition at line 36 of file config.c.