a proposition for #81
[neverball] / ball / set.h
1 #ifndef SET_H
2 #define SET_H
3
4 #include "base_config.h"
5 #include "level.h"
6
7 /*---------------------------------------------------------------------------*/
8
9 #define SET_FILE "sets.txt"
10 #define MAXSET 16
11 #define MAXLVL 25
12
13 /* A pack of levels */
14 struct set
15 {
16     /* set global info */
17     int number;               /* number of the set */
18
19     char file[PATHMAX];
20
21     char user_scores[PATHMAX]; /* user highscore file */
22     char setname[MAXSTR];     /* internal set name */
23
24     char name[MAXSTR];        /* set name */
25     char desc[MAXSTR];        /* set description */
26     char shot[MAXSTR];        /* screenshot image file*/
27
28     struct score time_score;  /* challenge score */
29     struct score coin_score;  /* challenge score */
30
31     /* levels info */
32
33     int count;                /* number of levels */
34     int locked;               /* number of locked levels */
35     int completed;            /* number of completed levels */
36
37     /* levels */
38     
39     struct level level_v[MAXLVL];
40 };
41
42 /*---------------------------------------------------------------------------*/
43
44 void set_init();
45
46 int  set_exists(int);
47 const struct set *get_set(int);
48
49 /*---------------------------------------------------------------------------*/
50
51 int  set_unlocked(const struct set *);
52 int  set_completed(const struct set *);
53
54 int  set_level_exists(const struct set *, int);
55
56 /*---------------------------------------------------------------------------*/
57
58 void set_goto(int i);
59 const struct set *curr_set(void);
60
61 const struct level *get_level(int);
62
63 /*---------------------------------------------------------------------------*/
64
65 void set_finish_level(struct level_game *, const char *);
66 void score_change_name(struct level_game *, const char *);
67
68 /*---------------------------------------------------------------------------*/
69
70 void level_snap(int);
71
72 void set_cheat(void);
73
74 /*---------------------------------------------------------------------------*/
75
76 #endif