Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
game_statistics.h
Go to the documentation of this file.
1#ifndef GAME_STATISTICS_H
2#define GAME_STATISTICS_H
3
4#include "ccfwd.h"
6#include "chess_color.h"
7#include "side.h"
8
9#include <map>
10
13{
14public:
16 game_statistics(const std::map<game_statistic_type, std::map<side, double>>& s);
17
27 double calc_relative(const game_statistic_type s) const;
28
29 double get(const game_statistic_type stat, const side s) const;
30
31private:
32 std::map<game_statistic_type, std::map<side, double>> m_statistics;
33};
34
37
45std::vector<double> flatten_to_row(const game_statistics& s);
46
54std::vector<std::string> get_column_headers() noexcept;
55
57double get_f_active(
58 const std::vector<piece>& pieces,
59 const chess_color c
60);
61
63double get_f_protected(
64 const std::vector<piece>& pieces,
65 const chess_color c
66);
67
69double get_f_value(
70 const std::vector<piece>& pieces,
71 const chess_color c
72);
73
74
76
77#endif // GAME_STATISTICS_H
chess_color
A chess piece color.
Definition chess_color.h:10
The class that acts as a controller for game}.
Definition game_controller.h:31
The statistics of a point in time of the game.
Definition game_statistics.h:13
double calc_relative(const game_statistic_type s) const
Calculate the relative value between the two players for a statistic, where 0.5 denotes 'equally much...
Definition game_statistics.cpp:28
double get(const game_statistic_type stat, const side s) const
Definition game_statistics.cpp:69
A chess piece.
Definition piece.h:24
game_statistic_type
Definition game_statistic_type.h:9
std::vector< std::string > get_column_headers() noexcept
Put the values in a row, to be saved to a file.
Definition game_statistics.cpp:74
double get_f_protected(const std::vector< piece > &pieces, const chess_color c)
Get the fraction of pieces that is protected by another.
Definition game_statistics.cpp:105
game_statistics create_test_game_statistics()
Create a game statistics to be used in testing.
Definition game_statistics.cpp:42
double get_f_active(const std::vector< piece > &pieces, const chess_color c)
Get the fraction of pieces that is doing an action.
Definition game_statistics.cpp:87
void test_game_statistics()
Definition game_statistics.cpp:134
std::vector< double > flatten_to_row(const game_statistics &s)
Put the values in a row, to be saved to a file.
Definition game_statistics.cpp:55
double get_f_value(const std::vector< piece > &pieces, const chess_color c)
Get the fraction of the current pieces' value from the maximum.
Definition game_statistics.cpp:122
side
The side the player/piece is on.
Definition side.h:11