class Gamefic::Props::Default

A collection of data related to a scene. Scenes define which Props class they use. Props can be accessed in a scene’s on_start and on_finish callbacks.

Props::Default includes the most common attributes that a scene requires. Scenes are able but not required to subclass it. Some scenes, like MultipleChoice, use specialized Props subclasses, but in many cases, Props::Default is sufficient.

Attributes

context[R]

A freeform dictionary of objects related to the scene. Plots can pass opts to be included in the context when they cue scenes.

@return [Hash]

data[R]

A freeform dictionary of objects related to the scene. Plots can pass opts to be included in the context when they cue scenes.

@return [Hash]

input[RW]

@return [String]

prompt[W]

@return [String]

scene[R]

@return [Hash]

Public Class Methods

new(scene, **context) click to toggle source

@param scene [Scene] @param context [Hash]

# File lib/gamefic/props/default.rb, line 33
def initialize scene, **context
  @scene = { name: scene.name, type: scene.type }
  @context = context
end

Public Instance Methods

output() click to toggle source
# File lib/gamefic/props/default.rb, line 42
def output
  @output ||= Props::Output.new
end
prompt() click to toggle source
# File lib/gamefic/props/default.rb, line 38
def prompt
  @prompt ||= '>'
end