root / proj / include / scoreboards.h @ 352
History | View | Annotate | Download (1.37 KB)
1 | 348 | up20180655 | #ifndef SCOREBOARD_H_INCLUDED
|
---|---|---|---|
2 | #define SCOREBOARD_H_INCLUDED
|
||
3 | |||
4 | /**
|
||
5 | * @defgroup proj_structures proj_structures
|
||
6 | * @brief Project structures.
|
||
7 | *
|
||
8 | * @{
|
||
9 | */
|
||
10 | |||
11 | #include <stdint.h> |
||
12 | #include "font.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 | |||
56 | |||
57 | |||
58 | #endif /* end of include guard: SCOREBOARD_H_INCLUDED */ |