diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-28 00:04:30 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-28 00:04:30 -0400 |
commit | 33fcf6de9feaaa6f90dfe5082e08d280c930dae1 (patch) | |
tree | 236e6422575938e702fcc3d93906ef863e650499 /lib/sampling/manual.rb | |
parent | 2d7313767442956eab00671ac555c0ce4e583b5f (diff) |
Re-jigger the sampling interface
Diffstat (limited to 'lib/sampling/manual.rb')
-rw-r--r-- | lib/sampling/manual.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/sampling/manual.rb b/lib/sampling/manual.rb index b5c97c4..a190bd2 100644 --- a/lib/sampling/manual.rb +++ b/lib/sampling/manual.rb @@ -1,10 +1,10 @@ module Sampling - module Manual + class Manual def self.works_with?(game) return true end - def can_get?(user, setting_name) + def can_get?(setting_name) return 1 end @@ -20,12 +20,20 @@ module Sampling raise "This sampling method doesn't use remote usernames." end - def self.sampling_start(match, statistics) + #### + + def initialize(match) + @match = match + end + + def start # do nothing end - def self.render_user_interaction(match, user) - # TODO + def render_user_interaction(user) + @current_user = user + @users = @match.users + @stats = @match.stats_from(self.class) require 'erb' erb_filename = File.join(__FILE__.sub(/\.rb$/, '.svg.erb')) @@ -34,9 +42,8 @@ module Sampling return erb.result.html_safe end - def self.handle_user_interaction(match, user, sampling_params) + def handle_user_interaction(user, sampling_params) # TODO - #match.statistics.create(user: nil, name: "blowout", end end end |