diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-29 03:42:03 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-29 03:42:03 -0400 |
commit | a3a72a54cc5742ffe82611fb87b3445c251d0676 (patch) | |
tree | 2976b8c2b6b082b8677ffb96a74170a771a89f46 /lib | |
parent | f9488b183bbd41d74d801a9cbdd41410be4ddba5 (diff) |
fix up Scoring::FibonacciPeerWithBlowout
Diffstat (limited to 'lib')
-rw-r--r-- | lib/scoring/fibonacci_peer_with_blowout.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/scoring/fibonacci_peer_with_blowout.rb b/lib/scoring/fibonacci_peer_with_blowout.rb index 21ffab1..f592540 100644 --- a/lib/scoring/fibonacci_peer_with_blowout.rb +++ b/lib/scoring/fibonacci_peer_with_blowout.rb @@ -1,13 +1,19 @@ module Scoring module FibonacciPeerWithBlowout def self.stats_needed - return [:votes] + return [:votes, :win, :blowout] end def self.score(match) scores = {} match.players.each do |player| - scores[player] = self.score_user(match.statistics.where(user: player, name: :votes).first, match.win?(player), match.blowout) + stats = Statistics.where(user: player, match: match) + + votes = stats.where(name: :votes ).first + win = stats.where(name: :win ).first + blowout = stats.where(name: :blowout).first + + scores[player] = self.score_user(votes, win, blowout) end scores end |