A chess move.
More...
#include <chess_move.h>
A chess move.
A chess move, e.g. 'e4'.
- Note
- This called is called
chess_move instead of move to avoid conflicts with ‘std::move’`.
◆ chess_move()
Moves always happen on a board.
◆ get_action_type()
| const auto & chess_move::get_action_type |
( |
| ) |
const |
|
inlinenoexcept |
The type of action this move is.
◆ get_castling_type()
| const auto & chess_move::get_castling_type |
( |
| ) |
const |
|
inlinenoexcept |
Get the castling type.
Will be empty if this move is not a promotion
◆ get_color()
| const auto & chess_move::get_color |
( |
| ) |
const |
|
inlinenoexcept |
Get the color of the player that did this move.
◆ get_from()
| const auto & chess_move::get_from |
( |
| ) |
const |
|
inlinenoexcept |
Get the source/from square, e.g.
'b1' in 'Pc3'.
Result will be empty when winning (e.g. '1-0')
◆ get_pgn_str()
| const auto & chess_move::get_pgn_str |
( |
| ) |
const |
|
inlinenoexcept |
Get the original PGN string back.
◆ get_piece_type()
| const auto & chess_move::get_piece_type |
( |
| ) |
const |
|
inlinenoexcept |
The type of chess piece.
Result will be empty when castling (e.g. 'O-O') or winning (e.g. '1-0')
◆ get_promotion_type()
| const auto & chess_move::get_promotion_type |
( |
| ) |
const |
|
inlinenoexcept |
Get the promotion type.
Will be empty if this move is not a promotion
◆ get_to()
| const auto & chess_move::get_to |
( |
| ) |
const |
|
inlinenoexcept |
Get the target square, e.g.
'e4' in 'Pxe4'. Result will be empty when castling (e.g. 'O-O') or winning (e.g. '1-0')
- See also
- use the free function get_from} to determine the square where the pieces comes from
◆ get_winner()
| const auto & chess_move::get_winner |
( |
| ) |
const |
|
inlinenoexcept |
Get the winner.
- If this is empty, the game is still on-going.
- If this has 1 element, that color is the winner.
- If this has 2 elements, the game ended in a draw.
◆ is_capture()
| bool chess_move::is_capture |
( |
| ) |
const |
|
inlinenoexcept |
Is this move a capture? E.g.
'Qxf7' is a capture
The documentation for this class was generated from the following files: