#[repr(u8)]pub enum Player {
Black = 0,
White = 1,
}Expand description
Black and white
Variants§
Implementations§
Source§impl Player
Player Finite Set API.
impl Player
Player Finite Set API.
pub const LEN: usize
pub const ALL: [Self; 2]
pub const fn name(self) -> &'static str
pub const fn eq(self, other: Self) -> bool
pub const fn index(self) -> usize
pub const fn from_index(index: u8) -> Option<Self>
pub fn iter() -> impl Iterator<Item = Self>
pub fn iter_rev() -> impl Iterator<Item = Self>
Source§impl Player
impl Player
pub const fn is_black(self) -> bool
pub const fn is_white(self) -> bool
pub const fn other(self) -> Player
pub const fn backrank(self) -> Rank
pub const fn pawn_start_rank(self) -> Rank
pub const fn pawn_push(self) -> Direction
pub const fn pawn_double_push(self) -> Direction
pub const fn pawn_capture_directions(self) -> [Direction; 2]
pub const fn pawn_double_push_rank(self) -> Rank
pub const fn promotion_rank(self) -> Rank
Sourcepub const fn pawn(self) -> Piece
pub const fn pawn(self) -> Piece
White.pawn(). Role::of is the inverse spelling for Pawn.of(White).
pub const fn knight(self) -> Piece
pub const fn bishop(self) -> Piece
pub const fn rook(self) -> Piece
pub const fn queen(self) -> Piece
pub const fn king(self) -> Piece
Sourcepub const fn castle_king_to(self, side: Side) -> Square
pub const fn castle_king_to(self, side: Side) -> Square
The square the king moves to when castling on this side.
Sourcepub const fn castle_rook_from(self, file: File) -> Square
pub const fn castle_rook_from(self, file: File) -> Square
The square the rook moves from when castling from this file.
Sourcepub const fn castle_rook_to(self, side: Side) -> Square
pub const fn castle_rook_to(self, side: Side) -> Square
The square the rook moves to when castling on this side.
Sourcepub const fn castle_empty_path(
self,
king_from: Square,
rook_file: File,
) -> Bitboard
pub const fn castle_empty_path( self, king_from: Square, rook_file: File, ) -> Bitboard
Squares that must be empty when castling with this king and rook.
Sourcepub const fn castle_king_path(self, king_from: Square, side: Side) -> Bitboard
pub const fn castle_king_path(self, king_from: Square, side: Side) -> Bitboard
Squares the king occupies or crosses when castling on this side.
Trait Implementations§
impl Copy for Player
impl Eq for Player
Source§impl Ord for Player
impl Ord for Player
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Player
impl PartialOrd for Player
impl StructuralPartialEq for Player
Auto Trait Implementations§
impl Freeze for Player
impl RefUnwindSafe for Player
impl Send for Player
impl Sync for Player
impl Unpin for Player
impl UnsafeUnpin for Player
impl UnwindSafe for Player
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more