endplay.types.player

Classes:

Player(value)

Encoding for player seat

class endplay.types.player.Player(value)

Bases: IntEnum

Encoding for player seat

Attributes:

abbr

return:

A single character string for the player name

east

lho

return:

The player on the current player's left

north

partner

return:

The player opposite the current player

rho

return:

The player to the current player's right

south

west

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)

iter_from()

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 find(name: str) Player

Convert a string into a Player object

static from_board(n: int) Player

Return the player who is the dealer of the corresponding board

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

is_vul(vul: Vul) bool
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

property lho: Player
Returns:

The player on the current player’s left

next(n: int = 1) Player
Returns:

The player who is n places left of the current player

north = 0
property partner: Player
Returns:

The player opposite the current player

prev(n: int = 1) Player
Returns:

The player who is n places right of the current player

property rho: Player
Returns:

The player to the current player’s right

south = 2
to_lin() int
turns_to(other: Player) int

Return the number of positions clockwise other is from self

west = 3