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

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

#include "cli.h"
#include "config_file.h"

Go to the source code of this file.

Macros

#define _CONFIG_H_
 Include guard.

Functions

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.
GameConfiguration askConfigurationOptionsViaTerminal ()
 Asks to the user via terminal the game configuration.

Detailed Description

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

Definition in file config.h.

Macro Definition Documentation

◆ _CONFIG_H_

#define _CONFIG_H_

Include guard.

Definition at line 26 of file config.h.

Function Documentation

◆ askConfigurationOptionsViaTerminal()

GameConfiguration askConfigurationOptionsViaTerminal ( )

Asks to the user via terminal the game configuration.

Returns
The game configuration asked via terminal.

Definition at line 148 of file main.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.