From d1d83d7e7f5e2e7cbef5272eda9c580129e301a3 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 11 Mar 2012 20:45:14 +0200 Subject: World selection box in main menu (and random fixing) --- src/subgame.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/subgame.h') diff --git a/src/subgame.h b/src/subgame.h index ba2f235ed..1daeb8b15 100644 --- a/src/subgame.h +++ b/src/subgame.h @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include +#include struct SubgameSpec { @@ -47,7 +48,32 @@ SubgameSpec findSubgame(const std::string &id); std::set getAvailableGameIds(); -std::string getWorldGameId(const std::string &world_path); +std::string getWorldGameId(const std::string &world_path, + bool can_be_legacy=false); + +struct WorldSpec +{ + std::string path; + std::string name; + std::string gameid; + + WorldSpec( + const std::string &path_="", + const std::string &name_="", + const std::string &gameid_="" + ): + path(path_), + name(name_), + gameid(gameid_) + {} + + bool isValid() const + { + return (name != "" && path != "" && gameid != ""); + } +}; + +std::vector getAvailableWorlds(); #endif -- cgit v1.2.3