Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
square_layout.h
Go to the documentation of this file.
1#ifndef SQUARE_LAYOUT_H
2#define SQUARE_LAYOUT_H
3
4#include "race.h"
5#include "screen_rect.h"
6
61{
62public:
63
64 square_layout(const screen_rect& square_rect = screen_rect(screen_coordinate(0, 0), screen_coordinate(20, 20)));
65
67 const screen_rect& get_square() const noexcept { return m_square; }
68
70 const screen_rect& get_health_bar_outline() const noexcept { return m_health_bar; }
71
73 screen_rect get_health_bar_value(const double f, const race r = race::classic) const;
74
76 screen_rect get_shield_bar_value(const double f) const;
77
78 const screen_rect& get_piece() const noexcept { return m_piece; }
79 const screen_rect& get_is_protected() const noexcept { return m_is_protected; }
80
81private:
82
83
84 screen_rect m_health_bar;
85 screen_rect m_is_protected;
86 screen_rect m_piece;
87 screen_rect m_square;
88};
89
91
92#endif // SQUARE_LAYOUT_H
The coordinate on a screen.
Definition screen_coordinate.h:12
A rectangle-shaped area on the screen.
Definition screen_rect.h:15
The layout of a square.
Definition square_layout.h:61
const screen_rect & get_piece() const noexcept
Definition square_layout.h:78
const screen_rect & get_health_bar_outline() const noexcept
The outline of the health bar.
Definition square_layout.h:70
const screen_rect & get_is_protected() const noexcept
Definition square_layout.h:79
screen_rect get_shield_bar_value(const double f) const
The shield bar value, a bar within the lower half of the outline of the health bar.
Definition square_layout.cpp:58
screen_rect get_health_bar_value(const double f, const race r=race::classic) const
The health bar value, a bar within the outline of the health bar.
Definition square_layout.cpp:49
const screen_rect & get_square() const noexcept
The full square.
Definition square_layout.h:67
race
The chess race.
Definition race.h:10
@ classic
void test_piece_layout()
Definition square_layout.cpp:67