From 33fcf6de9feaaa6f90dfe5082e08d280c930dae1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 28 Apr 2014 00:04:30 -0400 Subject: Re-jigger the sampling interface --- lib/sampling/manual.rb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'lib/sampling/manual.rb') 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 -- cgit v1.2.3-2-g168b