Enum shogi::color::Color
[−]
[src]
pub enum Color { Black, White, }
Represents each side of player. Black player moves first.
Examples
use shogi::Color; let c = Color::Black; match c { Color::Black => assert!(true), Color::White => unreachable!(), }
Variants
Black
White
Methods
impl Color
[src]
fn iter() -> ColorIter
Returns an iterator of all variants.
fn flip(&self) -> Color
Returns the color of the opposite side.
Examples
use shogi::Color; assert_eq!(Color::White, Color::Black.flip()); assert_eq!(Color::Black, Color::White.flip());
fn index(&self) -> usize
Converts the instance into the unique number for array indexing purpose.
Trait Implementations
impl Debug 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 Eq for Color
[src]
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