summaryrefslogtreecommitdiff
path: root/lib/sampling/manual.rb
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-28 00:08:01 -0400
committernfoy <nfoy@purdue.edu>2014-04-28 00:08:01 -0400
commit1fb957aeb5c6eb8ec57ecf28b18479bb47093243 (patch)
tree387f8d4a5aebe7593dd6f09a0d277e1407facb36 /lib/sampling/manual.rb
parent952387be24043e76dfd9b7a461ee31d1246fa58e (diff)
parent6b66877bda4c0e4a33bb3109304636d5ada85904 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'lib/sampling/manual.rb')
-rw-r--r--lib/sampling/manual.rb21
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