pub struct RetroBoard { /* private fields */ }Expand description
A shakmaty::Board where Unmove are played and all legal Unmove can be generated.
It is the user responsability to ensure that position is legal. Unreachable positions are considered legal, for example this position.
Implementations§
Source§impl RetroBoard
impl RetroBoard
Sourcepub fn new_no_pockets(fen: &str) -> Result<Self, ParseFenError>
pub fn new_no_pockets(fen: &str) -> Result<Self, ParseFenError>
Returns a new RetroBoard with empty RetroPocket for both colors.
Sourcepub fn new(
fen: &str,
pocket_white: &str,
pocket_black: &str,
) -> Result<Self, ParseFenError>
pub fn new( fen: &str, pocket_white: &str, pocket_black: &str, ) -> Result<Self, ParseFenError>
Returns a new RetroBoard with defined RetroPocket, see RetroPocket::from_str documentation
to see which string format is expected.
§Examples
use retroboard::RetroBoard;
let r = RetroBoard::new("3k4/8/8/8/8/8/8/2RKR3 w - - 0 1", "PNQ1", "7BBBB").unwrap();pub fn push(&mut self, m: &UnMove)
pub fn pseudo_legal_unmoves(&self, moves: &mut UnMoveList)
Sourcepub fn legal_unmoves(&self) -> UnMoveList
pub fn legal_unmoves(&self) -> UnMoveList
Generate legal unmoves, which are all the pseudo legal unmoves which do not put the opponent’s king in check. If the opponent’s king is in check at the beginning of our turn, the only legal unmoves are those which stop it from being in check.
pub fn board(&self) -> &Board
pub fn retro_turn(&self) -> Color
pub fn us(&self) -> Bitboard
pub fn our(&self, role: Role) -> Bitboard
pub fn them(&self) -> Bitboard
pub fn their(&self, role: Role) -> Bitboard
pub fn king_of(&self, color: Color) -> Square
pub fn flip_vertical(&mut self)
pub fn flip_horizontal(&mut self)
pub fn flip_diagonal(&mut self)
pub fn flip_anti_diagonal(&mut self)
pub fn rotate_90(&mut self)
pub fn rotate_180(&mut self)
pub fn rotate_270(&mut self)
Trait Implementations§
Source§impl Clone for RetroBoard
impl Clone for RetroBoard
Source§fn clone(&self) -> RetroBoard
fn clone(&self) -> RetroBoard
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetroBoard
impl Debug for RetroBoard
Source§impl Display for RetroBoard
impl Display for RetroBoard
Source§impl From<Chess> for RetroBoard
impl From<Chess> for RetroBoard
Source§fn from(chess: Chess) -> Self
fn from(chess: Chess) -> Self
RetroBoard::halfmoves is set to 0, and RetroPocket will be empty for both colors
Source§impl From<RetroBoard> for Chess
impl From<RetroBoard> for Chess
Source§fn from(rboard: RetroBoard) -> Self
fn from(rboard: RetroBoard) -> Self
Consider valid positions with too many/impossible checkers (unreachable positions)
Chess::halfmoves and Chess::fullmoves are respectively set to 0 and 1
Source§impl From<RetroBoard> for Setup
impl From<RetroBoard> for Setup
Source§fn from(rboard: RetroBoard) -> Self
fn from(rboard: RetroBoard) -> Self
Setup::halfmoves and Setup::fullmoves are respectively set to 0 and 1
Setup::castling_rights is empty
Source§impl FromSetup for RetroBoard
impl FromSetup for RetroBoard
Source§fn from_setup(
setup: Setup,
_: CastlingMode,
) -> Result<Self, PositionError<Self>>
fn from_setup( setup: Setup, _: CastlingMode, ) -> Result<Self, PositionError<Self>>
RetroPocket will be empty for both colors
§Warning
No legality check is done, and the behaviour of RetroBoard is undefined for illegal positions