The Battle for Wesnoth  1.15.7+dev
game_classification.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
3  Part of the Battle for Wesnoth Project https://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 #pragma once
16 
17 #include "utils/make_enum.hpp"
18 
19 #include <vector>
20 #include <set>
21 
22 class config;
23 
24 /// The default difficulty setting for campaigns.
25 extern const std::string DEFAULT_DIFFICULTY;
26 
27 //meta information of the game
29 {
30 public:
31  game_classification() = default;
32  explicit game_classification(const config& cfg);
33 
34  config to_config() const;
35  std::string get_tagname() const;
36  bool is_normal_mp_game() const;
37  std::set<std::string> active_addons(const std::string& scenario_id) const;
38 
39  std::string label; /**< Name of the game (e.g. name of save file). */
40  std::string version; /**< Version game was created with. */
41  MAKE_ENUM (CAMPAIGN_TYPE, /**< Type of the game - campaign, multiplayer etc. */
42  (SCENARIO, "scenario")
43  (MULTIPLAYER, "multiplayer")
44  (TEST, "test")
45  (TUTORIAL, "tutorial")
46  )
47  CAMPAIGN_TYPE campaign_type;
48  std::string campaign_define; /**< If there is a define the campaign uses to customize data */
49  std::vector<std::string> campaign_xtra_defines; /**< more customization of data */
50  std::string scenario_define; /**< If there is a define the scenario uses to customize data */
51  std::string era_define; /**< If there is a define the era uses to customize data */
52  std::vector<std::string> mod_defines; /**< If there are defines the modifications use to customize data */
53 
54  std::vector<std::string> active_mods;
55  std::string era_id;
56 
57  std::string campaign; /**< The id of the campaign being played */
58  std::string campaign_name; /**< The name of the campaign being played. */
59 
60  std::string abbrev; /**< the campaign abbreviation */
61  bool end_credits = true; /**< whether to show the standard credits at the end */
62  std::string end_text; /**< end-of-campaign text */
63  unsigned int end_text_duration; /**< for how long the end-of-campaign text is shown */
64  std::string difficulty = DEFAULT_DIFFICULTY; /**< The difficulty level the game is being played on. */
65  std::string random_mode = "";
66  bool oos_debug = false;
67 };
unsigned int end_text_duration
for how long the end-of-campaign text is shown
bool end_credits
whether to show the standard credits at the end
std::string label
Name of the game (e.g.
std::string campaign_name
The name of the campaign being played.
const std::string DEFAULT_DIFFICULTY
The default difficulty setting for campaigns.
STL namespace.
std::set< std::string > active_addons(const std::string &scenario_id) const
std::vector< std::string > active_mods
std::string campaign_define
If there is a define the campaign uses to customize data.
std::string end_text
end-of-campaign text
std::string campaign
The id of the campaign being played.
std::string era_define
If there is a define the era uses to customize data.
std::string abbrev
the campaign abbreviation
std::vector< std::string > campaign_xtra_defines
more customization of data
std::string scenario_define
If there is a define the scenario uses to customize data.
std::vector< std::string > mod_defines
If there are defines the modifications use to customize data.
game_classification()=default
std::string difficulty
The difficulty level the game is being played on.
MAKE_ENUM(CAMPAIGN_TYPE,(SCENARIO, "scenario")(MULTIPLAYER, "multiplayer")(TEST, "test")(TUTORIAL, "tutorial")) CAMPAIGN_TYPE campaign_type
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:68
Defines the MAKE_ENUM macro.
std::string get_tagname() const
std::string version
Version game was created with.