From 42d6e3b1cc05ef5172081682b53675e4827254d3 Mon Sep 17 00:00:00 2001 From: tkimia Date: Tue, 29 Apr 2014 16:41:35 -0400 Subject: elimination works SOMETIMES... other times it just can't put down a damned winner --- lib/scoring/winner_takes_all.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/scoring/winner_takes_all.rb') diff --git a/lib/scoring/winner_takes_all.rb b/lib/scoring/winner_takes_all.rb index 9c83fb9..c807cba 100644 --- a/lib/scoring/winner_takes_all.rb +++ b/lib/scoring/winner_takes_all.rb @@ -1,22 +1,16 @@ module Scoring module WinnerTakesAll def self.stats_needed - #return ["win"] - ["win", "numDeaths", "turretsKilled", "championsKilled", "minionsKilled", "assists"] + return ["win"] end def self.score(match) scores = {} match.users.each do |user| stats = Statistic.where(user: user, match: match) - scores[user] = score_user(stats.where(name: "win").first.value) + scores[user] = stats.where(name: "win").first.value ? 1 : 0 end scores end - - private - def self.score_user(win) - win.nil? ? 0.5 : win ? 1 : 0 - end end end -- cgit v1.2.3