Exemplo n.º 1
0
        private static void CalculateDeckProbabilities()
        {
            try
            {
                int normalMinionCount = MainLists.HandCards_BoardCards.Count(x => new NeutralMinion(x).minionBoardCard != null &&
                                                                             NeutralMinion.WouldTakeMinion(x) && !MainLists.whiteList.Contains(x.Id.ToString()));

                if (normalMinionCount == 0)
                {
                    return;
                }

                float minProbabilityToReplace = ValueReader.MinProbabilityToReplace;

                ProbabilityCalculation probabilityCalculation = new ProbabilityCalculation();
                Tuple <int, float>     treeResult             = probabilityCalculation.GenerateTreeWhiteListDraw();

                //less medium cards than actually having possible
                if (treeResult.Item1 /*prospective refused*/ < normalMinionCount)
                {
                    int deltaReplaceCount = normalMinionCount - treeResult.Item1;

                    int i = 1;
                    foreach (CardTemplate badCard in MainLists.HandCards_BoardCards.
                             Where(x => new NeutralMinion(x).minionBoardCard != null && NeutralMinion.WouldTakeMinion(x) &&
                                   !MainLists.whiteList.Contains(x.Id.ToString())).
                             OrderBy(x => new NeutralMinion(x).thisCardValue).TakeWhile(x => i <= deltaReplaceCount))
                    {
                        MainLists.chosenCards.Remove(BoardToMulliganCard(badCard));
                        ++i;
                    }
                }
            }
            catch
            {
                //Ignored
            }
        }
Exemplo n.º 2
0
        private static void CalculateDeckProbabilities()
        {
            try
            {
                int normalMinionCount = MainLists.HandCards_BoardCards.Count(x => new NeutralMinion(x).minionBoardCard != null &&
                    NeutralMinion.WouldTakeMinion(x) &&  !MainLists.whiteList.Contains(x.Id.ToString()));

                if (normalMinionCount == 0)
                    return;

                float minProbabilityToReplace = ValueReader.MinProbabilityToReplace;

                ProbabilityCalculation probabilityCalculation = new ProbabilityCalculation();
                Tuple<int, float> treeResult = probabilityCalculation.GenerateTreeWhiteListDraw();

                //less medium cards than actually having possible
                if (treeResult.Item1 /*prospective refused*/< normalMinionCount)
                {
                    int deltaReplaceCount = normalMinionCount - treeResult.Item1;

                    int i = 1;
                    foreach (CardTemplate badCard in MainLists.HandCards_BoardCards.
                        Where(x => new NeutralMinion(x).minionBoardCard != null && NeutralMinion.WouldTakeMinion(x) &&
                                   !MainLists.whiteList.Contains(x.Id.ToString())).
                        OrderBy(x => new NeutralMinion(x).thisCardValue).TakeWhile(x => i <= deltaReplaceCount))
                    {
                        MainLists.chosenCards.Remove(BoardToMulliganCard(badCard));
                        ++i;
                    }
                }
            }
            catch
            {
                //Ignored
            }
        }