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

Attributes inherited from Base

#actor, #input, #prompt, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#flush, #initialize, initialize_block, #on_finish, on_initialize, #start, #state, subclass, #update

Constructor Details

This class inherits a constructor from Gamefic::Scene::Base

Class Method Details

.typeObject



20
21
22
# File 'lib/gamefic/scene/active.rb', line 20

def type
  'Active'
end

Instance Method Details

#finishObject



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

def finish
  super
  o = nil
  o = actor.perform input.strip unless input.nil?
  actor.performed o
end

#post_initializeObject



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

def post_initialize
  self.type = 'Active'
end