public List<PlayerHeroViewModel> GetHeroListForPlayerN(List<MatchDetail> matches, List<PlayerHeroViewModel> heroes, int playerIndex) { var affiliationHelper = new AffiliationHelper(); foreach (var match in matches) { try { var player = match.players[playerIndex]; var hero = heroes.Where(h => h.Name == player.hero.localized_name).FirstOrDefault(); if (hero != null) { ModifyHeroStatsBasedOnGame(match, player, hero); } else { hero = new PlayerHeroViewModel(player.hero.localized_name); ModifyHeroStatsBasedOnGame(match, player, hero); heroes.Add(hero); } } catch {} } return heroes; }
public List <PlayerHeroViewModel> GetHeroListForPlayerN(List <MatchDetail> matches, List <PlayerHeroViewModel> heroes, int playerIndex) { var affiliationHelper = new AffiliationHelper(); foreach (var match in matches) { try { var player = match.players[playerIndex]; var hero = heroes.Where(h => h.Name == player.hero.localized_name).FirstOrDefault(); if (hero != null) { ModifyHeroStatsBasedOnGame(match, player, hero); } else { hero = new PlayerHeroViewModel(player.hero.localized_name); ModifyHeroStatsBasedOnGame(match, player, hero); heroes.Add(hero); } } catch {} } return(heroes); }
public HeroHelper() { _affiliationHelper = new AffiliationHelper(); }