1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Cleanup ClientLauncher structure (#10160)

Remove duplicated variables and unify the startup data into a new (inherited) struct.
This commit is contained in:
SmallJoker 2020-07-14 19:10:37 +02:00 committed by GitHub
parent 2bec83eec0
commit 4fa1e03f68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 197 additions and 200 deletions

View file

@ -23,10 +23,29 @@ with this program; if not, write to the Free Software Foundation, Inc.,
struct SubgameSpec;
// Information provided from "main"
struct GameParams
{
GameParams() = default;
u16 socket_port;
std::string world_path;
SubgameSpec game_spec;
bool is_dedicated_server;
};
// Information processed by main menu
struct GameStartData : GameParams
{
GameStartData() = default;
bool isSinglePlayer() const { return address.empty() && !local_server; }
std::string name;
std::string password;
std::string address;
bool local_server;
// "world_path" must be kept in sync!
WorldSpec world_spec;
};