Esempio n. 1
0
 public bool DoCheckWinner(model.Dealer a_dealer, model.Player a_player)
 {
     if (a_dealer.CalcScore() == a_player.CalcScore())
     {
         return(true);
     }
     else
     {
         return(a_dealer.CalcScore() > a_player.CalcScore());
     }
 }
Esempio n. 2
0
        public Boolean IsDealerWinner(model.Dealer a_dealer, model.Player a_player)
        {
            int maxScore = a_dealer.getMaxScore();

            if (a_player.CalcScore() > maxScore)
            {
                return(true);
            }
            else if (a_dealer.CalcScore() > maxScore)
            {
                return(false);
            }
            return(a_dealer.CalcScore() > a_player.CalcScore());
        }
Esempio n. 3
0
 public void RedrawAndShowHand(model.Dealer a_dealer, model.Player a_player)
 {
     System.Threading.Thread.Sleep(2000);
     DisplayWelcomeMessage();
     DisplayDealerHand(a_dealer.GetHand(), a_dealer.CalcScore());
     DisplayPlayerHand(a_player.GetHand(), a_player.CalcScore());
 }
Esempio n. 4
0
 public int GetDealerScore()
 {
     return(m_dealer.CalcScore());
 }
 /// <summary>
 /// Unless player is busted,
 /// dealer has to be not busted and have a higher score to win,
 /// if tie, player wins
 /// </summary>
 public bool IsDealerWinner(
     model.Dealer dealer, model.Player player
     ) =>
 IsBusted(player) ||
 !IsBusted(dealer) && dealer.CalcScore() > player.CalcScore();