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

Definition of logger functions. More...

#include "main.h"
#include "includes.h"

Go to the source code of this file.

Macros

#define _LOGS_H_
 Include guard.

Functions

LogsConfiguration prepareLogs ()
 Generates the logger configuration for the current session. Tries to generate the log file.
void printGameConfiguration (GameConfiguration gameConfiguration, LogsConfiguration logsConfiguration, bool newLine)
 Prints user-friendly game configuration settings.
void printPlayers (Game game, bool newLine)
 Prints user-friendly the players' infos.
void printPlayer (Player player, LogsConfiguration logsConfiguration, bool newLine)
 Prints user-friendly player's info.
void printCard (Card card, LogsConfiguration logsConfiguration, bool newLine)
 Prints user-friendly the card rank and suit.
void printDeck (Card *deck, LogsConfiguration logsConfiguration, bool newLine)
 Prints user-friendly the cards deck.
void printPageData (PageData pages[], LogsConfiguration logsConfiguration, int totalPages, bool newLine)
 Prints user-friendly the pages' infos.

Detailed Description

Definition of logger functions.

Definition in file logs.h.

Macro Definition Documentation

◆ _LOGS_H_

#define _LOGS_H_

Include guard.

Definition at line 26 of file logs.h.

Function Documentation

◆ prepareLogs()

LogsConfiguration prepareLogs ( )

Generates the logger configuration for the current session. Tries to generate the log file.

Returns
The logger configuration to use.

Definition at line 26 of file logs.c.

◆ printCard()

void printCard ( Card card,
LogsConfiguration logsConfiguration,
bool newLine )

Prints user-friendly the card rank and suit.

Parameters
cardThe card that has to be printed.
logsConfigurationThe logs configuration.
newLineFlag for determining if the function has to go to a new line before exiting. Differently from the behaviour of the other functions, this value is not ignored if the logger is not using the console.

Definition at line 112 of file logs.c.

◆ printDeck()

void printDeck ( Card * deck,
LogsConfiguration logsConfiguration,
bool newLine )

Prints user-friendly the cards deck.

Parameters
deckThe deck that has to be printed.
logsConfigurationThe logs configuration.
newLineFlag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated.

Definition at line 172 of file logs.c.

◆ printGameConfiguration()

void printGameConfiguration ( GameConfiguration gameConfiguration,
LogsConfiguration logsConfiguration,
bool newLine )

Prints user-friendly game configuration settings.

Parameters
gameConfigurationThe game configuration that has to be printed.
logsConfigurationThe logs configuration.
newLineFlag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated.

Definition at line 53 of file logs.c.

◆ printPageData()

void printPageData ( PageData pages[],
LogsConfiguration logsConfiguration,
int totalPages,
bool newLine )

Prints user-friendly the pages' infos.

Parameters
pagesAn array of structures containing informations about each page.
logsConfigurationThe logs configuration.
totalPagesThe amount of page structures in the array.
newLineFlag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated.

Definition at line 177 of file logs.c.

◆ printPlayer()

void printPlayer ( Player player,
LogsConfiguration logsConfiguration,
bool newLine )

Prints user-friendly player's info.

Parameters
playerThe player whose infos have to be printed.
logsConfigurationThe logs configuration.
newLineFlag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated.

Definition at line 81 of file logs.c.

◆ printPlayers()

void printPlayers ( Game game,
bool newLine )

Prints user-friendly the players' infos.

Parameters
gameThe game which cointains the players.
newLineFlag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated.

Definition at line 76 of file logs.c.