/// <summary> /// Remove this team from the schedule /// </summary> /// <param name="team">Team</param> public void DeleteTeam(Team team) { if (Teams.Contains(team)) { Teams.Remove(team); } }
public void RemoveTeam(Team t) { if (Teams.Contains(t)) { Teams.Remove(t); } }
public void AddTeam(Team t) { if (!Teams.Contains(t)) { Teams.Add(t); } }
public bool IsHaveTeam(Team team) { if (Teams.Contains(team)) { return(true); } return(false); }
protected internal virtual void AddTeam(SeasonTeam newTeam) { if (Teams == null) { Teams = new List <SeasonTeam>(); } if (!Teams.Contains(newTeam)) { Teams.Add(newTeam); } }
/// <summary> /// Create a team /// </summary> /// <param name="name">Name</param> /// <param name="description">Description</param> /// <param name="rotation">Shift rotation</param> /// <param name="rotationStart">Start of rotation</param> /// <returns>Team</returns> public Team CreateTeam(string name, string description, Rotation rotation, LocalDate rotationStart) { Team team = new Team(name, description, rotation, rotationStart); if (Teams.Contains(team)) { string msg = String.Format(WorkSchedule.GetMessage("team.already.exists"), name); throw new Exception(msg); } Teams.Add(team); team.WorkSchedule = this; return(team); }
public async Task OnGet() { var members = (await _repository.GetAllAsync <TeamMember>()) .OrderBy(m => m.TeamName); AllTeams = members.Select(m => m.TeamName) .Distinct(); if (Teams == null || !Teams.Any()) { Teams = Enumerable.Empty <string>(); TeamMembers = members; } else { TeamMembers = members.Where(m => Teams.Contains(m.TeamName)); } }
/// <summary> /// Gets every <see cref="Match"/> of a specified team. /// </summary> /// <param name="team">The team.</param> /// <param name="played">Optionnal; allows to filter on (non-)played matches only.</param> /// <param name="excludeExempt">Optionnal; excludes exempted matches.</param> /// <returns>Collection of <see cref="Match"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="team"/> is <c>Null</c>.</exception> /// <exception cref="ArgumentException"><paramref name="team"/> is not from this group.</exception> public IReadOnlyCollection <Match> GetTeamMatches(Team team, bool?played = null, bool excludeExempt = false) { if (team == null) { throw new ArgumentNullException(nameof(team)); } if (!Teams.Contains(team)) { throw new ArgumentException("Team is not from this group.", nameof(team)); } return(MatchDays .SelectMany(md => md.Matches.Where(m => m.IncludeTeam(team) && (!played.HasValue || played.Value == m.Played) && (!excludeExempt || !m.IsExempt))) .ToList()); }
private void GetUniqueTeams() { foreach (var match in Matches) { var currTeam1 = new Team { Name = match.Team1 }; var currTeam2 = new Team { Name = match.Team2 }; if (!Teams.Contains(currTeam1)) { Teams.Add(currTeam1); } if (!Teams.Contains(currTeam2)) { Teams.Add(currTeam2); } } }
public bool ContainsTeam(PvPTeam team) { return(Teams.Contains(team)); }
public Results TeamIsNotAdded(Guid teamId) => !Teams.Contains(teamId) ? Results.Unit : Results.TeamIsAlreadyAdded;