whist_core.game.trick

Trick implementation

Classes

Trick

One round of where every player plays one card.

Module Contents

class whist_core.game.trick.Trick

Bases: pydantic.BaseModel

One round of where every player plays one card.

play_order: list[whist_core.game.player_at_table.PlayerAtTable]
stack: whist_core.cards.card_container.OrderedCardContainer
trump: whist_core.cards.card.Suit
property done: bool

Is the trick done. :return: True if trick is done else false. :rtype: bool

Return type:

bool

property winner: whist_core.game.player_at_table.PlayerAtTable

Player how won the trick. :return: Player instance of the winner if the trick is done. Else raises TrickNotDoneWarning :rtype: Player

Return type:

whist_core.game.player_at_table.PlayerAtTable

play_card(player, card)

One player plays one card. Which is put on top of the stack. :param player: Player who wants to play a card. :type player: Player :param card: Card which the player wants to play. :type card: Card :return: None if successful, else raises TrickDoneError if every player already played a card. Or NotPlayersTurnError if a player attempts to play card although it is not they turn. :rtype: None

Parameters:
Return type:

None

dict(*args, **kwargs)

Returns dictionary.