/// <summary> /// Change the meaning of 'home' from 'was the player playing in his own club' /// to 'is the player a member of TTC Erembodegem' /// </summary> private static void ChangeMeaningOfHomePlayer(Match match) { if (match.IsHomeMatch.HasValue) { foreach (var ply in match.Players) { ply.Home = IsOwnClubPlayer(match.IsHomeMatch.Value, ply.Home); } } }
private static void SetMatchPlayerAliases(Match match) { foreach (var ply in match.Players) { ply.Alias = GetFirstName(ply.Name); } // Fix in case two people are called 'Dirk' etc foreach (var ply in match.Players) { var otherPlayers = match.Players.Where(otherPly => ply.Position != otherPly.Position); if (otherPlayers.Any(otherPly => GetFirstName(otherPly.Alias) == ply.Alias)) { if (ply.Name.IndexOf(" ", StringComparison.InvariantCulture) != -1) { ply.Alias += ply.Name.Substring(ply.Name.IndexOf(" ", StringComparison.InvariantCulture)); } } } }