![]() |
Conquer Chess
Chess and Starcraft combined
|
#include "chess_move.h"#include "game.h"#include "fen_string.h"#include <cassert>#include <iostream>#include <regex>
Functions | |
| bool | is_capture (const pgn_move_string &s) |
| Conclude if the move is a capture from a PGN string E.g. | |
| std::optional< square > | get_from (const fen_string &g, const pgn_move_string &m) |
| Get the square the piece doing the move came from, if any. | |
| square | get_from_for_bishop (const fen_string &s, const pgn_move_string &m) |
| Get the square the bishop doing the move came from. | |
| square | get_from_for_king (const fen_string &s, const pgn_move_string &m) |
| Get the square the king doing the move came from. | |
| square | get_from_for_knight (const fen_string &s, const pgn_move_string &m) |
| Get the square the knight doing the move came from. | |
| square | get_from_for_pawn (const fen_string &s, const pgn_move_string &m) |
| Get the square the pawn doing the move came from. | |
| square | get_from_for_queen (const fen_string &s, const pgn_move_string &m) |
| Get the square the queen doing the move came from. | |
| square | get_from_for_rook (const fen_string &s, const pgn_move_string &m) |
| Get the square the rook doing the move came from. | |
| bool | is_capture (const chess_move &move) noexcept |
| Get if the move is a capture. | |
| bool | is_castling (const chess_move &move) noexcept |
| Get if the move is a castling. | |
| bool | is_draw (const chess_move &move) noexcept |
| Get if the move is a win. | |
| bool | is_promotion (const chess_move &move) noexcept |
| Get if the move is a promotion. | |
| bool | is_simple_move (const chess_move &move) noexcept |
| Get if the move is a move, i.e. | |
| bool | is_win (const chess_move &move) noexcept |
| Get if the move is a win. | |
| void | test_chess_move () |
| Test this class and its free functions. | |
| bool | operator== (const chess_move &lhs, const chess_move &rhs) noexcept |
| std::ostream & | operator<< (std::ostream &os, const chess_move &m) noexcept |
| std::optional< square > get_from | ( | const fen_string & | s, |
| const pgn_move_string & | m | ||
| ) |
Get the square the piece doing the move came from, if any.
Even with, e.g., castling, it is the king at e1 that needed to be selected to do that move
| square get_from_for_bishop | ( | const fen_string & | s, |
| const pgn_move_string & | m | ||
| ) |
Get the square the bishop doing the move came from.
| square get_from_for_king | ( | const fen_string & | s, |
| const pgn_move_string & | m | ||
| ) |
Get the square the king doing the move came from.
Even with, e.g., castling for white, it is the king at e1 that needed to be selected to do that move
| square get_from_for_knight | ( | const fen_string & | s, |
| const pgn_move_string & | m | ||
| ) |
Get the square the knight doing the move came from.
| square get_from_for_pawn | ( | const fen_string & | s, |
| const pgn_move_string & | m | ||
| ) |
Get the square the pawn doing the move came from.
| square get_from_for_queen | ( | const fen_string & | s, |
| const pgn_move_string & | m | ||
| ) |
Get the square the queen doing the move came from.
| square get_from_for_rook | ( | const fen_string & | s, |
| const pgn_move_string & | m | ||
| ) |
Get the square the rook doing the move came from.
|
noexcept |
Get if the move is a capture.
| bool is_capture | ( | const pgn_move_string & | pgn_str | ) |
Conclude if the move is a capture from a PGN string E.g.
'Nxc3' will result in true
|
noexcept |
Get if the move is a castling.
|
noexcept |
Get if the move is a win.
|
noexcept |
Get if the move is a promotion.
|
noexcept |
Get if the move is a move, i.e.
if it moves one piece, without a capture, no castling, no promotion, no win and no draw
|
noexcept |
Get if the move is a win.
|
noexcept |
|
noexcept |
| void test_chess_move | ( | ) |
Test this class and its free functions.