Beispiel #1
0
        public void Hit()
        {
            Card topCard = Deck.Draw();

            PlayersHand.AddCard(topCard);
            if (PlayersHand.Points().points > 21)
            {
                State = GameState.Lost;
            }
        }
Beispiel #2
0
 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;
     }
 }
Beispiel #3
0
 public (int points, bool soft) GetPlayerHandValue()
 {
     return(PlayersHand.Points());
 }