Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
game_statistics_widget_layout.h
Go to the documentation of this file.
1#ifndef GAME_STATISTICS_WIDGET_LAYOUT_H
2#define GAME_STATISTICS_WIDGET_LAYOUT_H
3
4#include "screen_rect.h"
5#include "side.h"
7
8#include <map>
39{
40public:
41
43
44 const screen_rect& get_background() const noexcept { return m_background; }
45
47 const screen_rect& get_symbol(const game_statistic_type s) const { return m_symbol.at(s); }
48
52 const screen_rect& get_relative(const game_statistic_type s) const { return m_relative.at(s); }
53
57 const screen_rect& get_absolute(const game_statistic_type s, const side player_side) const noexcept { return m_absolute.at(s).at(player_side); }
58
59private:
60
62 screen_rect m_background;
63
65 std::map<game_statistic_type, std::map<side, screen_rect>> m_absolute;
66
68 std::map<game_statistic_type, screen_rect> m_relative;
69
71 std::map<game_statistic_type, screen_rect> m_symbol;
72};
73
74int get_height(const game_statistics_widget_layout& layout) noexcept;
75
76int get_width(const game_statistics_widget_layout& layout) noexcept;
77
79
80#endif // GAME_STATISTICS_WIDGET_LAYOUT_H
The layout of the widget that displays the in-game statistics.
Definition game_statistics_widget_layout.h:39
const screen_rect & get_background() const noexcept
Definition game_statistics_widget_layout.h:44
const screen_rect & get_relative(const game_statistic_type s) const
Get the rectangle where the relative statistics are shown.
Definition game_statistics_widget_layout.h:52
const screen_rect & get_symbol(const game_statistic_type s) const
Get the symbol for a statistic.
Definition game_statistics_widget_layout.h:47
const screen_rect & get_absolute(const game_statistic_type s, const side player_side) const noexcept
Get the rectangle where, per player, the absolute value of a statistic is shown.
Definition game_statistics_widget_layout.h:57
The coordinate on a screen.
Definition screen_coordinate.h:12
A rectangle-shaped area on the screen.
Definition screen_rect.h:15
game_statistic_type
Definition game_statistic_type.h:9
int get_height(const game_statistics_widget_layout &layout) noexcept
Definition game_statistics_widget_layout.cpp:89
void test_game_info_layout()
Definition game_statistics_widget_layout.cpp:99
int get_width(const game_statistics_widget_layout &layout) noexcept
Definition game_statistics_widget_layout.cpp:94
side
The side the player/piece is on.
Definition side.h:11