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