The Battle for Wesnoth
1.19.5+dev
server
common
resultsets
game_history.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2020 - 2024
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 <vector>
18
19
#include "mariadb++/result_set.hpp"
20
21
#include "
server/common/resultsets/rs_base.hpp
"
22
#include "
server/common/simple_wml.hpp
"
23
24
class
game_history
:
public
rs_base
25
{
26
struct
player
27
{
28
std::string
name
;
29
std::string
faction
;
30
};
31
32
struct
result
33
{
34
std::string
game_name
;
35
std::string
game_start
;
36
std::string
scenario_name
;
37
std::string
era_name
;
38
std::vector<player>
players
;
39
std::vector<std::string>
modification_names
;
40
std::string
replay_url
;
41
std::string
version
;
42
};
43
44
public
:
45
void
read
(mariadb::result_set_ref rslt);
46
std::unique_ptr<simple_wml::document>
to_doc
();
47
48
private
:
49
std::vector<result>
results
;
50
};
game_history
Definition:
game_history.hpp:25
game_history::read
void read(mariadb::result_set_ref rslt)
game_history::to_doc
std::unique_ptr< simple_wml::document > to_doc()
game_history::results
std::vector< result > results
Definition:
game_history.hpp:49
rs_base
Definition:
rs_base.hpp:20
rs_base.hpp
simple_wml.hpp
game_history::player
Definition:
game_history.hpp:27
game_history::player::name
std::string name
Definition:
game_history.hpp:28
game_history::player::faction
std::string faction
Definition:
game_history.hpp:29
game_history::result
Definition:
game_history.hpp:33
game_history::result::game_name
std::string game_name
Definition:
game_history.hpp:34
game_history::result::era_name
std::string era_name
Definition:
game_history.hpp:37
game_history::result::modification_names
std::vector< std::string > modification_names
Definition:
game_history.hpp:39
game_history::result::players
std::vector< player > players
Definition:
game_history.hpp:38
game_history::result::game_start
std::string game_start
Definition:
game_history.hpp:35
game_history::result::version
std::string version
Definition:
game_history.hpp:41
game_history::result::scenario_name
std::string scenario_name
Definition:
game_history.hpp:36
game_history::result::replay_url
std::string replay_url
Definition:
game_history.hpp:40
Generated by
1.9.1