The Battle for Wesnoth  1.15.0+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 
21 class config;
22 
23 /// The default difficulty setting for campaigns.
24 extern const std::string DEFAULT_DIFFICULTY;
25 
26 //meta information of the game
28 {
29 public:
30  game_classification() = default;
31  explicit game_classification(const config& cfg);
32 
33  config to_config() const;
34  std::string get_tagname() const;
35  bool is_normal_mp_game() const;
36 
37  std::string label; /**< Name of the game (e.g. name of save file). */
38  std::string version; /**< Version game was created with. */
39  MAKE_ENUM (CAMPAIGN_TYPE, /**< Type of the game - campaign, multiplayer etc. */
40  (SCENARIO, "scenario")
41  (MULTIPLAYER, "multiplayer")
42  (TEST, "test")
43  (TUTORIAL, "tutorial")
44  )
45  CAMPAIGN_TYPE campaign_type;
46  std::string campaign_define; /**< If there is a define the campaign uses to customize data */
47  std::vector<std::string> campaign_xtra_defines; /**< more customization of data */
48  std::string scenario_define; /**< If there is a define the scenario uses to customize data */
49  std::string era_define; /**< If there is a define the era uses to customize data */
50  std::vector<std::string> mod_defines; /**< If there are defines the modifications use to customize data */
51 
52  std::string campaign; /**< The id of the campaign being played */
53  std::string campaign_name; /**< The name of the campaign being played. */
54 
55  std::string abbrev; /**< the campaign abbreviation */
56  bool end_credits = true; /**< whether to show the standard credits at the end */
57  std::string end_text; /**< end-of-campaign text */
58  unsigned int end_text_duration; /**< for how long the end-of-campaign text is shown */
59  std::string difficulty = DEFAULT_DIFFICULTY; /**< The difficulty level the game is being played on. */
60  std::string random_mode = "";
61  bool oos_debug = false;
62 };
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::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:92
Defines the MAKE_ENUM macro.
std::string get_tagname() const
std::string version
Version game was created with.