The Battle for Wesnoth  1.15.12+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 <string>
20 #include <vector>
21 
22 class config;
23 class game_config_view;
24 
25 namespace about
26 {
28 {
29  struct about_group
30  {
31  explicit about_group(const config& cfg);
32 
33  /** Contributor names. */
34  std::vector<std::pair<std::string, std::string>> names;
35 
36  /** The section title. */
38 
39  bool operator<(const about_group& o) const;
40  };
41 
42  credits_group(const config& cfg, bool is_campaign_credits);
43 
44  /** The group's sub-groups. Corresponds to each [about] tag .*/
45  std::vector<about_group> sections;
46 
47  /** Optional group ID. Currently only used for identifying campaigns. */
48  std::string id;
49 
50  /** Optional group tite. Currently only used for identifying campaigns. */
52 };
53 
54 using credits_data = std::vector<credits_group>;
55 
56 /** Gets all credits data. */
58 
59 /** Gets credits for a given campaign. */
60 credits_data::const_iterator get_campaign_credits(const std::string& campaign);
61 
62 /** Gets credit background images for a given campaaign. */
63 std::vector<std::string> get_background_images(const std::string& campaign);
64 
65 /** Regenerates the credits data. */
66 void set_about(const game_config_view& cfg);
67 
68 } // namespace about
t_string title
The section title.
Definition: about.hpp:37
credits_data::const_iterator get_campaign_credits(const std::string &campaign)
Gets credits for a given campaign.
Definition: about.cpp:99
const credits_data & get_credits_data()
Gets all credits data.
Definition: about.cpp:94
std::vector< about_group > sections
The group&#39;s sub-groups.
Definition: about.hpp:45
std::vector< std::string > get_background_images(const std::string &campaign)
Gets credit background images for a given campaaign.
Definition: about.cpp:105
Display credits about all contributors.
std::vector< credits_group > credits_data
Definition: about.hpp:54
std::vector< std::pair< std::string, std::string > > names
Contributor names.
Definition: about.hpp:34
void set_about(const game_config_view &cfg)
Regenerates the credits data.
Definition: about.cpp:114
credits_group(const config &cfg, bool is_campaign_credits)
Definition: about.cpp:47
about_group(const config &cfg)
Definition: about.cpp:78
std::string id
Optional group ID.
Definition: about.hpp:48
bool operator<(const about_group &o) const
Definition: about.cpp:89
t_string header
Optional group tite.
Definition: about.hpp:51
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:59