public void PairHand(IPlayer player, int call, IPot pot, ref double raise, ref bool raising, CommunityCardBoard rounds) { int randomCall = this.rnd.Next(10, 16); int randomRaise = this.rnd.Next(10, 13); if (player.Type.Power <= 199 && player.Type.Power >= 140) { this.type.PH(player, randomCall, 6, randomRaise, call, pot, ref raise, ref raising, rounds); } if (player.Type.Power <= 139 && player.Type.Power >= 128) { this.type.PH(player, randomCall, 7, randomRaise, call, pot, ref raise, ref raising, rounds); } if (player.Type.Power < 128 && player.Type.Power >= 101) { this.type.PH(player, randomCall, 9, randomRaise, call, pot, ref raise, ref raising, rounds); } }
public void TwoPair(IPlayer player, int call, IPot pot, ref double raise, ref bool raising, CommunityCardBoard rounds) { int randomCall = this.rnd.Next(6, 11); int randomRaise = this.rnd.Next(6, 11); if (player.Type.Power <= 290 && player.Type.Power >= 246) { this.type.PH(player, randomCall, 3, randomRaise, call, pot, ref raise, ref raising, rounds); } if (player.Type.Power <= 244 && player.Type.Power >= 234) { this.type.PH(player, randomCall, 4, randomRaise, call, pot, ref raise, ref raising, rounds); } if (player.Type.Power < 234 && player.Type.Power >= 201) { this.type.PH(player, randomCall, 4, randomRaise, call, pot, ref raise, ref raising, rounds); } }
public void HandleTurn(IPlayer player, int call, IPot Pot, ref double raise, ref bool isAnyPlayerRaise, CommunityCardBoard currentRound) { if (!player.FoldedTurn) { if (player.Type.Current == PokerHand.HighCard) { this.handType.HighCard(player, call, Pot, ref raise, ref isAnyPlayerRaise); } if (player.Type.Current == PokerHand.PairTable) { this.handType.PairTable(player, call, Pot, ref raise, ref isAnyPlayerRaise); } if (player.Type.Current == PokerHand.PairFromHand) { this.handType.PairHand(player, call, Pot, ref raise, ref isAnyPlayerRaise, currentRound); } if (player.Type.Current == PokerHand.TwoPair) { this.handType.TwoPair(player, call, Pot, ref raise, ref isAnyPlayerRaise, currentRound); } if (player.Type.Current == PokerHand.ThreeOfAKind) { this.handType.ThreeOfAKind(player, call, Pot, ref raise, ref isAnyPlayerRaise); } if (player.Type.Current == PokerHand.Straigth) { this.handType.Straight(player, call, Pot, ref raise, ref isAnyPlayerRaise); } if (player.Type.Current == PokerHand.Flush || player.Type.Current == PokerHand.FlushWithAce) { this.handType.Flush(player, call, Pot, ref raise, ref isAnyPlayerRaise); } if (player.Type.Current == PokerHand.FullHouse) { this.handType.FullHouse(player, call, Pot, ref raise, ref isAnyPlayerRaise); } if (player.Type.Current == PokerHand.FourOfAKind) { this.handType.FourOfAKind(player, call, Pot, ref raise, ref isAnyPlayerRaise); } if (player.Type.Current == PokerHand.StraightFlush || player.Type.Current == PokerHand.RoyalFlush) { this.handType.StraightFlush(player, call, Pot, ref raise, ref isAnyPlayerRaise); } } if (player.FoldedTurn) { foreach (var pictureBox in player.PictureBoxHolder) { pictureBox.Visible = false; } } }
public void PH(IPlayer player, int n, int n1, int r, int call, IPot pot, ref double raise, ref bool raising, CommunityCardBoard rounds) { int rnd = this.random.Next(1, 3); if (rounds < CommunityCardBoard.Turn) { if (call <= 0) { this.playerActions.Check(player, ref raising); } if (call > 0) { if (call >= RoundN(player.Chips, n1)) { this.playerActions.Fold(player, ref raising); } if (raise > RoundN(player.Chips, n)) { this.playerActions.Fold(player, ref raising); } if (!player.FoldedTurn) { if (call >= RoundN(player.Chips, n) && call <= RoundN(player.Chips, n1)) { this.playerActions.Call(player, ref raising, call, pot); } if (raise <= RoundN(player.Chips, n) && raise >= RoundN(player.Chips, n) / 2) { this.playerActions.Call(player, ref raising, call, pot); } if (raise <= RoundN(player.Chips, n) / 2) { if (raise > 0) { raise = RoundN(player.Chips, n); this.playerActions.Call(player, ref raising, call, pot); } else { raise = call * 2; this.playerActions.Call(player, ref raising, call, pot); } } } } } if (rounds >= CommunityCardBoard.Turn) { if (call > 0) { if (call >= RoundN(player.Chips, n1 - rnd)) { this.playerActions.Fold(player, ref raising); } if (raise > RoundN(player.Chips, n - rnd)) { this.playerActions.Fold(player, ref raising); } if (!player.FoldedTurn) { if (call >= RoundN(player.Chips, n - rnd) && call <= RoundN(player.Chips, n1 - rnd)) { this.playerActions.Call(player, ref raising, call, pot); } if (raise <= RoundN(player.Chips, n - rnd) && raise >= RoundN(player.Chips, n - rnd) / 2) { this.playerActions.Call(player, ref raising, call, pot); } if (raise <= RoundN(player.Chips, n - rnd) / 2) { if (raise > 0) { raise = RoundN(player.Chips, n - rnd); this.playerActions.Raise(player, ref raising, ref raise, ref call, pot); } else { raise = call * 2; this.playerActions.Raise(player, ref raising, ref raise, ref call, pot); } } } } if (call <= 0) { raise = RoundN(player.Chips, r - rnd); this.playerActions.Raise(player, ref raising, ref raise, ref call, pot); } } if (player.Chips <= 0) { player.FoldedTurn = true; } }
public void ProccessNextTurn(int call, IPot pot, ref double raise, ref bool isAnyPlayerRaise, CommunityCardBoard currentRound) { this.aiLogicProvider.HandleTurn(this, call, pot, ref raise, ref isAnyPlayerRaise, currentRound); }