Class: Gamefic::Scene::MultipleChoice
- Defined in:
- lib/gamefic/scene/multiple_choice.rb
Overview
A scene that presents a list of choices and processes the player’s input. If the input is not a valid choice, the scene gets recued.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Default
Instance Method Summary collapse
- #finish(actor, props) ⇒ Object
- #run_finish_blocks(actor, props) ⇒ Object
- #start(actor, props) ⇒ Object
Methods inherited from Default
#conclusion?, #initialize, #new_props, #on_finish, #on_start, props_class, #run_start_blocks, #to_hash, #type
Constructor Details
This class inherits a constructor from Gamefic::Scene::Default
Instance Method Details
#finish(actor, props) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/gamefic/scene/multiple_choice.rb', line 16 def finish actor, props super return if props.index actor.tell format(props., input: props.input) actor.recue end |
#run_finish_blocks(actor, props) ⇒ Object
24 25 26 27 28 |
# File 'lib/gamefic/scene/multiple_choice.rb', line 24 def run_finish_blocks actor, props return unless props.index super end |
#start(actor, props) ⇒ Object
11 12 13 14 |
# File 'lib/gamefic/scene/multiple_choice.rb', line 11 def start actor, props super props.output[:options] = props. end |