void CreateHandAndTriggerEvent()
        {
            var hand = new ConvertedPokerHand(PokerSites.PokerStars, _gameId++, DateTime.Now, 30, 15, TotalSeats)
            {
                TotalSeats = TotalSeats,
                TableName  = TableName,
                HeroName   = Player1.Name,
                Board      = "Ah Ks Qh",
            };

            this.ForEach(p => {
                if (p.IsPresent && p.SeatNumber <= TotalSeats)
                {
                    var player = new ConvertedPokerPlayer(p.Name, 10, 10 + p.SeatNumber, p.SeatNumber - 1, TotalSeats, p.HoleCards)
                    {
                        SeatNumber = p.SeatNumber
                    };
                    player.Add(new ConvertedPokerRound().Add(new ConvertedPokerAction(ActionTypes.C, 1.0)));
                    player.Position = p.SeatNumber - 1;
                    player.SetStrategicPosition(TotalSeats);
                    hand.AddPlayer(player);
                }
                ;
            });

            Log.Debug(hand.ToString());

            _repository.InsertHand(hand);

            Log.Debug("Inserted into database");

            _eventAggregator
            .GetEvent <NewHandEvent>()
            .Publish(new NewHandEventArgs(PathToHandHistoryFile, hand));
        }
Exemple #2
0
        private static IConvertedPokerHand CreateSamplePokerHand(int index)
        {
            var player1 = new ConvertedPokerPlayer("player1", 10 + index, 5, 0, 6, "As Kd");

            player1.Add(new ConvertedPokerRound());
            player1[Streets.PreFlop].Add(new ConvertedPokerAction(ActionTypes.C, 0.2));
            player1.Add(new ConvertedPokerRound());
            player1[Streets.Flop].Add(new ConvertedPokerAction(ActionTypes.B, 0.3));
            player1.Add(new ConvertedPokerRound());
            player1[Streets.Turn].Add(new ConvertedPokerAction(ActionTypes.B, 0.5));
            player1[Streets.Turn].Add(new ConvertedPokerAction(ActionTypes.C, 0.4));
            player1.Add(new ConvertedPokerRound());
            player1[Streets.River].Add(new ConvertedPokerAction(ActionTypes.B, 0.9));

            var player2 = new ConvertedPokerPlayer("player2", 12 + index, 4, 1, 6, "9h Qd");

            player2.Add(new ConvertedPokerRound());
            player2[Streets.PreFlop].Add(new ConvertedPokerAction(ActionTypes.X, 1.0));

            var player3 = new ConvertedPokerPlayer("player3", 13 + index, 2, 2, 6, "?? ??");

            player3.Add(new ConvertedPokerRound());
            player3[Streets.PreFlop].Add(new ConvertedPokerAction(ActionTypes.C, 0.3));
            player3.Add(new ConvertedPokerRound());
            player3[Streets.Flop].Add(new ConvertedPokerAction(ActionTypes.C, 0.2));
            player3.Add(new ConvertedPokerRound());
            player3[Streets.Turn].Add(new ConvertedPokerAction(ActionTypes.R, 3.0));
            player3[Streets.Turn].Add(new ConvertedPokerAction(ActionTypes.C, 0.2));
            player3.Add(new ConvertedPokerRound());
            player3[Streets.River].Add(new ConvertedPokerAction(ActionTypes.C, 0.2));

            var player4 = new ConvertedPokerPlayer("player4", 14 + index, 4, 3, 6, "?? ??");

            player4.Add(new ConvertedPokerRound());
            player4[Streets.PreFlop].Add(new ConvertedPokerAction(ActionTypes.F, 1.0));

            var player5 = new ConvertedPokerPlayer("player5", 15 + index, 3, 4, 6, "?? ??");

            player5.Add(new ConvertedPokerRound());
            player5[Streets.PreFlop].Add(new ConvertedPokerAction(ActionTypes.C, 0.3));

            var player6 = new ConvertedPokerPlayer("player6", 16 + index, 14, 5, 6, "?? ??");

            player6.Add(new ConvertedPokerRound());
            player6[Streets.PreFlop].Add(new ConvertedPokerAction(ActionTypes.F, 1.0));

            var pokerHand = new ConvertedPokerHand("PokerStars", (ulong)(32084482 + index), DateTime.Now, 200, 100, 6);

            pokerHand.AddPlayer(player1);
            pokerHand.AddPlayer(player2);
            pokerHand.AddPlayer(player3);
            pokerHand.AddPlayer(player4);
            pokerHand.AddPlayer(player5);
            pokerHand.AddPlayer(player6);

            pokerHand.Ante         = 50;
            pokerHand.TournamentId = 1244353 + (ulong)index;
            pokerHand.Board        = "As Kd 9h 3h Qd";

            return(pokerHand);
        }