private static void ValidateTeamCountAndPlayersCountPerTeam <TPlayer>( IEnumerable <IDictionary <TPlayer, Rating> > teams, TeamsRange totalTeams, PlayersRange playersPerTeam) { Guard.ArgumentNotNull(teams, "teams"); int countOfTeams = 0; foreach (var currentTeam in teams) { if (!playersPerTeam.IsInRange(currentTeam.Count)) { throw new ArgumentException(); } countOfTeams++; } if (!totalTeams.IsInRange(countOfTeams)) { throw new ArgumentException(); } }
protected SkillCalculator(SupportedOptions supportedOptions, TeamsRange totalTeamsAllowed, PlayersRange playerPerTeamAllowed) { _SupportedOptions = supportedOptions; _TotalTeamsAllowed = totalTeamsAllowed; _PlayersPerTeamAllowed = playerPerTeamAllowed; }