created Player and Dealer class
This commit is contained in:
21
src/pyjack/player.py
Normal file
21
src/pyjack/player.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from pyjack.hand import Hand
|
||||
from pyjack.deck import Deck
|
||||
|
||||
|
||||
class Player:
|
||||
"""Sets up the player's name, starting chips, and a new Hand object."""
|
||||
|
||||
def __init__(self, chips: int) -> None:
|
||||
self.hand = Hand()
|
||||
self.chips = chips
|
||||
|
||||
def hit(self, deck: Deck):
|
||||
"""Draws Card: Retrieves a card from the Deck and passes it to
|
||||
the internal hand."""
|
||||
|
||||
self.hand.add_card(deck.deal_card())
|
||||
|
||||
def stand(self) -> None:
|
||||
"""Sets an internal state, signaling the end of the players
|
||||
draw phase."""
|
||||
return
|
||||
Reference in New Issue
Block a user