38 const auto&
get_color() const noexcept {
return m_color; };
43 const auto&
get_from() const noexcept {
return m_from; }
46 const auto&
get_pgn_str() const noexcept {
return m_pgn_str; }
56 const auto&
get_to() const noexcept {
return m_to; }
66 const auto&
get_winner() const noexcept {
return m_winner; }
70 bool is_capture() const noexcept {
return m_is_capture; }
77 std::optional<piece_action_type> m_action_type;
80 std::optional<castling_type> m_castling_type;
84 std::optional<square> m_from;
93 std::optional<piece_type> m_promotion_type;
95 std::optional<square> m_to;
97 std::optional<piece_type> m_piece_type;
103 std::vector<chess_color> m_winner;
chess_color
A chess piece color.
Definition chess_color.h:10
bool is_castling(const chess_move &move) noexcept
Get if the move is a castling.
Definition chess_move.cpp:233
bool is_promotion(const chess_move &move) noexcept
Get if the move is a promotion.
Definition chess_move.cpp:243
square get_from_for_king(const fen_string &s, const pgn_move_string &m)
Get the square the king doing the move came from.
Definition chess_move.cpp:105
bool is_capture(const chess_move &move) noexcept
Get if the move is a capture.
Definition chess_move.cpp:228
bool is_win(const chess_move &move) noexcept
Get if the move is a win.
Definition chess_move.cpp:258
square get_from_for_bishop(const fen_string &s, const pgn_move_string &m)
Get the square the bishop doing the move came from.
Definition chess_move.cpp:80
bool operator==(const chess_move &lhs, const chess_move &rhs) noexcept
Definition chess_move.cpp:476
bool is_simple_move(const chess_move &move) noexcept
Get if the move is a move, i.e.
Definition chess_move.cpp:248
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.
Definition chess_move.cpp:60
bool is_draw(const chess_move &move) noexcept
Get if the move is a win.
Definition chess_move.cpp:238
void test_chess_move()
Test this class and its free functions.
Definition chess_move.cpp:263
square get_from_for_knight(const fen_string &s, const pgn_move_string &m)
Get the square the knight doing the move came from.
Definition chess_move.cpp:118
square get_from_for_rook(const fen_string &s, const pgn_move_string &m)
Get the square the rook doing the move came from.
Definition chess_move.cpp:199
square get_from_for_queen(const fen_string &s, const pgn_move_string &m)
Get the square the queen doing the move came from.
Definition chess_move.cpp:165
square get_from_for_pawn(const fen_string &s, const pgn_move_string &m)
Get the square the pawn doing the move came from.
Definition chess_move.cpp:143
std::ostream & operator<<(std::ostream &os, const chess_move &m) noexcept
Definition chess_move.cpp:483
A chess move.
Definition chess_move.h:22
const auto & get_piece_type() const noexcept
The type of chess piece.
Definition chess_move.h:60
const auto & get_from() const noexcept
Get the source/from square, e.g.
Definition chess_move.h:43
const auto & get_action_type() const noexcept
The type of action this move is.
Definition chess_move.h:31
const auto & get_to() const noexcept
Get the target square, e.g.
Definition chess_move.h:56
const auto & get_pgn_str() const noexcept
Get the original PGN string back.
Definition chess_move.h:46
const auto & get_promotion_type() const noexcept
Get the promotion type.
Definition chess_move.h:50
const auto & get_winner() const noexcept
Get the winner.
Definition chess_move.h:66
const auto & get_castling_type() const noexcept
Get the castling type.
Definition chess_move.h:35
bool is_capture() const noexcept
Is this move a capture? E.g.
Definition chess_move.h:70
const auto & get_color() const noexcept
Get the color of the player that did this move.
Definition chess_move.h:38
Forsyth–Edwards Notation string.
Definition fen_string.h:20
A string that is a PGN notation string.
Definition pgn_move_string.h:16
A chess square.
Definition square.h:58
fen_string create_fen_string_of_standard_starting_position(const chess_color active_player=chess_color::white)
Create the FEN string of the standard starting position.
Definition fen_string.cpp:13