[−][src]Enum pleco::core::Player
Enum to represent the Players White & Black.
Variants
White
Black
Methods
impl Player
[src]
pub fn other_player(self) -> Player
[src]
Returns the other player.
Examples
use pleco::core::Player; let b = Player::Black; assert_eq!(b.other_player(), Player::White);
pub fn relative_square(self, sq: SQ) -> SQ
[src]
Returns the relative square from a given square.
pub fn pawn_push(self) -> i8
[src]
Gets the direction of a pawn push for a given player.
pub fn relative_rank_of_sq(self, sq: SQ) -> Rank
[src]
Returns the relative rank of a square in relation to a player.
Examples
use pleco::core::{Player,Rank}; use pleco::core::sq::SQ; let w = Player::White; let b = Player::Black; assert_eq!(w.relative_rank_of_sq(SQ::A1), Rank::R1); assert_eq!(b.relative_rank_of_sq(SQ::H8), Rank::R1); assert_eq!(b.relative_rank_of_sq(SQ::A1), Rank::R8);
pub fn relative_rank(self, rank: Rank) -> Rank
[src]
Returns the relative rank of a rank in relation to a player.
Examples
use pleco::core::{Player,Rank}; use pleco::core::sq::SQ; let w = Player::White; let b = Player::Black; assert_eq!(w.relative_rank(Rank::R1), Rank::R1); assert_eq!(b.relative_rank(Rank::R8), Rank::R1); assert_eq!(b.relative_rank(Rank::R1), Rank::R8);
Trait Implementations
impl Copy for Player
[src]
impl PartialEq<Player> for Player
[src]
fn eq(&self, other: &Player) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=
.
impl Clone for Player
[src]
fn clone(&self) -> Player
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Display for Player
[src]
impl Debug for Player
[src]
impl Not for Player
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,