mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-07 14:57:48 +00:00
Advance in pool for previous matches
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
class PoolAdvance
|
||||
|
||||
def initialize(wrestler)
|
||||
def initialize(wrestler,previousMatch)
|
||||
@wrestler = wrestler
|
||||
@previousMatch = previousMatch
|
||||
end
|
||||
|
||||
def advanceWrestler
|
||||
@@ -29,10 +30,10 @@ class PoolAdvance
|
||||
end
|
||||
|
||||
def bracketAdvancment
|
||||
if @wrestler.winnerOfLastMatch?
|
||||
if @previousMatch.winner_id == @wrestler.id
|
||||
winnerAdvance
|
||||
end
|
||||
if !@wrestler.winnerOfLastMatch?
|
||||
if @previousMatch.winner_id != @wrestler.id
|
||||
loserAdvance
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user