![]() |
Conquer Chess
Chess and Starcraft combined
|
The layout of a chess board. More...
#include <board_layout.h>
Public Member Functions | |
| board_layout (const screen_rect &r=screen_rect(screen_coordinate(0, 0), screen_coordinate(20 *8, 20 *8))) | |
| Create the layout of a board. | |
| const screen_rect & | get_board () const noexcept |
| Get the size of the entire board. | |
| const square_layout & | get_square (const int x, const int y) const |
| Get the rectangle for the square. | |
The layout of a chess board.
It fits exactly within the screen rectangle and there are no gaps or overlap between the squares
| board_layout::board_layout | ( | const screen_rect & | r = screen_rect(screen_coordinate(0, 0), screen_coordinate(20 * 8, 20 * 8)) | ) |
Create the layout of a board.
The default size is the minimum, as this makes sure that there are enough pixels for a proper display of the pieces.
|
noexcept |
Get the size of the entire board.
| const square_layout & board_layout::get_square | ( | const int | x, |
| const int | y | ||
| ) | const |
Get the rectangle for the square.
The board is set up to have white at the left.