public void SplitPots() { var firstpot = PokerPots.FirstOrDefault(); if (firstpot != null) { var newpot = firstpot; while (newpot != null) { var tempdict = newpot.SplitPot(); if (tempdict == null || tempdict.Count <= 0) { newpot = null; } else { newpot = new PokerPot(tempdict); PokerPots.Add(newpot); } } } }
public void MakeBet(PokerPlayer player, int bet) { player.MakeBet(bet); var pot = PokerPots.FirstOrDefault(); if (pot != null) { pot.AddtoPot(bet, player); } }
public void CheckPot(int amount, PokerPlayer player, bool allin = false) { /*if (allin) * { * foreach (PokerPot pokerPot in PokerPots) * { * if (pokerPot.MaxContributionAmountPerPlayer == 0) * { * pokerPot.MaxContributionAmountPerPlayer = amount + player.RoundCurrency; * break; * } * * if (amount + player.RoundCurrency < pokerPot.MaxContributionAmountPerPlayer) * { * Dictionary<PokerPlayer, int> newpot = pokerPot.CheckAllIn(amount + player.RoundCurrency); * * foreach (PokerPlayer p in Players.Players) * { * p.Mobile.SendMessage(61, "POT DIVISION OCCURRED"); * } * * newpot = PokerPots.Aggregate(newpot, (current, pot) => pot.DivisionAdjustment(current)); * * PokerPots.Add(new PokerPot(newpot)); * break; * } * } * } * amount = PokerPots.Aggregate(amount, (current, pokerPot) => pokerPot.CheckContribution(current, player)); * * if (amount > 0) * { * foreach (PokerPlayer p in Players.Players) * { * p.Mobile.SendMessage(61, "SPLIT POT CREATED: " + amount + "GP ADDED TO IT"); * } * * PokerPots.Add(new PokerPot(amount, player)); * }*/ var mainpot = PokerPots.FirstOrDefault(); if (mainpot != null) { mainpot.AddtoPot(amount, player); } }