whist_core.game.trick

Trick implementation

Module Contents

Classes

Trick

One round of where every player plays one card.

class whist_core.game.trick.Trick

Bases: pydantic.BaseModel

One round of where every player plays one card.

property done: bool

Is the trick done. :return: True if trick is done else false. :rtype: 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

play_order: list[whist_core.game.player_at_table.PlayerAtTable]
stack: whist_core.cards.card_container.OrderedCardContainer
trump: whist_core.cards.card.Suit
play_card(player: whist_core.game.player_at_table.PlayerAtTable, card: whist_core.cards.card.Card) None

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

dict(*args, **kwargs)

Returns dictionary.