Пример #1
0
    /// <summary>
    ///
    /// Constructs the hero lookup dictionary. The hero lookup is used to construct the different combinations of heroes and abilities
    ///
    /// </summary>
    private void ConstructHeroLookup()
    {
        var tempHeroLookup = new Dictionary <Classes.ClassList, List <CardData> >();

        HeroLookup        = new Dictionary <HeroTier, UnitData>();
        HeroAbilityLookup = new Dictionary <HeroTier, AbilityData>();

        foreach (var cardClass in Enum.GetValues(typeof(Classes.ClassList)).Cast <Classes.ClassList>())
        {
            if (!InvalidClasses.Contains(cardClass))
            {
                //Obtain all the heroes for a particular class. Intersects the rarity lookup and the classlookup
                tempHeroLookup.Add(cardClass, RarityLookup[Rarity.Hero].Intersect(ClassLookup[cardClass]).ToList());

                foreach (var card in tempHeroLookup[cardClass])
                {
                    var heroCard = (UnitData)card;
                    var heroTier = new HeroTier()
                    {
                        HeroClass = cardClass, TierLevel = HeroTier.ConvertTierLevel(heroCard)
                    };
                    HeroLookup.Add(heroTier, heroCard);

                    var heroAbility = heroCard.Abilities.FirstOrDefault(); //Should only be one element in the hero ability list
                    HeroAbilityLookup.Add(heroTier, heroAbility);
                }
            }
        }
    }
Пример #2
0
 public TierLevel GetHeroTier()
 {
     return(HeroTier.ConvertTierLevel(this));
 }