Enum chess::Color [−][src]
pub enum Color { White, Black, }
Represent a color.
Variants
White
Black
Methods
impl Color
[src]
impl Color
pub fn to_index(&self) -> usize
[src]
pub fn to_index(&self) -> usize
Convert the Color
to a usize
for table lookups.
pub fn to_my_backrank(&self) -> Rank
[src]
pub fn to_my_backrank(&self) -> Rank
Covert the Color
to a rank, which reperesnts the starting position
for that colors pieces.
pub fn to_their_backrank(&self) -> Rank
[src]
pub fn to_their_backrank(&self) -> Rank
Convert a Color
to my opponents backrank, which represents the starting position for the
opponents pieces.
pub fn to_second_rank(&self) -> Rank
[src]
pub fn to_second_rank(&self) -> Rank
Convert a Color
to my second rank, which represents the starting position for my pawns.
pub fn to_seventh_rank(&self) -> Rank
[src]
pub fn to_seventh_rank(&self) -> Rank
Convert a Color
to my seventh rank, which represents the rank before pawn promotion.
Trait Implementations
impl PartialOrd for Color
[src]
impl PartialOrd for Color
fn partial_cmp(&self, other: &Color) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Color) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
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
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq for Color
[src]
impl PartialEq for Color
fn eq(&self, other: &Color) -> bool
[src]
fn eq(&self, other: &Color) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Copy for Color
[src]
impl Copy for Color
impl Clone for Color
[src]
impl Clone for Color
fn clone(&self) -> Color
[src]
fn clone(&self) -> Color
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Color
[src]
impl Debug for Color
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Not for Color
[src]
impl Not for Color