Пример #1
0
        private float FindCardValue(List <HSReplayResultEntry> entries, Card.Cards card)
        {
            HSReplayResultEntry entry = entries.FirstOrDefault(x => x.CardId == card.ToString());

            if (entry == null)
            {
                Log(string.Format("Choice [{0}] doesn't have value in HSReplay datas", CardTemplate.LoadFromId(card).Name));
                return(0);
            }

            return(ComputeValue(entry.Popularity, entry.Winrate));
        }
Пример #2
0
        private NeutralMinion(Card.Cards NeutralMinionMulliganCard)
        {
            minionBoardCard = new BoardCard(NeutralMinionMulliganCard).IsClassCard() ||
                              NeutralMinionMulliganCard.ToString() == "GAME_005"
                ?
                              null
                :
                              new BoardCard(NeutralMinionMulliganCard);

            thisCardValue =
                minionBoardCard != null
                    ? MinionValue.SetCardValue(minionBoardCard)
                    : MinionValue.Value.NotANeutralMinion;

            if (minionBoardCard != null && MainLists.whiteList.Contains(minionBoardCard.ResultingBoardCard.Name))
            {
                thisCardValue = MinionValue.Value.InWhiteList;
            }
        }
Пример #3
0
        /// <summary>
        /// load obvious whitelist first to determine if Value.InWhiteList
        /// </summary>
        /// <param name="NeutralMinionBoardCard"></param>
        public NeutralMinion(CardTemplate NeutralMinionBoardCard)
        {
            Card.Cards NeutralMinionMulliganCardCard = BoardToMulliganCard(NeutralMinionBoardCard);

            minionBoardCard = NeutralMinionBoardCard.Class != Card.CClass.NONE ||
                              NeutralMinionMulliganCardCard.ToString() == "GAME_005"
                ?
                              null
                :
                              new BoardCard(NeutralMinionMulliganCardCard);

            thisCardValue =
                minionBoardCard != null?MinionValue.SetCardValue(minionBoardCard) :
                    MinionValue.Value.NotANeutralMinion;

            if (minionBoardCard != null && MainLists.whiteList.Contains(minionBoardCard.ResultingBoardCard.Name))
            {
                thisCardValue = MinionValue.Value.InWhiteList;
            }
        }
Пример #4
0
        public Card.Cards HandlePickDecision(Card.Cards originCard, List <Card.Cards> choices, Board board)
        {
            try
            {
                Parser HsReplayParser = new Parser();

                Log(string.Format("Trying to parse HSReplay for {0} in {1} mode ...", CardTemplate.LoadFromId(originCard).Name, Bot.CurrentMode()));

                var parsedResults = HsReplayParser.GetHSReplayResults(Database.Get.GetDbfIdFromCardId(originCard.ToString()), ConvertMode(Bot.CurrentMode()));

                Log("Datas parsed successfully !");

                /*foreach (var res in parsedResults)
                 * {
                 *  Log(res.CardId + " - Popularity : " + res.Popularity + " - Winrate :" + res.Winrate);
                 * }*/

                return(FindBestPick(parsedResults, choices));
            }
            catch (Exception e)
            {
                Log(e.ToString());
                return(Card.Cards.CRED_01);
            }
        }