pub enum Color {
White,
Black,
}
Expand description
Represent a color.
Variants§
Implementations§
source§impl Color
impl Color
sourcepub fn to_my_backrank(&self) -> Rank
pub fn to_my_backrank(&self) -> Rank
Convert a Color
to my backrank, which represents the starting rank
for my pieces.
sourcepub fn to_their_backrank(&self) -> Rank
pub fn to_their_backrank(&self) -> Rank
Convert a Color
to my opponents backrank, which represents the starting rank for the
opponents pieces.
sourcepub fn to_second_rank(&self) -> Rank
pub fn to_second_rank(&self) -> Rank
Convert a Color
to my second rank, which represents the starting rank for my pawns.
sourcepub fn to_fourth_rank(&self) -> Rank
pub fn to_fourth_rank(&self) -> Rank
Convert a Color
to my fourth rank, which represents the rank of my pawns when
moving two squares forward.
sourcepub fn to_seventh_rank(&self) -> Rank
pub fn to_seventh_rank(&self) -> Rank
Convert a Color
to my seventh rank, which represents the rank before pawn promotion.
Trait Implementations§
source§impl PartialOrd<Color> for Color
impl PartialOrd<Color> for Color
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more