summaryrefslogtreecommitdiff
path: root/lib/scheduling/roundrobin.rb
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-25 11:20:29 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-25 11:20:29 -0400
commitc584cd3127ad47a9c093356aee46394c6b35cc3e (patch)
tree149940f8cd7e6465f40e429b0d14470edc84a808 /lib/scheduling/roundrobin.rb
parentd3cfd8683e842ce60ba339d6e6c7342738ec4cf8 (diff)
parent3a87a43fb993c08b780be484fa3d89bc3c568e64 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Conflicts: app/views/matches/show.html.erb
Diffstat (limited to 'lib/scheduling/roundrobin.rb')
-rw-r--r--lib/scheduling/roundrobin.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/scheduling/roundrobin.rb b/lib/scheduling/roundrobin.rb
new file mode 100644
index 0000000..e050c41
--- /dev/null
+++ b/lib/scheduling/roundrobin.rb
@@ -0,0 +1,24 @@
+
+module Scheduling
+ class RoundRobin
+ include Rails.application.routes.url_helpers
+
+ def initialize(tournament_stage)
+ @tournament_stage = tournament_stage
+ end
+
+ def create_matches
+ num_teams = (self.tournament.players.count/self.tournament.min_players_per_team).floor
+ num_matches = Float(num_teams/2)*(num_teams-1)
+
+ end
+
+ def match_finished(match)
+
+ end
+
+ def graph(current_user)
+
+ end
+ end
+end