Exemplo n.º 1
0
 public bool Raise(Player player, Chip chip)
 {
     if (CheckPlayer(player))
     {
         if (_potManager.LegalRaise(chip, _currRound))
         {
             player.ReduceChips(chip.Sum);
             _potManager._previousRaise = new Chip(chip.Sum);
             _lastPlayerInRound         = player;
             NextPlayer(player, Turn.ActionType.Raise, chip);
             ActiveLogger.Debug(player.User.PlayerName + "Raised successfully");
             return(true);
         }
     }
     ActiveLogger.Debug(player.User.PlayerName + " Tried to Raise but did'nt succeed");
     return(false);
 }
Exemplo n.º 2
0
        public bool Call(Player player)
        {
            if (CheckPlayer(player))
            {
                if (_potManager._previousRaise.Sum - player.PlayerPot <= player.Chip.Sum)
                {
                    Chip difference = new Chip(_potManager._previousRaise.Sum - player.PlayerPot);

                    player.ReduceChips(difference.Sum);
                    NextPlayer(player, Turn.ActionType.Call, difference);
                    ActiveLogger.Debug(player.User.PlayerName + "Called successfully");
                    return(true);
                }
            }
            ActiveLogger.Debug(player.User.PlayerName + " Tried to Call but did'nt succeed");
            return(false);
        }
Exemplo n.º 3
0
 public bool AllIn(Player player)
 {
     if (CheckPlayer(player))
     {
         someoneInAllIn    = true;
         player.AmIInAllIn = true;
         if (player.Chip.Sum > _potManager._previousRaise.Sum)
         {
             _lastPlayerInRound         = player;
             _potManager._previousRaise = new Chip(player.Chip.Sum);
         }
         player.ReduceChips(player.Chip.Sum);
         NextPlayer(player, Turn.ActionType.AllIn, player.Chip);
         ActiveLogger.Debug(player.User.PlayerName + "AllIned successfully");
         return(true);
     }
     ActiveLogger.Debug(player.User.PlayerName + " Tried to Allin but did'nt succeed");
     return(false);
 }