Example #1
0
        public void CardIdCollisionDeck_ValidShortId()
        {
            var hearthDbDeck = DeckSerializer.Deserialize("AAEBAf0EHnGeAcABwwG7Au4CqwSWBewF9w2JDroWwxbXtgLrugLYuwLZuwKHvQLBwQKP0wKi0wLu9gKnggP1iQP8owOSpAO+pAO/pAPdqQP0qwMAAA==");
            var deck         = HearthDbConverter.FromHearthDbDeck(hearthDbDeck);
            var shortid      = ShortIdHelper.GetShortId(deck);

            Assert.AreEqual(shortid, "mA9O7wXvzxMsx1KO7EuFve");
        }
Example #2
0
        public void ComboPriest_ValidShortId()
        {
            var hearthDbDeck = DeckSerializer.Deserialize("AAECAa0GBqUJ+wzl9wLQ/gKnhwOppQMM+ALlBPYH1QjRCtIK8gz3DK+lA9KlA/2nA4SoAwA=");
            var deck         = HearthDbConverter.FromHearthDbDeck(hearthDbDeck);
            var shortid      = ShortIdHelper.GetShortId(deck);

            Assert.AreEqual(shortid, "0gsPp02q8ajKsGVstRwLpb");
        }
Example #3
0
        public void HighlanderHunter_ValidShortId()
        {
            var hearthDbDeck = DeckSerializer.Deserialize("AAECAR8engGoArUDxwOHBMkErgbFCNsJ7Qn+DJjwAp7wAu/xAqCAA6eCA5uFA/WJA+aWA/mWA76YA7acA56dA/yjA+WkA5+lA6KlA6alA4SnA5+3AwAA");
            var deck         = HearthDbConverter.FromHearthDbDeck(hearthDbDeck);
            var shortid      = ShortIdHelper.GetShortId(deck);

            Assert.AreEqual(shortid, "O2VpFDQokIrwww8iOmE3Lc");
        }
Example #4
0
        public void BasicMageDeck_ValidShortId()
        {
            var hearthDbDeck = DeckSerializer.Deserialize("AAECAf0EAA9NWtgBtAK7AosDqwS0BOAE+wSWBYoH7AeeCZYNAA==");
            var deck         = HearthDbConverter.FromHearthDbDeck(hearthDbDeck);
            var shortid      = ShortIdHelper.GetShortId(deck);

            Assert.AreEqual(shortid, "KtYDbAkM8IjSSyLMWQn5zb");
        }
Example #5
0
        private void SetUpWinrates()
        {
            Reset();
            var shortId = ShortIdHelper.GetShortId(DeckList.Instance.ActiveDeck);
            //check to see if shortId is in the hsreplay_decks.cache if so go get data
            var pos = Array.IndexOf(HsReplayDataManager.Decks.AvailableDecks, shortId);
            var has = pos >= 0;

            if (has)
            {
                _winrates = CreateWinRatesDictionary(shortId);
                foreach (int key in _winrates.Keys)
                {
                    Mulligan.Update(new Card(Cards.GetFromDbfId(key)), _winrates);
                }

                Mulligan = new MulliganView {
                    Label = { Visibility = Visibility.Hidden }
                };

                var label = new HearthstoneTextBlock
                {
                    FontSize      = 16,
                    TextAlignment = TextAlignment.Center,
                    Text          = "Deck Winrate: " + _deckWinrate
                };
                var margin = label.Margin;
                margin.Top   = 20;
                label.Margin = margin;
                Mulligan.Children.Add(label);
                _friendlyPanel.Children.Add(Mulligan);
                Mulligan.Visibility = Visibility.Visible;
                Mulligan.MulliganWinratesCardList.Visibility = Visibility.Visible;
                Mulligan.Label.Visibility = Visibility.Visible;
            }



            //foreach (var winrate in _winrates.Keys)
            //{
            //    Mulligan.Update(new Card(HearthDb.Cards.GetFromDbfId(winrate)),_winrates );
            //}
        }