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/seeding/early_bird_seeding.rb | 6 +++--- lib/seeding/random_seeding.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/seeding') diff --git a/lib/seeding/early_bird_seeding.rb b/lib/seeding/early_bird_seeding.rb index 5c289ed..bf7b3c2 100644 --- a/lib/seeding/early_bird_seeding.rb +++ b/lib/seeding/early_bird_seeding.rb @@ -1,12 +1,12 @@ module Seeding module EarlyBirdSeeding def self.seed(tournament_stage) - matches = tournament.current_stage.matches + matches = tournament_stage.matches match = matches.first match_num = 0 teams = 0 - tournament.players.each_slice(tournament.min_players_per_team) do |slice| - if teams < tournament.min_teams_per_match + tournament_stage.tournament.players.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 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 -- cgit v1.2.3-2-g168b