private void CreateChampionshipStandings() { ChampionshipStandings.Clear(); foreach (var player in _dataView.Players) { if (player.Id < 0) { continue; } var championshipStanding = new ChampionshipStanding(player); foreach (ChallengeStanding challengeStanding in _allChallengeStandings.ChallengeStandings) { var playerPoints = challengeStanding.GetPlayerPoints(player.Id); championshipStanding.ChallengePoints.Add(playerPoints); } if (championshipStanding.TotalPoints > 0) { ChampionshipStandings.Add(championshipStanding); } } ChampionshipStandings.Sort(); for (var i = 0; i < ChampionshipStandings.Count; i++) { var championshipStanding = ChampionshipStandings[i]; championshipStanding.Position = (uint)i + 1; } }
private void PlayerController_OnPlayerSelectionChanged() { SelectedChampionshipStanding = null; foreach (var championshipStanding in ChampionshipStandings) { if (championshipStanding.Player != _playerController.SelectedPlayer) { continue; } SelectedChampionshipStanding = championshipStanding; break; } OnPropertyChanged(nameof(SelectedChampionshipStanding)); }