Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
 protected SkillCalculator(SupportedOptions supportedOptions, TeamsRange totalTeamsAllowed, PlayersRange playerPerTeamAllowed)
 {
     _SupportedOptions      = supportedOptions;
     _TotalTeamsAllowed     = totalTeamsAllowed;
     _PlayersPerTeamAllowed = playerPerTeamAllowed;
 }