Sha256: ec52fa2b499b912572f42ae8ce9b4a1db6f74057fbf04e4ab291e7b63f53dc1c
Contents?: true
Size: 621 Bytes
Versions: 10
Compression:
Stored size: 621 Bytes
Contents
require_relative "../metric.rb" module PlaylyfeClient module V2 class PointMetric < PlaylyfeClient::V2::Metric def apply_reward(reward, scores) metric_sym=self.id.to_sym case reward[:verb] when "add" scores[:points][metric_sym]+=reward[:value].to_i when "remove" scores[:points][metric_sym]-=reward[:value].to_i when "set" scores[:points][metric_sym]=reward[:value].to_i end end private def initialize(metric_hash, game) super(metric_hash, game) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems