Class: Gamefic::Scene::Question
- Defined in:
- lib/gamefic/scene/question.rb
Overview
Question Scenes handle a string of arbitrary input. Examples include asking for a password, a destination, or a topic of conversation. The finish block is solely responsible for processing the answer. After the scene is finished, the :active scene will automatically be cued if no other scene has been cued or prepared.
Instance Method Summary collapse
- #finish(actor, input) ⇒ Object
-
#initialize(prompt, &block) ⇒ Question
constructor
A new instance of Question.
Methods inherited from Custom
Methods inherited from Base
Constructor Details
#initialize(prompt, &block) ⇒ Question
Returns a new instance of Question.
10 11 12 13 |
# File 'lib/gamefic/scene/question.rb', line 10 def initialize prompt, &block @prompt = prompt @finish = block end |
Instance Method Details
#finish(actor, input) ⇒ Object
14 15 16 17 18 |
# File 'lib/gamefic/scene/question.rb', line 14 def finish actor, input this_scene = actor.scene super actor.cue :active if (actor.scene == this_scene and actor.next_scene.nil?) end |