![]() |
Conquer Chess
Chess and Starcraft combined
|
A chess square. More...
#include <square.h>
Public Member Functions | |
| square (const std::string &pos) | |
| square (const game_coordinate &g) | |
| square (const int x, const int y) | |
| Create a square from the x and y coordinate. | |
| int | get_x () const noexcept |
| Get the x coordinat, starting from 0 for a1/b1/c1/etc. | |
| int | get_y () const noexcept |
| Get the y coordinat, starting from 0 for a1/a2/a3/etc. | |
A chess square.
A chess square, e.g. e4.
@seealso a square_layout} defines the layout of a square.
|
explicit |
|
explicit |
|
explicit |
Create a square from the x and y coordinate.
For example, b7 is (6,1).
| x | the x coordinat, the index for the number of a square, starting from 0 for 1, 1 for 2, 2 for 3, etc. |
| y | the y coordinat, the index for the letter of a square, starting from 0 for a, 1 for b, 3 for cetc. |
|
inlinenoexcept |
Get the x coordinat, starting from 0 for a1/b1/c1/etc.
As the board goes from a1 at top-left, to a8 at top-right, the x coordinat is the rank
|
inlinenoexcept |
Get the y coordinat, starting from 0 for a1/a2/a3/etc.
As the board goes from a1 at top-left, to a8 at top-right, the y coordinat is the file