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

            return(winner);
        }
Ejemplo n.º 2
0
 private bool ValidateBet(RegularPlayer player, int bet)
 {
     if (player.Balance < bet)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 4
0
 public void AddPlayer(RegularPlayer player)
 {
     players.Add(player);
 }
Ejemplo n.º 5
0
 public void RemovePlayer(RegularPlayer player)
 {
     //AiDealer not removable with this method
     players.Remove(player);
 }
Ejemplo n.º 6
0
 private void ClearBet(RegularPlayer player)
 {
     player.Bet = 0;
 }