public void UpdateHero(int id, Hero hero) { var heroToUpdate = heroList.Find(h => h.Id == id); heroToUpdate.Name = hero.Name; heroList[heroToUpdate.Id] = heroToUpdate; }
public void CreateHero(Hero hero) { hero.Id = heroList.Count == 0 ? 0 : heroList.Count; heroList.Add(hero); }