Class: Gamefic::Scene::MultipleScene
- Inherits:
-
MultipleChoice
- Object
- Base
- Custom
- MultipleChoice
- Gamefic::Scene::MultipleScene
- Defined in:
- lib/gamefic/scene/multiple_scene.rb
Instance Attribute Summary
Attributes inherited from MultipleChoice
#index, #invalid_message, #number, #selection
Attributes inherited from Base
#actor, #data, #input, #prompt, #type
Instance Method Summary collapse
Methods inherited from MultipleChoice
Methods inherited from Base
#[], #finished?, #initialize, #on_finish, on_start, #post_initialize, #start, start_block, subclass, #tracked=, #tracked?, tracked?, #update
Constructor Details
This class inherits a constructor from Gamefic::Scene::Base
Instance Method Details
#finish ⇒ Object
14 15 16 17 18 19 |
# File 'lib/gamefic/scene/multiple_scene.rb', line 14 def finish get_choice unless selection.nil? actor.prepare option_map[selection] end end |
#map(option, scene) ⇒ Object
9 10 11 12 |
# File 'lib/gamefic/scene/multiple_scene.rb', line 9 def map option, scene .push option option_map[option] = scene end |
#option_map ⇒ Object
3 4 5 |
# File 'lib/gamefic/scene/multiple_scene.rb', line 3 def option_map @option_map ||= {} end |
#state ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/gamefic/scene/multiple_scene.rb', line 21 def state entered = {} option_map.each_pair do |k, v| entered[k] = actor.entered?(v) end super.merge entered: entered end |