Ejemplo n.º 1
0
 protected Player(String name)
 {
     this.name = name;
     this.HasShowedThisRound = false;
     this.HudWindow          = null;
     this.IsPlaying          = false;
     this.HasPlayedLastRound = true;
     this.SeatNumber         = -1;           // Don't know
     this.GameID             = String.Empty; // Don't know
     this.totalHandsPlayed   = new ValueCounter();
 }
Ejemplo n.º 2
0
 protected Player(String name)
 {
     this.name = name;
     this.HasShowedThisRound = false;
     this.HudWindow = null;
     this.IsPlaying = false;
     this.HasPlayedLastRound = true;
     this.SeatNumber = -1; // Don't know
     this.GameID = String.Empty; // Don't know
     this.totalHandsPlayed = new ValueCounter();
 }
Ejemplo n.º 3
0
        public MultipleValueCounter(params object[] domains)
        {
            Trace.Assert(domains.Length <= MAX_DOMAINS, "You cannot initialize a multiplevaluecounter with more than " + MAX_DOMAINS + " domains");

            subdomains = null;
            table = new Hashtable(domains.Length);

            // Initialize
            foreach (int domain in domains)
            {
                table[domain] = new ValueCounter();
            }
        }
Ejemplo n.º 4
0
        public MultipleValueCounter(params object[] domains)
        {
            Trace.Assert(domains.Length <= MAX_DOMAINS, "You cannot initialize a multiplevaluecounter with more than " + MAX_DOMAINS + " domains");

            subdomains = null;
            table      = new Hashtable(domains.Length);

            // Initialize
            foreach (int domain in domains)
            {
                table[domain] = new ValueCounter();
            }
        }
Ejemplo n.º 5
0
        protected Player(Player other)
        {
            Trace.WriteLine("Cloning " + other.Name);

            // Copy members here
            this.name = other.Name;
            this.HasShowedThisRound = other.HasShowedThisRound;
            this.HudWindow = null;
            this.IsPlaying = other.IsPlaying;
            this.HasPlayedLastRound = other.HasPlayedLastRound;
            this.SeatNumber = other.SeatNumber;
            this.totalHandsPlayed = (ValueCounter)other.totalHandsPlayed.Clone();
            if (other.MuckedHand != null) this.MuckedHand = (Hand)other.MuckedHand.Clone();
        }
Ejemplo n.º 6
0
        public MultipleValueCounter(object[] domains, object[] subdomains)
        {
            Trace.Assert(domains.Length <= MAX_DOMAINS, "You cannot initialize a multiplevaluecounter with more than " + MAX_DOMAINS + " domains");

            table = new Hashtable(domains.Length * subdomains.Length);
            this.subdomains = subdomains;

            // Initialize
            foreach (int domain in domains)
            {
                foreach (int subdomain in subdomains)
                {
                    table[CalculateIndex(domain, subdomain)] = new ValueCounter();
                }
            }
        }
Ejemplo n.º 7
0
        public MultipleValueCounter(object[] domains, object[] subdomains)
        {
            Trace.Assert(domains.Length <= MAX_DOMAINS, "You cannot initialize a multiplevaluecounter with more than " + MAX_DOMAINS + " domains");

            table           = new Hashtable(domains.Length * subdomains.Length);
            this.subdomains = subdomains;

            // Initialize
            foreach (int domain in domains)
            {
                foreach (int subdomain in subdomains)
                {
                    table[CalculateIndex(domain, subdomain)] = new ValueCounter();
                }
            }
        }
Ejemplo n.º 8
0
        protected Player(Player other)
        {
            Trace.WriteLine("Cloning " + other.Name);

            // Copy members here
            this.name = other.Name;
            this.HasShowedThisRound = other.HasShowedThisRound;
            this.HudWindow          = null;
            this.IsPlaying          = other.IsPlaying;
            this.HasPlayedLastRound = other.HasPlayedLastRound;
            this.SeatNumber         = other.SeatNumber;
            this.totalHandsPlayed   = (ValueCounter)other.totalHandsPlayed.Clone();
            if (other.MuckedHand != null)
            {
                this.MuckedHand = (Hand)other.MuckedHand.Clone();
            }
        }
Ejemplo n.º 9
0
        // 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());
        }
Ejemplo n.º 10
0
        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();
        }