The Battle for Wesnoth  1.15.1+dev
about.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 "tstring.hpp"
18 
19 #include <vector>
20 #include <string>
21 
22 class config;
23 
24 namespace about
25 {
27 {
28  struct about_group
29  {
30  explicit about_group(const config& cfg);
31 
32  /** Contributor names. */
33  std::vector<std::string> names;
34 
35  /** The section title. */
37 
38  bool operator<(const about_group& o) const;
39  };
40 
41  credits_group(const config& cfg, bool is_campaign_credits);
42 
43  /** The group's sub-groups. Corresponds to each [about] tag .*/
44  std::vector<about_group> sections;
45 
46  /** Optional group ID. Currently only used for identifying campaigns. */
47  std::string id;
48 
49  /** Optional group tite. Currently only used for identifying campaigns. */
51 };
52 
53 using credits_data = std::vector<credits_group>;
54 
55 /**
56  * General getter methods for the credits config and image lists by campaign id
57  */
59 
60 std::vector<std::string> get_background_images(const std::string& campaign);
61 
62 /**
63  * Regenerates the credits config
64  */
65 void set_about(const config& cfg);
66 
67 }
t_string title
The section title.
Definition: about.hpp:36
const credits_data & get_credits_data()
General getter methods for the credits config and image lists by campaign id.
Definition: about.cpp:92
std::vector< about_group > sections
The group&#39;s sub-groups.
Definition: about.hpp:44
std::vector< std::string > get_background_images(const std::string &campaign)
Definition: about.cpp:97
Display credits about all contributors.
std::vector< credits_group > credits_data
Definition: about.hpp:53
credits_group(const config &cfg, bool is_campaign_credits)
Definition: about.cpp:45
std::vector< std::string > names
Contributor names.
Definition: about.hpp:33
about_group(const config &cfg)
Definition: about.cpp:76
std::string id
Optional group ID.
Definition: about.hpp:47
bool operator<(const about_group &o) const
Definition: about.cpp:87
void set_about(const config &cfg)
Regenerates the credits config.
Definition: about.cpp:106
t_string header
Optional group tite.
Definition: about.hpp:50
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:92