Example #1
0
        private PkResult Pk(HoldingHoles heroHoles, PlayerRangePkGrid villainGrid)
        {
            var pkResult = new PkResult();

            foreach (var fiveCards in _fiveCardsEnumerator.Invoke())
            {
                if (ConflictsWithVillainGrid(fiveCards, villainGrid.Grid))
                {
                    continue;
                }


                var conflictCards = new List <Card>(fiveCards);
                conflictCards.Add(heroHoles.Hole1);
                conflictCards.Add(heroHoles.Hole2);

                villainGrid.Grid.EliminateConflicts(conflictCards);

                var turnRiverPkResult = PkV2(heroHoles, villainGrid, fiveCards);

                pkResult.Add(turnRiverPkResult);
            }

            return(pkResult);
        }
Example #2
0
        public PkResult Pk(HoldingHoles heroHoles, VillainPkRange villainRange)
        {
            var pkResult = new PkResult();

            Parallel.ForEach(villainRange.Grids.EnumerateMultiDimensionalArray(), playerGrid =>
            {
                var gridPkResult = Pk(heroHoles, playerGrid);
                Logger.Instance.Log($"Pk finished between heroHoles {heroHoles.Hole1.GetStringForCard() + heroHoles.Hole2.GetStringForCard()}" +
                                    $" and {playerGrid.Grid}, result is {gridPkResult}");
                pkResult.Add(gridPkResult);
            });

            return(pkResult);
        }