/// <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); } }
public HeroDetailViewModel(Hero hero, DotADB db) { Hero = hero; FillTipsAndRelationships(db); }
public HeroDetailViewModel(int heroID, DotADB db) { Hero = db.Heroes.FirstOrDefault(h => h.ID == heroID); FillTipsAndRelationships(db); }