The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mp_game_settings.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by Jörg Hinrichs
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /** @file */
16 
17 #ifndef MP_GAME_SETTINGS_HPP_INCLUDED
18 #define MP_GAME_SETTINGS_HPP_INCLUDED
19 
20 #include "config.hpp"
21 #include "gettext.hpp"
22 #include "utils/make_enum.hpp"
23 #include "version.hpp"
24 
25 #include <boost/optional.hpp>
26 
28 {
30  mp_game_settings(const config& cfg);
31 
32  config to_config() const;
33 
34  // The items returned while configuring the game
35 
43  std::vector<std::string> active_mods;
44  std::map<std::string, std::string> side_users;
45 
47 
48  int num_turns;
59  bool fog_game;
64 
65  bool saved_game;
66 
67  MAKE_ENUM(RANDOM_FACTION_MODE,
68  (DEFAULT, N_("Independent"))
69  (NO_MIRROR, N_("No Mirror"))
70  (NO_ALLY_MIRROR, N_("No Ally Mirror"))
71  )
72 
73  RANDOM_FACTION_MODE random_faction_mode;
74 
76 
78  boost::optional<version_info> version;
79  boost::optional<version_info> min_version;
80 
81  explicit addon_version_info(const config &);
82  void write(config &) const;
83  };
84 
85  std::map<std::string, addon_version_info> addons; // the key is the addon_id
86 
87  // Takes a config with addon metadata (id =, version =, min_version =), formatted similarly to how mp_game_settings is written that is,
88  // and adds this as a requirement, updating the min_version if there was already an entry for this addon_id.
89  void update_addon_requirements(const config & addon_cfg);
90 };
91 
92 #endif
boost::optional< version_info > version
std::string mp_scenario
std::string random_faction_mode()
config to_config() const
std::string mp_campaign
boost::optional< version_info > min_version
Definitions for the interface to Wesnoth Markup Language (WML).
std::string mp_scenario_name
MAKE_ENUM(RANDOM_FACTION_MODE,(DEFAULT, N_("Independent"))(NO_MIRROR, N_("No Mirror"))(NO_ALLY_MIRROR, N_("No Ally Mirror"))) RANDOM_FACTION_MODE random_faction_mode
std::vector< std::string > active_mods
void update_addon_requirements(const config &addon_cfg)
std::map< std::string, addon_version_info > addons
#define N_(String)
Definition: gettext.hpp:90
std::map< std::string, std::string > side_users
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
Interfaces for manipulating version numbers of engine, add-ons, etc.
void write(std::ostream &out, configr_of const &cfg, unsigned int level)
Definition: parser.cpp:621
Defines the MAKE_ENUM macro.
GLsizei const GLcharARB ** string
Definition: glew.h:4503