Project

General

Profile

Statistics
| Revision:

root / proj / project / include / scoreboards.h @ 357

History | View | Annotate | Download (1.39 KB)

1 348 up20180655
#ifndef SCOREBOARD_H_INCLUDED
2
#define SCOREBOARD_H_INCLUDED
3
4
/**
5 353 up20180642
 * @defgroup scoreboards scoreboards
6 357 up20180642
 * @ingroup proj
7 353 up20180642
 * @brief Scoreboards module.
8 348 up20180655
 *
9
 * @{
10
 */
11
12 353 up20180642
#include "libs.h"
13 348 up20180655
#include <stdint.h>
14
15
/**
16
 * @brief Score.
17
 */
18
typedef struct  score_info score_info_t;
19
20
/**
21
 * @brief Table of highscores.
22
 */
23
typedef struct highscores highscores_t;
24
/**
25
 * @brief Construct score.
26
 * @param   score           Game score.
27
 * @param   time_played     Time elapsed on game.
28
 * @return      Pointer to constructed score, or NULL if failed.
29
 */
30
score_info_t* (score_ctor)(int score, int time_played);
31
32
/**
33
 * @brief Destruct score.
34
 * @param   p   Pointer to score to destruct
35
 */
36
void (score_dtor)(score_info_t *p);
37
38
/**
39
 * @brief Construct highscores.
40
 * @param   fnt     Font to use when rendering highscores text
41
 * @param   path    Path to file to be read with highscores values.
42
 * @return      Pointer to constructed highscores, or NULL if failed.
43
 */
44
highscores_t* (highscores_ctor)(const font_t *fnt, const char *path);
45
/**
46
 * @brief Save highscore into file.
47
 * @param f     Path to file to be written
48
 */
49
void (highscores_save)(const highscores_t *p, const char *path);
50
/**
51
 * @brief Destruct menu.
52
 * @param   p   Pointer to menu to destruct
53
 */
54
void (highscores_dtor)(highscores_t *p);
55
56 353 up20180642
/**
57
 * @}
58
 */
59 348 up20180655
60
61
#endif /* end of include guard: SCOREBOARD_H_INCLUDED */