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

Implementation of functions which handles the configuration file. More...

#include "config_file.h"

Go to the source code of this file.

Functions

bool existsConfigurationFile ()
 Checks by filename if a game configuration file exists.
GameConfiguration getConfigurationFromFile ()
 Load the game configuration from the file. It checks if the file exists.
void saveConfigurationToFile (GameConfiguration configuration, bool overwriteIfExists)
 Save the given configuration to the game configuration file. It overwrites an existing file if and only if overwriteIfExists is set to true.

Detailed Description

Implementation of functions which handles the configuration file.

Definition in file config_file.c.

Function Documentation

◆ existsConfigurationFile()

bool existsConfigurationFile ( )

Checks by filename if a game configuration file exists.

Returns
True if exists, false otherwise.

Definition at line 23 of file config_file.c.

◆ getConfigurationFromFile()

GameConfiguration getConfigurationFromFile ( )

Load the game configuration from the file. It checks if the file exists.

Returns
The game configuration loaded from the file, otherwise the default game configuration.

Definition at line 33 of file config_file.c.

◆ saveConfigurationToFile()

void saveConfigurationToFile ( GameConfiguration configuration,
bool overwriteIfExists )

Save the given configuration to the game configuration file. It overwrites an existing file if and only if overwriteIfExists is set to true.

Parameters
configurationThe game configuration to be saved.
overwriteIfExistsOverwriting allowed flag.

Definition at line 89 of file config_file.c.