Manually sort position of groups of 4 teams
This commit is contained in:
parent
0ded7bde1a
commit
8c39fa9894
|
|
@ -17,6 +17,13 @@ class GroupStageService
|
||||||
group_scores: team_array.map { |team| GroupScore.new team: team }
|
group_scores: team_array.map { |team| GroupScore.new team: team }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def deal_with_spacing_of_teams(matches, team_size)
|
||||||
|
if team_size == 4
|
||||||
|
matches[2].position, matches[4].position = matches[4].position, matches[2].position
|
||||||
|
matches
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def generate_all_matches_between(teams)
|
def generate_all_matches_between(teams)
|
||||||
matches = []
|
matches = []
|
||||||
teams.combination(2).to_a # = matchups
|
teams.combination(2).to_a # = matchups
|
||||||
|
|
@ -29,7 +36,7 @@ class GroupStageService
|
||||||
]
|
]
|
||||||
matches << match
|
matches << match
|
||||||
end
|
end
|
||||||
matches
|
deal_with_spacing_of_teams(matches, teams.size)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates all group_scores of the given group
|
# Updates all group_scores of the given group
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue