/* How many times has the player folded the blind to a steal raise? */ public Statistic GetFoldsToAStealRaiseStats(BlindType blindType) { int actionsToAStealRaise = (int)callsToAStealRaise[blindType].Value + (int)raisesToAStealRaise[blindType].Value + (int)foldsToAStealRaise[blindType].Value; String statDescription = String.Format("Fold {0} to a Steal Raise", (blindType == BlindType.BigBlind) ? "Big Blind" : "Small Blind"); if (actionsToAStealRaise == 0) return Statistic.CreateUnknown(statDescription, "Preflop"); else { float foldToAStealRaiseRatio = (float)foldsToAStealRaise[blindType].Value / (float)actionsToAStealRaise; return new Statistic(new StatisticsPercentageData(statDescription, foldToAStealRaiseRatio), "Preflop"); } }
// Clone protected HoldemPlayer(HoldemPlayer other) : base(other) { this.blindType = other.blindType; this.limps = (ValueCounter)other.limps.Clone(); this.limpsDetails = (MultipleValueCounter)other.limpsDetails.Clone(); this.voluntaryPutMoneyPreflop = (ValueCounter)other.limps.Clone(); this.raises = (MultipleValueCounter)other.raises.Clone(); this.raisesRatings = (MultipleValueCounter)other.raisesRatings.Clone(); this.bets = (MultipleValueCounter)other.bets.Clone(); this.betsRatings = (MultipleValueCounter)other.betsRatings.Clone(); this.calls = (MultipleValueCounter)other.calls.Clone(); this.callsRatings = (MultipleValueCounter)other.callsRatings.Clone(); this.folds = (MultipleValueCounter)other.folds.Clone(); this.opportunitiesToCBet = other.opportunitiesToCBet; this.cbets = (ValueCounter)other.cbets.Clone(); this.foldsToACBet = other.foldsToACBet; this.callsToACBet = other.callsToACBet; this.raisesToACBet = other.raisesToACBet; this.checks = (MultipleValueCounter)other.checks.Clone(); this.checksRatings = (MultipleValueCounter)other.checksRatings.Clone(); this.checkRaises = (MultipleValueCounter)other.checkRaises.Clone(); this.checksRaisesRatings = (MultipleValueCounter)other.checksRaisesRatings.Clone(); this.checkFolds = (MultipleValueCounter)other.checkFolds.Clone(); this.checkCalls = (MultipleValueCounter)other.checkCalls.Clone(); this.checksCallsRatings = (MultipleValueCounter)other.checksCallsRatings.Clone(); this.sawStreet = (MultipleValueCounter)other.sawStreet.Clone(); this.totalCalls = (Hashtable)other.totalCalls.Clone(); this.totalBets = (Hashtable)other.totalBets.Clone(); this.totalFolds = (Hashtable)other.totalFolds.Clone(); this.totalRaises = (Hashtable)other.totalRaises.Clone(); this.totalChecks = (Hashtable)other.totalChecks.Clone(); this.IsBigBlind = other.IsBigBlind; this.IsSmallBlind = other.IsSmallBlind; this.IsButton = other.IsButton; this.stealRaises = (ValueCounter)other.stealRaises.Clone(); this.opportunitiesToStealRaise = other.opportunitiesToStealRaise; this.foldsToAStealRaise = (MultipleValueCounter)other.foldsToAStealRaise.Clone(); this.callsToAStealRaise = (MultipleValueCounter)other.callsToAStealRaise.Clone(); this.raisesToAStealRaise = (MultipleValueCounter)other.raisesToAStealRaise.Clone(); this.wentToShowdown = (ValueCounter)other.wentToShowdown.Clone(); this.wonAtShowdown = (ValueCounter)other.wonAtShowdown.Clone(); this.pushedAllIn = (MultipleValueCounter)other.pushedAllIn.Clone(); this.totalAllIns = (ValueCounter)other.totalAllIns.Clone(); this.foldsBlindToAPreflopRaise = (MultipleValueCounter)other.foldsBlindToAPreflopRaise.Clone(); this.callsBlindToAPreflopRaise = (MultipleValueCounter)other.callsBlindToAPreflopRaise.Clone(); this.raisesBlindToAPreflopRaise = (MultipleValueCounter)other.raisesBlindToAPreflopRaise.Clone(); this.draws = (MultipleValueCounter)other.draws.Clone(); // Deep copy lists startingHandsWithPreflopCall = new List<HoldemHand>(); foreach (HoldemHand h in other.startingHandsWithPreflopCall) startingHandsWithPreflopCall.Add((HoldemHand)h.Clone()); startingHandsWithPreflopRaise = new List<HoldemHand>(); foreach (HoldemHand h in other.startingHandsWithPreflopRaise) startingHandsWithPreflopRaise.Add((HoldemHand)h.Clone()); startingHandsWithPreflopAllIn = new List<HoldemHand>(); foreach (HoldemHand h in other.startingHandsWithPreflopAllIn) startingHandsWithPreflopAllIn.Add((HoldemHand)h.Clone()); }
public Blind() { this.typeField = BlindType.None; this.amountField = ((decimal)(0.00m)); this.allInField = false; }
public HoldemPlayer(String playerName) : base(playerName) { blindType = BlindType.NoBlind; totalCalls = new Hashtable(5); totalBets = new Hashtable(5); totalFolds = new Hashtable(5); totalRaises = new Hashtable(5); totalChecks = new Hashtable(5); limps = new ValueCounter(); limpsDetails = new MultipleValueCounter(HoldemHand.Rating.Nothing, HoldemHand.Rating.Weak, HoldemHand.Rating.Mediocre, HoldemHand.Rating.Strong, HoldemHand.Rating.Monster); voluntaryPutMoneyPreflop = new ValueCounter(); raises = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); raisesRatings = new MultipleValueCounter(new object[] { HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River }, new object[] { HoldemHand.Rating.Nothing, HoldemHand.Rating.Weak, HoldemHand.Rating.Mediocre, HoldemHand.Rating.Strong, HoldemHand.Rating.Monster }); checkRaises = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); checksRaisesRatings = new MultipleValueCounter(new object[] { HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River }, new object[] { HoldemHand.Rating.Nothing, HoldemHand.Rating.Weak, HoldemHand.Rating.Mediocre, HoldemHand.Rating.Strong, HoldemHand.Rating.Monster }); checkFolds = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); checkCalls = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); checksCallsRatings = new MultipleValueCounter(new object[] { HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River }, new object[] { HoldemHand.Rating.Nothing, HoldemHand.Rating.Weak, HoldemHand.Rating.Mediocre, HoldemHand.Rating.Strong, HoldemHand.Rating.Monster }); checks = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); checksRatings = new MultipleValueCounter(new object[] { HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River }, new object[] { HoldemHand.Rating.Nothing, HoldemHand.Rating.Weak, HoldemHand.Rating.Mediocre, HoldemHand.Rating.Strong, HoldemHand.Rating.Monster }); sawStreet = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River, HoldemGamePhase.Showdown); bets = new MultipleValueCounter(HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); betsRatings = new MultipleValueCounter(new object[] { HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River }, new object[] { HoldemHand.Rating.Nothing, HoldemHand.Rating.Weak, HoldemHand.Rating.Mediocre, HoldemHand.Rating.Strong, HoldemHand.Rating.Monster }); folds = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); calls = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); callsRatings = new MultipleValueCounter(new object[] { HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River }, new object[] { HoldemHand.Rating.Nothing, HoldemHand.Rating.Weak, HoldemHand.Rating.Mediocre, HoldemHand.Rating.Strong, HoldemHand.Rating.Monster }); draws = new MultipleValueCounter(new object[] { HoldemGamePhase.Flop, HoldemGamePhase.Turn }, new object[] { HoldemPlayerAction.Bet, HoldemPlayerAction.Call, HoldemPlayerAction.Check, HoldemPlayerAction.CheckCall, HoldemPlayerAction.CheckFold, HoldemPlayerAction.CheckRaise, HoldemPlayerAction.Fold, HoldemPlayerAction.Raise }); cbets = new ValueCounter(); stealRaises = new ValueCounter(); foldsToAStealRaise = new MultipleValueCounter(BlindType.BigBlind, BlindType.SmallBlind); callsToAStealRaise = new MultipleValueCounter(BlindType.BigBlind, BlindType.SmallBlind); raisesToAStealRaise = new MultipleValueCounter(BlindType.BigBlind, BlindType.SmallBlind); wentToShowdown = new ValueCounter(); wonAtShowdown = new ValueCounter(); pushedAllIn = new MultipleValueCounter(HoldemGamePhase.Preflop, HoldemGamePhase.Flop, HoldemGamePhase.Turn, HoldemGamePhase.River); totalAllIns = new ValueCounter(); foldsBlindToAPreflopRaise = new MultipleValueCounter(BlindType.BigBlind, BlindType.SmallBlind); callsBlindToAPreflopRaise = new MultipleValueCounter(BlindType.BigBlind, BlindType.SmallBlind); raisesBlindToAPreflopRaise = new MultipleValueCounter(BlindType.BigBlind, BlindType.SmallBlind); startingHandsWithPreflopCall = new List<HoldemHand>(); startingHandsWithPreflopRaise = new List<HoldemHand>(); startingHandsWithPreflopAllIn = new List<HoldemHand>(); ResetAllStatistics(); }