diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-22 18:17:13 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-22 18:17:13 -0400 |
commit | 7deb9c1c7acadf9a5b638313f51ba9dc60624672 (patch) | |
tree | 8493ff9d0f862e294b3f84ae695549ffd6e697f4 /lib/scoring/winner_takes_all.rb | |
parent | 266602ea1e97d886f031b80add7a760034221f76 (diff) |
made naming conventions consistent
Diffstat (limited to 'lib/scoring/winner_takes_all.rb')
-rw-r--r-- | lib/scoring/winner_takes_all.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/scoring/winner_takes_all.rb b/lib/scoring/winner_takes_all.rb new file mode 100644 index 0000000..ad2471b --- /dev/null +++ b/lib/scoring/winner_takes_all.rb @@ -0,0 +1,16 @@ +require 'ScoringAlgorithm' + +class WinnerTakesAll < ScoringAlgorithm + + def self.score(match, interface) + match.players.each do |player| + scores[player.user_name] = scoreUser(match.win?(player)) + end + scores + end + + + def self.score(win) + win.nil? ? 0.5 : win ? 1 : 0 + end +end
\ No newline at end of file |