The Battle for Wesnoth  1.15.12+dev
game_history.hpp
Go to the documentation of this file.
1 /*
2  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12 */
13 
14 #pragma once
15 
16 #include <vector>
17 
18 #include "mariadb++/result_set.hpp"
19 
22 
23 class game_history : public rs_base
24 {
25  struct player
26  {
27  std::string name;
28  std::string faction;
29  };
30 
31  struct result
32  {
33  std::string game_name;
34  int reload;
35  std::string game_start;
36  std::string scenario_name;
37  std::string scenario_id;
38  std::string era_name;
39  std::string era_id;
40  std::vector<player> players;
41  std::vector<std::string> modification_names;
42  std::vector<std::string> modification_ids;
43  std::string replay_url;
44  };
45 
46  public:
47  void read(mariadb::result_set_ref rslt);
48  std::unique_ptr<simple_wml::document> to_doc();
49 
50  private:
51  std::vector<result> results;
52 };
void read(mariadb::result_set_ref rslt)
std::string game_start
std::vector< player > players
std::vector< std::string > modification_names
std::vector< result > results
std::vector< std::string > modification_ids
std::string replay_url
std::string scenario_name
std::unique_ptr< simple_wml::document > to_doc()
std::string scenario_id