endplay.types.player
Classes:
|
Encoding for player seat |
- class endplay.types.player.Player(value)
Bases:
IntEnum
Encoding for player seat
Attributes:
- return:
A single character string for the player name
- return:
The player on the current player's left
- return:
The player opposite the current player
- return:
The player to the current player's right
Methods:
enumerate
(iterable[, step])Return an iterator whose next method returns a tuple containing a Player (starting from this player) and the values obtained from iterating over iterable, where the player increments each time by step rotations clockwise
find
(name)Convert a string into a Player object
from_board
(n)Return the player who is the dealer of the corresponding board
from_lin
(n)Convert a BBO LIN representation of a player into a Player object.
is_vul
(vul)Iterate over all four players, clockwise, starting from this player
iter_order
(order)Iterate over a sequence of players in a given order
next
([n])- return:
The player who is n places left of the current player
prev
([n])- return:
The player who is n places right of the current player
to_lin
()turns_to
(other)Return the number of positions clockwise other is from self
- property abbr: str
- Returns:
A single character string for the player name
- east = 1
- enumerate(iterable: Iterable, step: int = 1) Iterator
Return an iterator whose next method returns a tuple containing a Player (starting from this player) and the values obtained from iterating over iterable, where the player increments each time by step rotations clockwise
- static from_lin(n: int) Player
Convert a BBO LIN representation of a player into a Player object. The conversion is determined by 1=S, 2=W, 3=N, 4=E
- iter_from() Iterator[Player]
Iterate over all four players, clockwise, starting from this player
- Returns:
An iterator over all four players in play order
- static iter_order(order: str) Iterator[Player]
Iterate over a sequence of players in a given order
- Parameters:
order – The specified order as a four-character string or list of strings
- Returns:
An iterator over the players in the specified order
- north = 0
- south = 2
- to_lin() int
- west = 3