20 lines
514 B
Python
20 lines
514 B
Python
|
|
# -*- coding: utf-8 -*-
|
||
|
|
# games/blackjack/models/player_hand.py
|
||
|
|
from dataclasses import dataclass, field
|
||
|
|
from models.card import Card
|
||
|
|
|
||
|
|
|
||
|
|
@dataclass
|
||
|
|
class PlayerHand:
|
||
|
|
cards: list[Card] = field(default_factory=list)
|
||
|
|
bet_in_pot: int = 0
|
||
|
|
cards_locked: bool = False
|
||
|
|
busted: bool = False
|
||
|
|
folded: bool = False
|
||
|
|
doubled: bool = False
|
||
|
|
is_split_hand: bool = False
|
||
|
|
acted_once: bool = False
|
||
|
|
|
||
|
|
@property
|
||
|
|
def is_active_in_pot(self) -> bool:
|
||
|
|
return not self.busted and not self.folded
|