Пример #1
0
        public static List <Card.Cards> HandleMulligan(List <Card.Cards> choices, Card.CClass opponentClass, Card.CClass ownClass)
        {
            InitMulligan(choices, opponentClass, ownClass);

            Task t_LoadGeneralBlackListEntries = Task.Run(() =>
            {
                LoadGeneralBlackListEntries(MainLists.OpponentClass, MainLists.OwnClass);
            });

            Task t_LoadOwnBlackListEntries = Task.Run(() =>
            {
                LoadOwnBlackListEntries();
            });

            t_LoadGeneralBlackListEntries.Wait();
            t_LoadOwnBlackListEntries.Wait();

            var detectedDeckType = DeckTypeDetector.SearchForDeckType();

            MainLists.CurrentDeckType = detectedDeckType;
            if (detectedDeckType == DeckTypeDetector.DeckType.UNKNOWN)
            {
                CreateDefaultLists();
            }
            else //particular deck type
            {
                MainLists.MaxManaCost = 3;
                DeckTypeDetector.GenerateWhiteAndBlackListForSpecialDeck(detectedDeckType);
            }

            CalculateMulligan(MainLists.MaxManaCost);
            foreach (Task task in neutralMinionTaskList)
            {
                task.Wait();
            }

            //DeckCalc
            CalculateDeckProbabilities();

            if (ValueReader.IsCoachModeEnabled &&
                File.Exists(Environment.CurrentDirectory + @"\De.TorstenMandelkow.MetroChart.dll"))
            {
                Thread t = new Thread(delegate()
                {
                    var cWind = new USER_GUI.CoachMode.CoachWindow
                    {
                        Title = $"Mulligan Coach for {MainLists.CurrentDeckType.ToString()}"
                    };
                    cWind.ShowDialog();
                });
                t.SetApartmentState(ApartmentState.STA);
                t.Start();
            }

            return(MainLists.chosenCards);
        }
Пример #2
0
        public static List<Card.Cards> HandleMulligan(List<Card.Cards> choices, Card.CClass opponentClass, Card.CClass ownClass)
        {
            InitMulligan(choices, opponentClass, ownClass);

            Task t_LoadGeneralBlackListEntries = Task.Run(() =>
            {
                LoadGeneralBlackListEntries(MainLists.OpponentClass, MainLists.OwnClass);
            });

            Task t_LoadOwnBlackListEntries = Task.Run(() =>
            {
                LoadOwnBlackListEntries();
            });

            t_LoadGeneralBlackListEntries.Wait();
            t_LoadOwnBlackListEntries.Wait();

            var detectedDeckType = DeckTypeDetector.SearchForDeckType();
            MainLists.CurrentDeckType = detectedDeckType;
            if (detectedDeckType == DeckTypeDetector.DeckType.UNKNOWN)
            {
                CreateDefaultLists();
            }
            else //particular deck type
            {
                MainLists.MaxManaCost = 3;
                DeckTypeDetector.GenerateWhiteAndBlackListForSpecialDeck(detectedDeckType);
            }

            CalculateMulligan(MainLists.MaxManaCost);
            foreach (Task task in neutralMinionTaskList)
            {
                task.Wait();
            }

            //DeckCalc
            CalculateDeckProbabilities();

            if (ValueReader.IsCoachModeEnabled &&
                File.Exists(Environment.CurrentDirectory + @"\De.TorstenMandelkow.MetroChart.dll"))
            {
                Thread t = new Thread(delegate ()
                {
                    var cWind = new USER_GUI.CoachMode.CoachWindow
                    {
                        Title = $"Mulligan Coach for {MainLists.CurrentDeckType.ToString()}"
                    };
                    cWind.ShowDialog();
                });
                t.SetApartmentState(ApartmentState.STA);
                t.Start();
            }

            return MainLists.chosenCards;
        }