public void SetUp()
 {
     _handHistory = new HandHistory()
     {
         CommunityCards =
             BoardCards.ForFlop(Card.GetCardFromIntValue(5), Card.GetCardFromIntValue(14),
                                Card.GetCardFromIntValue(40)),
         DateOfHandUtc        = new DateTime(2012, 3, 20, 12, 30, 44),
         DealerButtonPosition = 5,
         FullHandHistoryText  = "some hand text",
         GameDescription      =
             new GameDescriptor(PokerFormat.CashGame,
                                SiteName.PartyPoker,
                                GameType.NoLimitHoldem,
                                Limit.FromSmallBlindBigBlind(10, 20, Currency.USD),
                                TableType.FromTableTypeDescriptions(TableTypeDescription.Regular),
                                SeatType.FromMaxPlayers(6)),
         HandActions = new List <HandAction>()
         {
             new HandAction("Player1", HandActionType.POSTS, 0.25m, Street.Preflop)
         },
         HandId           = HandID.From(141234124),
         NumPlayersSeated = 2,
         Players          = new PlayerList()
         {
             new Player("Player1", 1000, 1),
             new Player("Player2", 300, 5),
         },
         TableName = "Test Table",
     };
 }
        protected override long[] ParseHandId(List <string> header)
        {
            var line  = header[0];
            var idStr = line.SubstringBetween(6, line.IndexOf(' ', 6));

            return(HandID.Parse(idStr));
        }
Example #3
0
        protected override long[] ParseHandId(string[] handLines)
        {
            //Game ID: 261402571 2/4 Braunite (Omaha)
            int endIndex = handLines[1].IndexOf(' ', GameIDStartIndex);
            var handId   = handLines[1].Substring(GameIDStartIndex, endIndex - GameIDStartIndex);

            return(HandID.Parse(handId));
        }
Example #4
0
        protected override long[] ParseHandId(JObject JSON)
        {
            var hand         = JSON["history"][0];
            var handIDString = hand["handId"].ToString();

            var items = handIDString.Split(new string[] { ".hand." }, StringSplitOptions.None);

            return(HandID.Parse(items));
        }
Example #5
0
        protected override long[] ParseHandId(List <string> header)
        {
            // Expect the first line to look like this:
            // "***** Hand History for Game 13550493674 *****"
            const int firstDigitIndex = 28;//"***** Hand History for Game ".Length

            string line   = header[0];
            string handId = line.SubstringBetween(firstDigitIndex, line.Length - 6);

            return(HandID.Parse(handId));
        }
        protected override long[] ParseHandId(string[] handLines)
        {
            // Full Tilt Poker Game #26862468195: Table Adornment (6 max, shallow) - $0.50/$1 - No Limit Hold'em - 16:09:19 ET - 2010/12/31
            string line = handLines[0];

            int hashIndex  = 21;
            int colonIndex = line.IndexOf(':', hashIndex);

            string handNumber = line.Substring(hashIndex + 1, colonIndex - hashIndex - 1);

            return(HandID.Parse(handNumber));
        }
        protected override long[] ParseHandId(string[] handLines)
        {
            //***** 888poker Hand History for Game 349736402 *****
            int    start      = GetHandStartIndex(handLines);
            string line       = handLines[start];
            int    endIndex   = line.LastIndexOf(' ');
            int    startIndex = line.LastIndexOf(' ', endIndex - 1);

            string idString = line.Substring(startIndex, endIndex - startIndex);

            return(HandID.Parse(idString));
        }
        protected override long[] ParseHandId(string[] handLines)
        {
            // Expect the first line to look like this:
            // "***** Hand History for Game 13550493674 *****"
            const int firstDigitIndex = 28;  //= "***** Hand History for Game ".Length

            string line           = handLines[0];
            int    lastDigitIndex = line.IndexOf(' ', firstDigitIndex);

            string handId = handLines[0].Substring(firstDigitIndex, lastDigitIndex - firstDigitIndex);

            return(HandID.Parse(handId));
        }
Example #9
0
        protected override long[] ParseHandId(string[] handLines)
        {
            foreach (var handLine in handLines)
            {
                var match = HandIdRegex.Match(handLine);
                if (match.Success)
                {
                    return(HandID.Parse(match.Value, '-'));
                }
            }

            throw new HandIdException(handLines[1], "Couldn't find handid");
        }
        public void PlayerNameWithSlashesAndSquareBrackets()
        {
            HandHistory expectedHand = new HandHistory()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.NoLimitHoldem,
                    Limit       = Limit.FromSmallBlindBigBlind(0.25m, 0.50m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(6),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Cap)
                },
                DateOfHandUtc        = new DateTime(2012, 9, 11, 12, 39, 12),
                DealerButtonPosition = 3,
                HandId           = HandID.From(86015904171),
                NumPlayersSeated = 4,
                TableName        = "Acamar IV CAP, Fast,20-50 bb"
            };

            var expectedActions = new List <HandAction>()
            {
                new HandAction("vitinja", HandActionType.SMALL_BLIND, 0.25m, Street.Preflop),
                new HandAction("/\\ntiHer[]", HandActionType.BIG_BLIND, 0.50m, Street.Preflop),
                new HandAction("Catharina111", HandActionType.CALL, 0.50m, Street.Preflop),
                new HandAction("Willo2319", HandActionType.CALL, 0.50m, Street.Preflop),
                new HandAction("vitinja", HandActionType.FOLD, 0m, Street.Preflop),
                new HandAction("/\\ntiHer[]", HandActionType.CHECK, 0, Street.Preflop),
                new HandAction("/\\ntiHer[]", HandActionType.BET, 1, Street.Flop),
                new HandAction("Catharina111", HandActionType.FOLD, 0m, Street.Flop),
                new HandAction("Willo2319", HandActionType.CALL, 1m, Street.Flop),
                new HandAction("/\\ntiHer[]", HandActionType.BET, 1.50m, Street.Turn),
                new HandAction("Willo2319", HandActionType.CALL, 1.50m, Street.Turn),
                new HandAction("/\\ntiHer[]", HandActionType.CHECK, 0m, Street.River),
                new HandAction("Willo2319", HandActionType.CHECK, 0m, Street.River),
                new HandAction("/\\ntiHer[]", HandActionType.SHOW, 0m, Street.Showdown),
                new HandAction("Willo2319", HandActionType.SHOW, 0m, Street.Showdown),
            };

            var expectedWinners = new List <WinningsAction>()
            {
                new WinningsAction("Willo2319", WinningsActionType.WINS, 6.45m, 0),
            };

            HandHistory actualHand = TestFullHandHistory(expectedHand, "PlayerNameWithSlashesAndSquareBrackets");

            Assert.AreEqual(expectedActions, actualHand.HandActions);
            Assert.AreEqual(expectedWinners, actualHand.Winners);
        }
        protected override long[] ParseHandId(string[] handLines)
        {
            // Line 1 is:
            // Winamax Poker - CashGame - HandId: #5276724-697-1382607755 - Holdem no limit (10€/20€) - 2013/10/24 09:42:35 UTC
            // the full handid is too long. The id contains 3 numbers: #Table-Hand-TotalWinamaxHand
            // for our purposes it should be enough to either use Table-Hand or TotalWinamaxHand
            // with regards to our standards for other sites we use Table-Hand as HandID

            int indexOfHandIdStart = handLines[0].IndexOf('#') + 1;
            int indexOfHandIdEnd   = handLines[0].IndexOf(" - ", indexOfHandIdStart + 9); // this makes sure to skip the first appearance of '-'

            string handNumber = handLines[0].Substring(indexOfHandIdStart, indexOfHandIdEnd - indexOfHandIdStart);

            return(HandID.Parse(handNumber, '-'));
        }
Example #12
0
        protected override long[] ParseHandId(string[] handLines)
        {
            string line = handLines[0];

            // 1st line is:
            //  ***** History for hand R5-244090560-4 *****

            char[] startChars = new char[] { 'R', 'T' };
            int    startIndex = line.IndexOfAny(startChars) + 1;
            int    endIndex   = line.IndexOf(' ', startIndex);

            string handNumber = line.Substring(startIndex, endIndex - startIndex);

            return(HandID.Parse(handNumber, '-'));
        }
Example #13
0
        public HandEntity(PlayerEntity player, HandID handId)
        {
            this.CurrentState = HandState.OnPlayer;
            this.HandId       = handId;
            this._player      = player;
            this.Velocity     = new Vector2();

            // Render
            _renderComponent = new RenderComponent("Character_Hand_Down", this);
            _renderComponent.LoadContent();
            _renderComponent.Scale = new Vector2(1.0f, 1.0f);



            this.chainTexture = GameManager.Instance.Content.Load <Texture2D>("Chain");

            this.Width  = 32f;
            this.Height = 32f;

            this.CollisionComponent = new BoxColliderComponent(this, this.Width / 2.0f, this.Height / 2.0f, Layers.NonStatic, Tags.PlayerHand);
        }
Example #14
0
        private void ReadGameInfo(HandHistory hand, JSON_gameinfo info)
        {
            var game  = ParseEnum <GameEnum>(info.game);
            var limit = ParseEnum <GameLimitEnum>(info.limit);

            hand.GameDescription.GameType = new GameType(limit, game, info.cap);

            var currency = ParseEnum <Currency>(info.currency);

            hand.GameDescription.Limit       = Limit.FromSmallBlindBigBlind(info.smallBlind, info.bigBlind, currency, info.ante != 0, info.ante);
            hand.GameDescription.PokerFormat = ParseEnum <PokerFormat>(info.format);
            hand.GameDescription.SeatType    = SeatType.FromMaxPlayers(info.maxSeats);
            hand.GameDescription.Site        = ParseEnum <SiteName>(info.site);

            hand.TableName            = info.tablename;
            hand.DateOfHandUtc        = GetFromUnixTime(info.date);
            hand.DealerButtonPosition = info.dealer;
            hand.HandId   = HandID.Parse(info.gameId, '.');
            hand.TotalPot = info.totalPot;
            hand.Rake     = info.rake;
        }
        public void ZoomHand()
        {
            HandHistorySummary expectedSummary = new HandHistorySummary()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.PotLimitOmaha,
                    Limit       = Limit.FromSmallBlindBigBlind(1m, 2m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(6),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Zoom)
                },
                DateOfHandUtc        = new DateTime(2014, 2, 21, 17, 45, 8),
                DealerButtonPosition = 1,
                HandId           = HandID.From(132630000000),
                NumPlayersSeated = 6,
                TableName        = "Diotima"
            };

            TestFullHandHistorySummary(expectedSummary, "ZoomHand");
        }
Example #16
0
        public void HandIssue1()
        {
            HandHistory expectedSummary = new HandHistory()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.NoLimitHoldem,
                    Limit       = Limit.FromSmallBlindBigBlind(5m, 10m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(6),
                    Site        = SiteName.IPoker,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
                },
                DateOfHandUtc        = new DateTime(2014, 1, 1, 22, 50, 13),
                DealerButtonPosition = 1,
                HandId           = HandID.From(987654),
                NumPlayersSeated = 5,
                TableName        = "Andreapol__No_DP_"
            };

            TestFullHandHistorySummary(expectedSummary, "DataMinerHandIssue1");
        }
        public void MucksHand()
        {
            HandHistory expectedHand = new HandHistory()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.PotLimitOmahaHiLo,
                    Limit       = Limit.FromSmallBlindBigBlind(0.05m, 0.10m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(6),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
                },
                DateOfHandUtc        = new DateTime(2012, 9, 11, 7, 51, 48),
                DealerButtonPosition = 4,
                HandId           = HandID.From(86008517721),
                NumPlayersSeated = 6,
                TableName        = "Muscida V 40-100 bb"
            };

            HandHistory actualHand = TestFullHandHistory(expectedHand, "MucksHand");
        }
        public void TableNameWithDash()
        {
            HandHistorySummary expectedSummary = new HandHistorySummary()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.PotLimitOmaha,
                    Limit       = Limit.FromSmallBlindBigBlind(25.0m, 50.00m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(2),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
                },
                DateOfHandUtc        = new DateTime(2011, 5, 19, 00, 41, 04),
                DealerButtonPosition = 1,
                HandId           = HandID.From(62279382715),
                NumPlayersSeated = 2,
                TableName        = "Isildur's PLO 50"
            };

            TestFullHandHistorySummary(expectedSummary, "TableNameWithDash");
        }
        public void DateIssue2()
        {
            HandHistorySummary expectedSummary = new HandHistorySummary()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.NoLimitHoldem,
                    Limit       = Limit.FromSmallBlindBigBlind(1.0m, 2.00m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(9),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Cap)
                },
                DateOfHandUtc        = new DateTime(2011, 5, 10, 11, 27, 21),
                DealerButtonPosition = 1,
                HandId           = HandID.From(61910233643),
                NumPlayersSeated = 7,
                TableName        = "Toutatis III"
            };

            TestFullHandHistorySummary(expectedSummary, "DateIssue2");
        }
        public void DateIssue1()
        {
            HandHistorySummary expectedSummary = new HandHistorySummary()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.NoLimitHoldem,
                    Limit       = Limit.FromSmallBlindBigBlind(0.50m, 1.00m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(6),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
                },
                DateOfHandUtc        = new DateTime(2011, 5, 7, 3, 51, 38),
                DealerButtonPosition = 4,
                HandId           = HandID.From(61777648755),
                NumPlayersSeated = 4,
                TableName        = "Tezcatlipoca III"
            };

            TestFullHandHistorySummary(expectedSummary, "DateIssue1");
        }
        public void PlayerWithColon()
        {
            HandHistorySummary expectedSummary = new HandHistorySummary()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.NoLimitHoldem,
                    Limit       = Limit.FromSmallBlindBigBlind(0.10m, 0.25m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(9),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
                },
                DateOfHandUtc        = new DateTime(2012, 7, 18, 16, 25, 8),
                DealerButtonPosition = 9,
                HandId           = HandID.From(83504515230),
                NumPlayersSeated = 9,
                TableName        = "Hygiea IV 40-100 bb"
            };

            TestFullHandHistorySummary(expectedSummary, "PlayerWithColon");
        }
        public void ShowsDownSingleCard()
        {
            HandHistory expectedHand = new HandHistory()
            {
                GameDescription = new GameDescriptor()
                {
                    PokerFormat = PokerFormat.CashGame,
                    GameType    = GameType.FixedLimitHoldem,
                    Limit       = Limit.FromSmallBlindBigBlind(1m, 2m, Currency.USD),
                    SeatType    = SeatType.FromMaxPlayers(6),
                    Site        = SiteName.PokerStars,
                    TableType   = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
                },
                DateOfHandUtc        = new DateTime(2012, 9, 11, 4, 15, 11),
                DealerButtonPosition = 1,
                HandId           = HandID.From(86005187865),
                NumPlayersSeated = 6,
                TableName        = "Stavropolis III 40-100 bb"
            };

            HandHistory actualHand = TestFullHandHistory(expectedHand, "ShowsDownSingleCard");

            Assert.IsTrue(actualHand.Players["Zaza5573"].hasHoleCards);
        }
Example #23
0
 public void ParseHandId_Works()
 {
     Assert.AreEqual(_expectedHandId, HandID.GetString(GetSummmaryParser().ParseHandId(_handText)), "IHandHistorySummaryParser: ParseHandId");
     Assert.AreEqual(_expectedHandId, HandID.GetString(GetParser().ParseHandId(_handText)), "IHandHistoryParser: ParseHandId");
 }
Example #24
0
        protected override long[] ParseHandId(string[] handLines)
        {
            string ID = GetXMLAttributeValue(handLines[0], "ID");

            return(HandID.Parse(ID));
        }
Example #25
0
    //Momento both hands
    public HandState(HandID hand)
    {
        handTracked = hand;

        currentState = GripState.open;
    }
Example #26
0
 protected override long[] ParseHandId(string[] handLines)
 {
     return(HandID.Parse(HandIdRegex.Match(handLines[0]).Value));
 }
Example #27
0
        protected override long[] ParseHandId(string[] handLines)
        {
            string handIdLine = handLines[0];

            return(HandID.Parse(GetAttribute(handIdLine, " id=\"")));
        }