public void UnselectEnemyHero(Hero hero) { if (hero == null) { return; } bool removed = false; for (int i = 0; i < PickedEnemies.Count; i++) { if (PickedEnemies[i].Hero == hero) { PickedEnemies.RemoveAt(i); removed = true; break; } } if (!removed) { return; } AvailableAllies.Add(new HeroSelectionViewModel(hero)); AvailableEnemies.Add(new HeroSelectionViewModel(hero)); Refresh(); }
private void UnbanHero(Hero hero) { if (hero == null) { return; } bool removed = false; for (int i = 0; i < Bans.Count; i++) { if (Bans[i] == hero) { Bans.RemoveAt(i); removed = true; break; } } if (!removed) { return; } AvailableAllies.Add(new HeroSelectionViewModel(hero)); AvailableEnemies.Add(new HeroSelectionViewModel(hero)); Refresh(); }
private void ReInit() { AvailableAllies.Clear(); AvailableEnemies.Clear(); PickedAllies.Clear(); PickedEnemies.Clear(); Bans.Clear(); if (_stats == null) { AvailableMaps = Array.Empty <Map>(); SelectedMap = null; TheoWinRate = null; return; } AvailableMaps = new [] { new Map(-1, "") }.Concat(_stats.Maps.Values).ToList(); foreach (var hero in _stats.Heroes.Values) { AvailableAllies.Add(new HeroSelectionViewModel(hero)); AvailableEnemies.Add(new HeroSelectionViewModel(hero)); } Refresh(); }