Exemplo n.º 1
0
        public Models.Deck GetOpponentDeck()
        {
            var deck = new Models.Deck();

            if (Core.Game.IsRunning)
            {
                var game = Core.Game.CurrentGameStats;
                if (game != null && game.CanGetOpponentDeck)
                {
                    Log.Info("oppoent deck available");
                    // hero class
                    deck.Klass = KlassKonverter.FromString(game.OpponentHero);
                    // standard viable, use temp HDT deck
                    var hdtDeck = new HDTDeck();
                    foreach (var card in game.OpponentCards)
                    {
                        var c = Database.GetCardFromId(card.Id);
                        c.Count = card.Count;
                        hdtDeck.Cards.Add(c);
                        if (c != null && c != Database.UnknownCard)
                        {
                            deck.Cards.Add(
                                new Models.Card(c.Id, c.LocalizedName, c.Count, c.Background.Clone()));
                        }
                    }
                    deck.IsStandard = hdtDeck.StandardViable;
                }
            }
            return(deck);
        }
Exemplo n.º 2
0
        public List <ArchetypeDeck> GetAllArchetypeDecks()
        {
            var decks = DeckList.Instance.Decks
                        .Where(d => d.TagList.ToLowerInvariant().Contains("archetype"))
                        .ToList();
            var archetypes = new List <ArchetypeDeck>();

            foreach (var d in decks)
            {
                // get the newest version of the deck
                var v = d.VersionsIncludingSelf.OrderByDescending(x => x).FirstOrDefault();
                d.SelectVersion(v);
                if (d == null)
                {
                    continue;
                }
                var ad = new ArchetypeDeck(d.Name, KlassKonverter.FromString(d.Class), d.StandardViable);
                ad.Cards = d.Cards
                           .Select(x => new Models.Card(x.Id, x.LocalizedName, x.Count, x.Background.Clone()))
                           .ToList();
                archetypes.Add(ad);
            }
            return(archetypes);
        }
Exemplo n.º 3
0
 public void NonKlass_Should_Be_Any()
 {
     Assert.AreEqual(Klass.Any, KlassKonverter.FromString("Random String"));
 }
Exemplo n.º 4
0
 public void NullOrEmptyString_Should_Be_Any()
 {
     Assert.AreEqual(Klass.Any, KlassKonverter.FromString(string.Empty));
     Assert.AreEqual(Klass.Any, KlassKonverter.FromString(null));
 }
Exemplo n.º 5
0
 public void Warlockn_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Warlock, KlassKonverter.FromString("Warlock"));
 }
Exemplo n.º 6
0
 public void Warrior_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Warrior, KlassKonverter.FromString("Warrior"));
 }
Exemplo n.º 7
0
 public void Rogue_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Rogue, KlassKonverter.FromString("Rogue"));
 }
Exemplo n.º 8
0
 public void Shaman_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Shaman, KlassKonverter.FromString("Shaman"));
 }
Exemplo n.º 9
0
 public void Priest_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Priest, KlassKonverter.FromString("Priest"));
 }
Exemplo n.º 10
0
 public void Paladin_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Paladin, KlassKonverter.FromString("Paladin"));
 }
Exemplo n.º 11
0
 public void Mage_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Mage, KlassKonverter.FromString("Mage"));
 }
Exemplo n.º 12
0
 public void Hunter_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Hunter, KlassKonverter.FromString("Hunter"));
 }
Exemplo n.º 13
0
 public void Druid_Should_Be_Correct()
 {
     Assert.AreEqual(Klass.Druid, KlassKonverter.FromString("Druid"));
 }