whist_core.game.play_order
Ring buffer of players at the table.
Classes
Iterates over the players at the table. |
Module Contents
- class whist_core.game.play_order.PlayOrder
Bases:
pydantic.BaseModelIterates over the players at the table.
- next_player: int
- play_order: list[whist_core.game.player_at_table.PlayerAtTable]
- __iter__()
Iteration over all players.
- static from_team_list(teams)
Factory method to create a play order from a team list. :param teams: list of teams :return: PlayOrder
- Parameters:
teams (list[whist_core.scoring.team.Team])
- rotate(player)
Rotates the play order, so the player will be next player. :param player: who should be at beginning of the play order :return: None
- Parameters:
- Return type:
- get_next_player()
Retrieves the next player who’s turn it is. :rtype: PlayOrder
- Return type:
- get_player(player)
Retrieves the PlayerAtTable for the player given. :param player: who needs it’s counterpart at the table :return: the player at table :raises PlayerNoteJoinedError: when a player is requested but is not in play order.
- Parameters:
player (whist_core.user.player.Player)
- Return type:
- to_team_list()
Returns a two-dimensional array of players sorted by teams.
- Return type:
list[list[whist_core.user.player.Player]]