Class: Gamefic::Scene::Active

Inherits:
Base
  • Object
show all
Defined in:
lib/gamefic/scene/active.rb

Overview

Active Scenes handle the default command prompt, where input is parsed into an Action performed by the Character. This is the default scene in a Plot.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#prompt_for, #start, #type

Constructor Details

#initialize(plot) ⇒ Active

Returns a new instance of Active.



10
11
12
# File 'lib/gamefic/scene/active.rb', line 10

def initialize plot
  @plot = plot
end

Instance Attribute Details

#plotObject (readonly)

Returns the value of attribute plot.



8
9
10
# File 'lib/gamefic/scene/active.rb', line 8

def plot
  @plot
end

Instance Method Details

#finish(actor, input) ⇒ Object



14
15
16
17
# File 'lib/gamefic/scene/active.rb', line 14

def finish actor, input
  o = actor.perform input.strip
  actor.performed o
end