diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-29 08:30:55 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-29 08:30:55 -0400 |
commit | f461002bef30b7bc1751917ab388be8d4eab37d8 (patch) | |
tree | 740fc3d0cdaa11102be221f4fca9bd32f3ab9484 /lib/scoring/winner_takes_all.rb | |
parent | 284da4d7e5badc0a1ad9dafc52672ab14168c91b (diff) |
fix scoring (mostly... I managed to get a 500 while refreshing)
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 |