|
BenBot 1.7.5
A chess engine
|
#include <libchess/game/CastlingRights.hpp>
Public Member Functions | |
| constexpr auto | either () const noexcept -> bool |
| constexpr void | king_moved () noexcept |
| constexpr auto | neither () const noexcept -> bool |
| constexpr auto | operator== (const CastlingRights &) const noexcept -> bool=default |
| constexpr void | our_move (Move move) noexcept |
| constexpr void | rook_moved (bool isKingside) noexcept |
| template<Color Side> | |
| constexpr void | their_move (Move move) noexcept |
Public Attributes | |
| bool | kingside { true } |
| bool | queenside { true } |
This struct encapsulates one side's castling rights.
Definition at line 40 of file CastlingRights.hpp.
|
inlinenodiscardconstexprnoexcept |
Returns true if castling either direction is possible.
Definition at line 74 of file CastlingRights.hpp.
|
constexprnoexcept |
Called when the king moves. Moving the king loses castling rights for both directions.
Definition at line 97 of file CastlingRights.hpp.
|
inlinenodiscardconstexprnoexcept |
Returns true if neither castling direction is available.
Definition at line 77 of file CastlingRights.hpp.
|
nodiscardconstexprdefaultnoexcept |
Returns true if the two sets of castling rights are identical.
|
constexprnoexcept |
Call this any time a move is made by this side to update the castling rights.
Definition at line 114 of file CastlingRights.hpp.
|
constexprnoexcept |
Called when a rook moves. Moving a rook loses castling rights to that side.
| isKingside | Should be true if the move's from square is on the kingside. |
Definition at line 103 of file CastlingRights.hpp.
Call this any time the opponent makes a move to update the castling rights. An opponent's move can remove castling rights if they capture a rook.
| Side | The color that this castling rights object represents. |
Definition at line 128 of file CastlingRights.hpp.
| bool chess::game::CastlingRights::kingside { true } |
True if kingside (or "short") castling is available.
Definition at line 42 of file CastlingRights.hpp.
| bool chess::game::CastlingRights::queenside { true } |
True if queenside (or "long") castling is available.
Definition at line 45 of file CastlingRights.hpp.