From 8abfaf4ce71dff7294424a7cb37efe4db5e0d581 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 28 Apr 2014 01:49:11 -0400 Subject: Made Round Robin Work (but it makes too many rounds for 1v1s right now) --- lib/scheduling/round_robin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/scheduling') diff --git a/lib/scheduling/round_robin.rb b/lib/scheduling/round_robin.rb index f2e4144..a9defae 100644 --- a/lib/scheduling/round_robin.rb +++ b/lib/scheduling/round_robin.rb @@ -12,7 +12,7 @@ module Scheduling @matches_per_round = @num_teams * tournament.min_teams_per_match # => initialize data and status members - @team_pairs ||= {} + @team_pairs ||= Array.new if @team_pairs.empty? @matches_finished = 0 end @@ -25,7 +25,7 @@ module Scheduling # => seed the first time if @team_pairs.empty? tournament_stage.seeding.seed(tournament_stage) - tournament_stage.matches.each {|match| match.teams.each {|team| @team_pairs += team}} + tournament_stage.matches.each {|match| match.teams.each {|team| @team_pairs.push team}} else # => Reorder the list of teams top = @team_pairs.shift -- cgit v1.2.3-2-g168b