Enum libcoinche::pos::PlayerPos [] [src]

pub enum PlayerPos {
    P0,
    P1,
    P2,
    P3,
}

A position in the table

Variants

P0

Player 0

P1

Player 1

P2

Player 2

P3

Player 3

Methods

impl PlayerPos
[src]

fn team(self) -> Team

Returns the player's team

fn from_n(n: usize) -> Self

Returns the position corresponding to the number (0 => P0, ...).

Panics if n > 3.

fn is_partner(self, other: PlayerPos) -> bool

Returns true if self and other and in the same team

fn next(self) -> PlayerPos

Returns the next player in line

fn next_n(self, n: usize) -> PlayerPos

Returns the player n seats further

fn prev(self) -> PlayerPos

Returns the previous player.

fn until_n(self, n: usize) -> PlayerIterator

Returns an iterator that iterates on n players, including this one.

fn distance_until(self, other: PlayerPos) -> usize

Returns the number of turns after self to reach other.

fn until(self, other: PlayerPos) -> PlayerIterator

Returns an iterator until the given player (self included, other excluded)

Trait Implementations

impl Debug for PlayerPos
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for PlayerPos
[src]

impl Clone for PlayerPos
[src]

fn clone(&self) -> PlayerPos

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 PartialEq for PlayerPos
[src]

fn eq(&self, __arg_0: &PlayerPos) -> 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 Encodable for PlayerPos
[src]

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl Decodable for PlayerPos
[src]

fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>