lib/gamefic/response.rb in gamefic-3.3.0 vs lib/gamefic/response.rb in gamefic-3.4.0
- old
+ new
@@ -9,24 +9,21 @@
attr_reader :verb
# @return [Array<Query::Base>]
attr_reader :queries
- # @return [Narrative]
- attr_reader :narrative
-
# @param verb [Symbol]
# @param narrative [Narrative]
# @param queries [Array<Query::Base>]
# @param meta [Boolean]
# @param block [Proc]
def initialize verb, narrative, *queries, meta: false, &block
@verb = verb
- @narrative = narrative
@queries = map_queryable_objects(queries)
@meta = meta
@block = block
+ @callback = Callback.new(narrative, block)
end
# The `meta?` flag is just a way for authors to identify responses that
# serve a purpose other than performing in-game actions. Out-of-game
# responses can include features like displaying help documentation or
@@ -68,10 +65,10 @@
true
end
def execute *args
- Stage.run(narrative, *args, &@block)
+ @callback.run *args
end
def precision
@precision ||= calculate_precision
end