Sha256: 373133ff313928020b80b37cac94f6b79f3c99f16ff5766d755d95da8be1b01d
Contents?: true
Size: 621 Bytes
Versions: 3
Compression:
Stored size: 621 Bytes
Contents
module Tester def test_procs @test_procs ||= Hash.new end def on_test name = :me, &block test_procs[name] = block end def run_test name, actor queue = [] test_procs[name].call(actor, queue) actor.queue.concat queue end end class Gamefic::Plot include Tester end class Gamefic::Subplot include Tester end Gamefic.script do meta :test, Gamefic::Query::Text.new do |actor, name| sym = name.to_sym if test_procs[sym].nil? actor.tell "There's no test named '#{name}' in this game." else run_test sym, actor end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gamefic-standard-2.4.0 | lib/gamefic-standard/test.rb |
gamefic-standard-2.3.1 | lib/gamefic-standard/test.rb |
gamefic-standard-2.3.0 | lib/gamefic-standard/test.rb |