29 lines
767 B
Python
29 lines
767 B
Python
|
|
# -*- coding: utf-8 -*-
|
||
|
|
# games/poker/models/poker_seat.py
|
||
|
|
from dataclasses import dataclass, field
|
||
|
|
from models.card import Card
|
||
|
|
|
||
|
|
|
||
|
|
@dataclass
|
||
|
|
class PokerSeat:
|
||
|
|
seat_id: int # 0 = Spieler, 1..5 = Bots
|
||
|
|
name: str
|
||
|
|
is_human: bool
|
||
|
|
ai_level: int = 0
|
||
|
|
stack: int = 1000
|
||
|
|
hole_cards: list[Card] = field(default_factory=list)
|
||
|
|
street_bet: int = 0
|
||
|
|
total_committed: int = 0
|
||
|
|
folded: bool = False
|
||
|
|
all_in: bool = False
|
||
|
|
acted_this_street: bool = False
|
||
|
|
status_text: str = ""
|
||
|
|
rebought: bool = False
|
||
|
|
|
||
|
|
@property
|
||
|
|
def is_in_hand(self) -> bool:
|
||
|
|
return not self.folded and len(self.hole_cards) == 2
|
||
|
|
|
||
|
|
@property
|
||
|
|
def can_act(self) -> bool:
|
||
|
|
return self.is_in_hand and not self.all_in and self.stack > 0
|