public void AllIn(Pot mainPot, int index) { AmountContributed = ChipStack; if (mainPot.MinimumAllInAmount == 0) { mainPot.AmountInPotBeforeAllIn = mainPot.Amount; mainPot.MinimumAllInAmount = ChipStack; } else if (chipStack < mainPot.MinimumAllInAmount) { mainPot.MinimumAllInAmount = ChipStack; } if (ChipStack > mainPot.MinimumRaise) { mainPot.MinimumRaise = ChipStack; } mainPot.AddPlayer(this); mainPot.Add(ChipStack); amountInPot += ChipStack; ChipStack = 0; if (amountInPot > mainPot.getMaximumAmountPutIn()) { mainPot.setMaximumAmount(amountInPot); } Message = "I'm All-In"; SimplifiedMessage = "ALL IN"; mainPot.AgressorIndex = index; }
//bet enough to stay in the round public void Call(Pot mainPot) { int amount = mainPot.getMaximumAmountPutIn() - amountInPot; if (ChipStack <= amount) { AllIn(mainPot); return; } ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.AddPlayer(this); Message = "Call " + amount.ToString("c0"); SimplifiedMessage = "CALL " + amount; }
//some functions have index as they are needed to reset the agressor index to continue the round public void PaySmallBlind(int amount, Pot mainPot, int index) { if (ChipStack <= amount) { AllIn(mainPot, index); return; } ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.AddPlayer(this); mainPot.setMaximumAmount(amountInPot); mainPot.MinimumRaise = amount; Message = this.Name + " pays the small blind"; SimplifiedMessage = "SMALL BLIND " + amount; }
public void PayBigBlind(int amount, Pot mainPot) { if (ChipStack <= amount) { AllIn(mainPot); return; } Message = "Pay blind of " + amount.ToString("c0"); ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.AddPlayer(this); mainPot.setMaximumAmount(amountInPot); mainPot.MinimumRaise = amount; Message = this.Name + " pays the big blind"; SimplifiedMessage = "BIG BLIND " + amount; }
//call and bet additional amount of money public void Raise(int raise, Pot mainPot) { int amount = mainPot.getMaximumAmountPutIn() + raise - amountInPot; if (ChipStack <= amount) { AllIn(mainPot); return; } ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.setMaximumAmount(amountInPot); mainPot.AddPlayer(this); mainPot.MinimumRaise = raise; Message = "Call " + (amount - raise).ToString("c0") + " and raise " + raise.ToString("c0"); SimplifiedMessage = "RAISE " + (amount - raise); }
public void Raise(int raise, Pot mainPot, int index) { int amount = mainPot.getMaximumAmountPutIn() + raise - amountInPot; if (ChipStack <= amount) { AllIn(mainPot,index); return; } ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.setMaximumAmount(amountInPot); mainPot.AddPlayer(this); mainPot.MinimumRaise = raise; Message = "Call " + (amount - raise).ToString("c0") + " and raise " + raise.ToString("c0"); SimplifiedMessage = "RAISE " + (amount - raise); mainPot.AgressorIndex = index; }
//some functions have index as they are needed to reset the agressor index to continue the round public void PaySmallBlind(int amount, Pot mainPot,int index) { if (ChipStack <= amount) { AllIn(mainPot,index); return; } ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.AddPlayer(this); mainPot.setMaximumAmount(amountInPot); mainPot.MinimumRaise = amount; Message = this.Name + " pays the small blind"; SimplifiedMessage = "SMALL BLIND " + amount; }
public void PayBigBlind(int amount, Pot mainPot, int index) { if (ChipStack <= amount) { AllIn(mainPot,index); return; } Message = "Pay blind of " + amount.ToString("c0"); ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.AddPlayer(this); mainPot.setMaximumAmount(amountInPot); mainPot.MinimumRaise = amount; Message = this.Name + " pays the big blind"; SimplifiedMessage = "BIG BLIND " + amount; mainPot.AgressorIndex = index; }
//bet enough to stay in the round public void Call(Pot mainPot) { int amount = mainPot.getMaximumAmountPutIn() - amountInPot; if (ChipStack <= amount) { AllIn(mainPot); return; } ChipStack -= amount; amountInPot += amount; mainPot.Add(amount); mainPot.AddPlayer(this); Message = "Call " + amount.ToString("c0"); SimplifiedMessage = "CALL " + amount; }
public void AllIn(Pot mainPot,int index) { AmountContributed = ChipStack; if (mainPot.MinimumAllInAmount == 0) { mainPot.AmountInPotBeforeAllIn = mainPot.Amount; mainPot.MinimumAllInAmount = ChipStack; } else if (chipStack < mainPot.MinimumAllInAmount) { mainPot.MinimumAllInAmount = ChipStack; } if (ChipStack > mainPot.MinimumRaise) mainPot.MinimumRaise = ChipStack; mainPot.AddPlayer(this); mainPot.Add(ChipStack); amountInPot += ChipStack; ChipStack = 0; if(amountInPot>mainPot.getMaximumAmountPutIn()) mainPot.setMaximumAmount(amountInPot); Message = "I'm All-In"; SimplifiedMessage = "ALL IN"; mainPot.AgressorIndex = index; }