Enum chess::Color
[−]
[src]
pub enum Color { White, Black, }
Represent a color.
Variants
White
Black
Methods
impl Color
[src]
fn to_index(&self) -> usize
Convert the Color
to a usize
for table lookups.
fn to_my_backrank(&self) -> Rank
Covert the Color
to a rank, which reperesnts the starting position
for that colors pieces.
fn to_their_backrank(&self) -> Rank
Convert a Color
to my opponents backrank, which represents the starting position for the
opponents pieces.
fn to_second_rank(&self) -> Rank
Convert a Color
to my second rank, which represents the starting position for my pawns.
Trait Implementations
impl Clone for Color
[src]
fn clone(&self) -> Color
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Color
[src]
impl PartialEq for Color
[src]
fn eq(&self, __arg_0: &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
This method tests for !=
.
impl PartialOrd for Color
[src]
fn partial_cmp(&self, __arg_0: &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
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
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
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
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more