Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Public Member Functions | List of all members
board_layout Class Reference

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_rectget_board () const noexcept
 Get the size of the entire board.
 
const square_layoutget_square (const int x, const int y) const
 Get the rectangle for the square.
 

Detailed Description

The layout of a chess board.

It fits exactly within the screen rectangle and there are no gaps or overlap between the squares

Constructor & Destructor Documentation

◆ board_layout()

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.

Member Function Documentation

◆ get_board()

const screen_rect & board_layout::get_board ( ) const
noexcept

Get the size of the entire board.

◆ get_square()

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.

  • (0,0) is a1
  • (7,0) is a8
  • (0,7) is h1
  • (7,7) is h8

The documentation for this class was generated from the following files: