1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-08 23:34:51 +00:00

Generated bouts and rounds. Need to fix rounds for odd numbered pools.

This commit is contained in:
2015-02-03 10:41:49 -05:00
parent 7ea80b2997
commit 0244d15a8b
8 changed files with 62 additions and 24 deletions

View File

@@ -46,7 +46,8 @@ class Pool
end
def roundRobin(pool,tournament,weight_id)
@wrestlers = Wrestler.where(weight_id: weight_id, poolNumber: pool).to_a
@wrestlers = Wrestler.where(weight_id: weight_id, poolNumber: pool)
@wrestlers.sort_by{|x|[x.original_seed]}.to_a
@wrestlers.each_with_index do |w,index|
next_guy_index = index+1
while index < @wrestlers.length && next_guy_index < @wrestlers.length