summaryrefslogtreecommitdiff
path: root/lib/seeding/random_seeding.rb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-28 01:49:11 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-28 01:49:11 -0400
commit8abfaf4ce71dff7294424a7cb37efe4db5e0d581 (patch)
treec6ec47564ffa72c1acd5d577900e1ee1228f06d2 /lib/seeding/random_seeding.rb
parent85c74dac1f82dc1869a2875a9354be0b4b3361ac (diff)
Made Round Robin Work (but it makes too many rounds for 1v1s right now)
Diffstat (limited to 'lib/seeding/random_seeding.rb')
-rw-r--r--lib/seeding/random_seeding.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/seeding/random_seeding.rb b/lib/seeding/random_seeding.rb
index 36e06d6..ccdba11 100644
--- a/lib/seeding/random_seeding.rb
+++ b/lib/seeding/random_seeding.rb
@@ -1,12 +1,12 @@
module Seeding
module RandomSeeding
def self.seed(tournament_stage)
- matches = tournament.current_stage.matches
+ matches = tournament_stage.matches
match = matches.first
match_num = 0
teams = 0
- tournament.players.shuffle.each_slice(tournament.min_players_per_team) do |slice|
- if teams < tournament.min_teams_per_match
+ tournament_stage.tournament.players.shuffle.each_slice(tournament_stage.tournament.min_players_per_team) do |slice|
+ if teams < tournament_stage.tournament.min_teams_per_match
match.teams.push Team.create(players: slice)
teams += 1
else