pub enum Side {
White,
Black,
}
Expand description
Represents the two different teams in a game of chess.
Variants§
Implementations§
Source§impl Side
impl Side
Sourcepub fn pawn_dir(self) -> Dir
pub fn pawn_dir(self) -> Dir
Get the vertical direction in which a pawn on this side moves (north or south).
Sourcepub fn pawn_first_rank(self) -> BitBoard
pub fn pawn_first_rank(self) -> BitBoard
Get the rank on which a pawn on this side starts the game.
Sourcepub fn pawn_third_rank(self) -> BitBoard
pub fn pawn_third_rank(self) -> BitBoard
Get the rank to which a pawn on this side moves to following it’s special two rank first move.
Sourcepub fn pawn_promoting_from_rank(self) -> BitBoard
pub fn pawn_promoting_from_rank(self) -> BitBoard
Get the rank a pawn on this side must be on for it to be able to promote on it’s next move.
Sourcepub fn pawn_promoting_dest_rank(self) -> BitBoard
pub fn pawn_promoting_dest_rank(self) -> BitBoard
The rank a pawn on this side will end up on after promoting to another piece.
Trait Implementations§
Source§impl Ord for Side
impl Ord for Side
Source§impl PartialOrd for Side
impl PartialOrd for Side
impl Copy for Side
impl Eq for Side
impl StructuralPartialEq for Side
Auto Trait Implementations§
impl Freeze for Side
impl RefUnwindSafe for Side
impl Send for Side
impl Sync for Side
impl Unpin for Side
impl UnwindSafe for Side
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more