Esempio n. 1
0
        /// <summary>
        /// I just didn't know what the hell else to call it
        /// </summary>
        /// <param name="db"></param>
        public void FillTipsAndRelationships(DotADB db)
        {
            Tips = db.Tips.Where(t => t.HeroID == Hero.ID);
            if (!db.Settings.ShowDeprecatedTips)
            {
                Tips = Tips.Where(t => !t.Deprecated);
            }

            Relationships = db.Relationships.Where(r => r.IncludesHero(Hero.ID))
                            .Select(r => Casting.DownCast <Relationship, RelationshipViewModel>(r)
                                    .FillRelationships(db));

            if (!db.Settings.ShowDeprecatedRelationships)
            {
                Relationships = Relationships.Where(r => !r.Deprecated);
            }
        }
Esempio n. 2
0
 public HeroDetailViewModel(Hero hero, DotADB db)
 {
     Hero = hero;
     FillTipsAndRelationships(db);
 }
Esempio n. 3
0
 public HeroDetailViewModel(int heroID, DotADB db)
 {
     Hero = db.Heroes.FirstOrDefault(h => h.ID == heroID);
     FillTipsAndRelationships(db);
 }