Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (1.44 KB)

1
#ifndef SCOREBOARD_H_INCLUDED
2
#define SCOREBOARD_H_INCLUDED
3

    
4
/**
5
 * @defgroup scoreboards scoreboards
6
 * @ingroup proj
7
 * @brief Scoreboards module.
8
 *
9
 * @{
10
 */
11

    
12
#include "libs.h"
13
#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   p       Pointer to highscores
48
 * @param   path    Path to file to be written
49
 */
50
void (highscores_save)(const highscores_t *p, const char *path);
51
/**
52
 * @brief Destruct menu.
53
 * @param   p   Pointer to menu to destruct
54
 */
55
void (highscores_dtor)(highscores_t *p);
56

    
57
/**
58
 * @}
59
 */
60

    
61

    
62
#endif /* end of include guard: SCOREBOARD_H_INCLUDED */