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

Methods

impl Color
[src]

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());

Trait Implementations

impl Debug for Color
[src]

Formats the value using the given formatter.

impl PartialEq for Color
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Color
[src]

impl Clone for Color
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Color
[src]

impl Display for Color
[src]

Formats the value using the given formatter.