2 * Copyright (c) 2007, 2008, 2009, Czirkos Zoltan <cirix@fw.hu>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 typedef struct _gd_caveset_data
25 GdString name; /* Name of caveset */
26 GdString description; /* Some words about the caveset */
27 GdString author; /* Author */
28 GdString difficulty; /* difficulty of the caveset, for info purposes */
29 GdString www; /* link to author's webpage */
30 GdString date; /* date of creation */
32 char *story; /* story for the caves */
33 char *remark; /* notes about the game */
35 char *title_screen; /* base64-encoded title screen image */
36 char *title_screen_scroll; /* scrolling background for title screen image */
38 GdString charset; /* these are not used by gdash */
41 /* these are only for a game. */
42 int initial_lives; /* initial lives at game start */
43 int maximum_lives; /* maximum lives */
44 int bonus_life_score; /* bonus life / number of points */
46 /* and this one the highscores */
47 GdHighScore highscore[GD_HIGHSCORE_NUM];
50 extern const GdStructDescriptor gd_caveset_properties[];
52 extern GdCavesetData *gd_caveset_data;
53 extern List *gd_caveset;
54 extern boolean gd_caveset_edited;
55 extern int gd_caveset_last_selected;
56 extern int gd_caveset_last_selected_level;
58 extern char *gd_caveset_extensions[];
60 /* #included cavesets; configdir passed to look for .hsc file */
61 boolean gd_caveset_load_from_internal(int caveset, const char *configdir);
62 const char **gd_caveset_get_internal_game_names(void);
64 /* caveset load from file */
65 boolean gd_caveset_load_from_file(char *filename);
66 /* caveset save to bdcff file */
67 boolean gd_caveset_save(const char *filename);
69 /* misc caveset functions */
70 int gd_caveset_count(void);
71 void gd_caveset_clear(void);
72 GdCave *gd_return_nth_cave(const int cave);
74 GdCave *gd_get_original_cave_from_caveset(const int cave);
75 GdCave *gd_get_prepared_cave_from_caveset(const int cave, const int level);
76 GdCave *gd_get_prepared_cave(const GdCave *cave, const int level);
78 /* highscore in config directory */
79 void gd_save_highscore(const char* directory);
80 boolean gd_load_highscore(const char *directory);
82 GdCavesetData *gd_caveset_data_new(void);
83 void gd_caveset_data_free(GdCavesetData *data);
85 /* check replays and optionally remove */
86 int gd_cave_check_replays(GdCave *cave, boolean report, boolean remove, boolean repair);
88 boolean gd_caveset_has_replays(void);
90 #endif // BD_CAVESET_H