예제 #1
0
        public Winninghand ReturnWinner(RegularPlayer player)
        {
            //returns winner: a regular player OR dealer:
            Winninghand winner = Rules.EvaluateWinner(player.Hand, dealer.Hand);

            return(winner);
        }
예제 #2
0
 private bool ValidateBet(RegularPlayer player, int bet)
 {
     if (player.Balance < bet)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
예제 #3
0
        public bool BetIsValid(RegularPlayer player)
        {
            //TODO rules class should be the validator of bets
            int  betToTry   = player.MakeBet();
            bool betIsValid = ValidateBet(player, betToTry);

            if (betIsValid)
            {
                player.Bet = betToTry;
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #4
0
 public void AddPlayer(RegularPlayer player)
 {
     players.Add(player);
 }
예제 #5
0
 public void RemovePlayer(RegularPlayer player)
 {
     //AiDealer not removable with this method
     players.Remove(player);
 }
예제 #6
0
 private void ClearBet(RegularPlayer player)
 {
     player.Bet = 0;
 }