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.
25 typedef struct _gd_caveset_data
27 GdString name; /* Name of caveset */
28 GdString description; /* Some words about the caveset */
29 GdString author; /* Author */
30 GdString difficulty; /* difficulty of the caveset, for info purposes */
31 GdString www; /* link to author's webpage */
32 GdString date; /* date of creation */
34 GString *story; /* story for the caves */
35 GString *remark; /* notes about the game */
37 GString *title_screen; /* base64-encoded title screen image */
38 GString *title_screen_scroll; /* scrolling background for title screen image */
40 GdString charset; /* these are not used by gdash */
43 /* these are only for a game. */
44 int initial_lives; /* initial lives at game start */
45 int maximum_lives; /* maximum lives */
46 int bonus_life_score; /* bonus life / number of points */
48 /* and this one the highscores */
49 GdHighScore highscore[GD_HIGHSCORE_NUM];
52 extern const GdStructDescriptor gd_caveset_properties[];
54 extern GdCavesetData *gd_caveset_data;
55 extern GList *gd_caveset;
56 extern boolean gd_caveset_edited;
57 extern int gd_caveset_last_selected;
58 extern int gd_caveset_last_selected_level;
60 extern char *gd_caveset_extensions[];
62 /* #included cavesets; configdir passed to look for .hsc file */
63 boolean gd_caveset_load_from_internal(int caveset, const char *configdir);
64 const gchar **gd_caveset_get_internal_game_names(void);
66 /* caveset load from file */
67 boolean gd_caveset_load_from_file(char *filename);
68 /* caveset save to bdcff file */
69 boolean gd_caveset_save(const char *filename);
71 /* misc caveset functions */
72 int gd_caveset_count(void);
73 void gd_caveset_clear(void);
74 GdCave *gd_return_nth_cave(const int cave);
76 GdCave *gd_get_original_cave_from_caveset(const int cave);
77 GdCave *gd_get_prepared_cave_from_caveset(const int cave, const int level);
78 GdCave *gd_get_prepared_cave(const GdCave *cave, const int level);
80 /* highscore in config directory */
81 void gd_save_highscore(const char* directory);
82 boolean gd_load_highscore(const char *directory);
84 GdCavesetData *gd_caveset_data_new(void);
85 void gd_caveset_data_free(GdCavesetData *data);
87 /* check replays and optionally remove */
88 int gd_cave_check_replays(GdCave *cave, boolean report, boolean remove, boolean repair);
90 boolean gd_caveset_has_replays(void);
92 #endif // BD_CAVESET_H