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