blob: a5c218b7b6273f7f22162bfa2d4b215d4737a5e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
from __future__ import annotations
from blackjack.card import Card
from blackjack.hand import Hand
class Player:
def __init__(self) -> None:
self.hand = Hand()
self.__has_stood = False
def has_stood(self) -> bool:
return self.__has_stood
def hit(self, deck: list(Card)) -> None:
self.hand.add_card(deck.pop())
if self.hand.is_natural():
self.stand()
def stand(self) -> None:
self.__has_stood = True
|