void handHistoryParser_PlayerCalled(string playerName, float amount, HoldemGamePhase gamePhase) { HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName); if (p == null) { Trace.WriteLine("Call detected but the player is not in our list. Did he just join?"); return; } // If we are preflop if (gamePhase == HoldemGamePhase.Preflop) { // If the call is the same amount as the big blind, this is also a limp if (amount == BigBlindAmount) { PlayerLimpedPreflop = true; // HasLimped() makes further checks to avoid duplicate counts and whether the player is the big blind or small blind p.CheckForLimp(); } /* Steal raise opportunity */ if (p.IsButton && !PlayerRaisedPreflop && !PlayerLimpedPreflop && !PlayerCheckedPreflop) { p.IncrementOpportunitiesToStealRaise(); } /* Called a steal raise? */ else if (p.IsSmallBlind && PlayerStealRaisedPreflop) { p.IncrementCallsToAStealRaise(); } else if (p.IsBigBlind && PlayerStealRaisedPreflop && !SmallBlindReraisedAStealRaise) { p.IncrementCallsToAStealRaise(); } /* From the blind called a raise (but NOT to a reraise) ? */ if (p.IsBlind() && PlayerRaisedPreflop && !PlayerReRaisedPreflop) { p.IncrementCallsBlindToAPreflopRaise(); } } else if (gamePhase == HoldemGamePhase.Flop) { // Has somebody cbet? if (!PlayerRaisedTheFlop && PlayerCBet) { p.IncrementCallToACBet(); } } p.HasCalled(gamePhase); }
void handHistoryParser_PlayerFolded(string playerName, HoldemGamePhase gamePhase) { HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName); // On some clients, even if the player is sitting out they will make him automatically fold if (p == null) { Trace.WriteLine("Fold detected but the player is not in our list... is he sitting out?"); return; } if (gamePhase == HoldemGamePhase.Preflop) { /* Steal raise opportunity */ if (p.IsButton && !PlayerRaisedPreflop && !PlayerLimpedPreflop && !PlayerCheckedPreflop) { p.IncrementOpportunitiesToStealRaise(); } /* Folded to a steal raise? */ else if (p.IsSmallBlind && PlayerStealRaisedPreflop) { p.IncrementFoldsToAStealRaise(); } else if (p.IsBigBlind && PlayerStealRaisedPreflop && !SmallBlindReraisedAStealRaise) { p.IncrementFoldsToAStealRaise(); } /* Folded to a raise (but NOT to a reraise) ? */ if (p.IsBlind() && PlayerRaisedPreflop && !PlayerReRaisedPreflop) { p.IncrementFoldsBlindToAPreflopRaise(); } } // Has somebody cbet? else if (gamePhase == HoldemGamePhase.Flop && !PlayerRaisedTheFlop && PlayerCBet) { p.IncrementFoldToACBet(); } p.HasFolded(gamePhase); }
void handHistoryParser_PlayerRaised(string playerName, float raiseAmount, HoldemGamePhase gamePhase) { HoldemPlayer p = (HoldemPlayer)FindPlayer(playerName); if (p == null) { Trace.WriteLine("Raise detected but the player is not in our list. Did he just join?"); return; } if (gamePhase == HoldemGamePhase.Preflop) { /* If somebody already raised, this is a reraise */ if (PlayerRaisedPreflop) { PlayerReRaisedPreflop = true; } /* If this player is the button and he raises while nobody raised or limped before him * this is a good candidate for a steal raise */ if (p.IsButton && !PlayerRaisedPreflop && !PlayerLimpedPreflop && !PlayerCheckedPreflop) { p.IncrementOpportunitiesToStealRaise(); p.IncrementStealRaises(); PlayerStealRaisedPreflop = true; } /* re-raise to a steal raise? */ else if (p.IsSmallBlind && PlayerStealRaisedPreflop) { p.IncrementRaisesToAStealRaise(); SmallBlindReraisedAStealRaise = true; } else if (p.IsBigBlind && PlayerStealRaisedPreflop && !SmallBlindReraisedAStealRaise) { p.IncrementRaisesToAStealRaise(); } /* From the blind raised a raise (but NOT to a reraise) ? */ if (p.IsBlind() && PlayerRaisedPreflop && !PlayerReRaisedPreflop) { p.IncrementRaisesBlindToAPreflopRaise(); } PlayerRaisedPreflop = true; } else if (gamePhase == HoldemGamePhase.Flop) { // Has somebody cbet? if (!PlayerRaisedTheFlop && PlayerCBet) { p.IncrementRaiseToACBet(); } PlayerRaisedTheFlop = true; } p.HasRaised(gamePhase); }