20100212
[gdash.git] / src / caveset.h
blob577519ee82057abd75962efebf23def214f648a4
1 /*
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.
16 #ifndef _GD_CAVESET_H
17 #define _GD_CAVESET_H
19 #include <glib.h>
20 #include "cave.h"
22 typedef struct _gd_caveset_data {
23 GdString name; /* Name of caveset */
24 GdString description; /* Some words about the caveset */
25 GdString author; /* Author */
26 GdString difficulty; /* difficulty of the caveset, for info purposes */
27 GdString www; /* link to author's webpage */
28 GdString date; /* date of creation */
30 GString *story; /* story for the caves */
31 GString *remark; /* notes about the game */
33 GString *title_screen; /* base64-encoded title screen image */
34 GString *title_screen_scroll; /* scrolling background for title screen image */
36 GdString charset; /* these are not used by gdash */
37 GdString fontset;
39 /* these are only for a game. */
40 int initial_lives; /* initial lives at game start */
41 int maximum_lives; /* maximum lives */
42 int bonus_life_score; /* bonus life / number of points */
44 /* and this one the highscores */
45 GdHighScore highscore[GD_HIGHSCORE_NUM];
46 } GdCavesetData;
48 extern const GdStructDescriptor gd_caveset_properties[];
50 extern GdCavesetData *gd_caveset_data;
51 extern GList *gd_caveset;
52 extern gboolean gd_caveset_edited;
53 extern int gd_caveset_last_selected;
54 extern int gd_caveset_last_selected_level;
56 extern char *gd_caveset_extensions[];
58 /* #included cavesets; configdir passed to look for .hsc file */
59 gboolean gd_caveset_load_from_internal(int caveset, const char *configdir);
60 const gchar **gd_caveset_get_internal_game_names();
62 /* caveset load from file; configdir passed to look for .hsc file */
63 gboolean gd_caveset_load_from_file(const char *filename, const char *configdir);
64 /* caveset save to bdcff file */
65 gboolean gd_caveset_save(const char *filename);
67 /* misc caveset functions */
68 int gd_caveset_count(void);
69 void gd_caveset_clear(void);
70 GdCave *gd_return_nth_cave(const int cave);
71 GdCave *gd_cave_new_from_caveset(const int cave, const int level, guint32 seed);
73 /* highscore in config directory */
74 void gd_save_highscore(const char* directory);
75 gboolean gd_load_highscore(const char *directory);
77 GdCavesetData *gd_caveset_data_new();
78 void gd_caveset_data_free(GdCavesetData *data);
80 /* check replays and optionally remove */
81 int gd_cave_check_replays(GdCave *cave, gboolean report, gboolean remove, gboolean repair);
83 gboolean gd_caveset_has_replays();
86 #endif /* _CAVESET_H */