public void Hit() { Card topCard = Deck.Draw(); PlayersHand.AddCard(topCard); if (PlayersHand.Points().points > 21) { State = GameState.Lost; } }
public void Stay() { if (State == GameState.Lost) { return; } while (DealersHand.Points().points < 17) { Card topCard = Deck.Draw(); DealersHand.AddCard(topCard); } if (DealersHand.Points().points > 21) { State = GameState.Won; } else if (DealersHand.Points().points < PlayersHand.Points().points) { State = GameState.Won; } else { State = GameState.Lost; } }
public (int points, bool soft) GetPlayerHandValue() { return(PlayersHand.Points()); }