Ejemplo n.º 1
0
func validatePlayersPerTeam(teams []skills.Team, playersAllowed numerics.Range) {
	for _, t := range teams {
		if n := t.PlayerCount(); !playersAllowed.In(n) {
			panic(fmt.Errorf("PlayerCount [%v] outside of expected range [%v]", n, playersAllowed))
		}
	}
}
Ejemplo n.º 2
0
func validateTeamCount(teams []skills.Team, teamsAllowed numerics.Range) {
	if n := len(teams); !teamsAllowed.In(n) {
		panic(fmt.Errorf("len(teams) [%v] outside of expected range [%v]", n, teamsAllowed))
	}
}