diff options
Diffstat (limited to 'lib/scoring/winner_takes_all.rb')
-rw-r--r-- | lib/scoring/winner_takes_all.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/scoring/winner_takes_all.rb b/lib/scoring/winner_takes_all.rb index 57ddae6..9c83fb9 100644 --- a/lib/scoring/winner_takes_all.rb +++ b/lib/scoring/winner_takes_all.rb @@ -1,13 +1,15 @@ module Scoring module WinnerTakesAll def self.stats_needed - return ["win"] + #return ["win"] + ["win", "numDeaths", "turretsKilled", "championsKilled", "minionsKilled", "assists"] end - def self.score(match, interface) + def self.score(match) scores = {} - match.players.each do |player| - scores[player.user_name] = score_user(player.statistics.where(:match => match, :name => "win").value) + match.users.each do |user| + stats = Statistic.where(user: user, match: match) + scores[user] = score_user(stats.where(name: "win").first.value) end scores end |