/// <summary> /// Validates no more than the maximum percentage is made of the given role. Even if the maximum is less than or = 1, 1 player of any role is allowed. /// </summary> /// <param name="game"></param> /// <returns></returns> private bool ValidateRoleMaxPercentage(Game game) { foreach (Role r in game.GetPlayingRoles()) { int count = 0; foreach (Player p in game.Players) { if (p.Role.Equals(r)) count++; } int maxPercent = MathX.Percent(game.Players.Count, r.MaxPercentage); if (count > maxPercent && count > 1) { return false; } } return true; }