diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/tournament_stage.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/models/tournament_stage.rb b/app/models/tournament_stage.rb index 9fa6dcd..a3ee7df 100644 --- a/app/models/tournament_stage.rb +++ b/app/models/tournament_stage.rb @@ -22,6 +22,22 @@ class TournamentStage < ActiveRecord::Base return @scheduling.graph end + def pair + set_pairing + return @pairing.pair(matches, players) + end + + def score + set_scoring + #populating the user scores in the database form what you get from @scoring.score(match, interface) + end + + #populate the statistics interface (with populating method) + def populate + set_populating + #? + end + private def set_scheduling if @scheduling.nil? @@ -30,4 +46,26 @@ class TournamentStage < ActiveRecord::Base end return @scheduling end + + private + def set_pairing + if @pairing.nil? + if(@tournament.randomized_teams) + require "pairing/#{self.pairing}" + @pairing = "Pairing::RandomPairing" + return @pairing + #elsif(setTeams) + #@pairing = Pre built + #return @pairing + end + end + end + + private + def set_scoring + end + + private + def set_populating + end end |