Class: Gamefic::Scene::Activity

Inherits:
Base show all
Defined in:
lib/gamefic/scene/activity.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, #data, #input, #prompt, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #finished?, #initialize, #on_finish, on_start, #start, start_block, #state, subclass, #tracked=, #tracked?, tracked?, #update

Methods included from Gamefic::Serialize

instances, #serialized_class, string_to_constant, #to_serial

Constructor Details

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

Class Method Details

.typeObject



19
20
21
# File 'lib/gamefic/scene/activity.rb', line 19

def type
  'Activity'
end

Instance Method Details

#finishObject



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

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

#post_initializeObject



7
8
9
# File 'lib/gamefic/scene/activity.rb', line 7

def post_initialize
  self.type = 'Activity'
end