16 lines
445 B
Python
16 lines
445 B
Python
|
|
from pyjack.deck import Deck
|
||
|
|
from pyjack.player import Player
|
||
|
|
|
||
|
|
|
||
|
|
class Dealer(Player):
|
||
|
|
"""The Dealer inherits all player functionality but has a specific,
|
||
|
|
automated turn behavior."""
|
||
|
|
|
||
|
|
def __init__(self, chips: int) -> None:
|
||
|
|
super().__init__(chips)
|
||
|
|
|
||
|
|
def play(self, deck: Deck) -> None:
|
||
|
|
"""Called only after the human player has finished their turn."""
|
||
|
|
while self.hand.value < 17:
|
||
|
|
self.hit(deck)
|