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); }
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); }
public void NonKlass_Should_Be_Any() { Assert.AreEqual(Klass.Any, KlassKonverter.FromString("Random String")); }
public void NullOrEmptyString_Should_Be_Any() { Assert.AreEqual(Klass.Any, KlassKonverter.FromString(string.Empty)); Assert.AreEqual(Klass.Any, KlassKonverter.FromString(null)); }
public void Warlockn_Should_Be_Correct() { Assert.AreEqual(Klass.Warlock, KlassKonverter.FromString("Warlock")); }
public void Warrior_Should_Be_Correct() { Assert.AreEqual(Klass.Warrior, KlassKonverter.FromString("Warrior")); }
public void Rogue_Should_Be_Correct() { Assert.AreEqual(Klass.Rogue, KlassKonverter.FromString("Rogue")); }
public void Shaman_Should_Be_Correct() { Assert.AreEqual(Klass.Shaman, KlassKonverter.FromString("Shaman")); }
public void Priest_Should_Be_Correct() { Assert.AreEqual(Klass.Priest, KlassKonverter.FromString("Priest")); }
public void Paladin_Should_Be_Correct() { Assert.AreEqual(Klass.Paladin, KlassKonverter.FromString("Paladin")); }
public void Mage_Should_Be_Correct() { Assert.AreEqual(Klass.Mage, KlassKonverter.FromString("Mage")); }
public void Hunter_Should_Be_Correct() { Assert.AreEqual(Klass.Hunter, KlassKonverter.FromString("Hunter")); }
public void Druid_Should_Be_Correct() { Assert.AreEqual(Klass.Druid, KlassKonverter.FromString("Druid")); }