diff options
author | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-06-19 01:34:07 +0530 |
---|---|---|
committer | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-06-19 14:49:13 +0530 |
commit | bdc215203d0065aa2f9f4a388644c30963a44301 (patch) | |
tree | df307fe45d2ed347f939728795d8888ea67625ee /crawl-ref/source/state.h | |
parent | 9d2d31534bf474d02f76551e9d311fd39111a4f6 (diff) | |
download | crawl-ref-bdc215203d0065aa2f9f4a388644c30963a44301.tar.gz crawl-ref-bdc215203d0065aa2f9f4a388644c30963a44301.zip |
Move Sprint saves into $SAVEDIR/sprint.
This allows the same character name to have ongoing Crawl and Sprint games
without filename collisions. I'm using a subdirectory instead of a filename
suffix (such as Foo-501-spr.chr) to avoid blowing DOS compatibility.
Add GAME_TYPE_UNSPECIFIED as the uninitialised game_type. It's synonymous with
GAME_TYPE_NORMAL, but allows the code to distinguish between a player having
chosen the main game and the player not having made a choice yet.
get_savefile_directory() returns the current savefile directory based on game
type. Direct use of Options.save_dir should be avoided in new code.
player_save_info now tracks game type as well.
Diffstat (limited to 'crawl-ref/source/state.h')
-rw-r--r-- | crawl-ref/source/state.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/crawl-ref/source/state.h b/crawl-ref/source/state.h index cbb0221f40..6c191965cf 100644 --- a/crawl-ref/source/state.h +++ b/crawl-ref/source/state.h @@ -146,13 +146,20 @@ public: void mon_gone(monsters* mon); void dump(); - bool player_is_dead(); + bool player_is_dead() const; - bool game_is_normal(); - bool game_is_tutorial(); - bool game_is_arena(); - bool game_is_sprint(); - bool game_is_hints(); + bool game_is_normal() const; + bool game_is_tutorial() const; + bool game_is_arena() const; + bool game_is_sprint() const; + bool game_is_hints() const; + + // Save subdirectory used for games such as Sprint. + std::string game_type_name() const; + std::string game_savedir_path() const; + std::string game_type_qualifier() const; + + static std::string game_type_name_for(game_type gt); friend class mon_acting; }; |