Class: Gamefic::Scene::Custom

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

Overview

A Custom Scene is a generic scene that allows for complete configuration of its behavior upon instantiation. It is suitable for direct instantiation or extension by other Scene classes.

Direct Known Subclasses

Conclusion, MultipleChoice, Pause, YesOrNo

Instance Method Summary collapse

Methods inherited from Base

#data_class, #prompt_for, #type

Constructor Details

#initialize {|_self| ... } ⇒ Custom

Returns a new instance of Custom.

Yields:

  • (_self)

Yield Parameters:



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

def initialize
  yield self if block_given?
end

Instance Method Details

#finish(actor, input) ⇒ Object



25
26
27
28
# File 'lib/gamefic/scene/custom.rb', line 25

def finish actor, input
  data = finish_data_for(actor, input)
  do_finish_block actor, data
end

#on_finish(&block) ⇒ Object



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

def on_finish &block
  @finish = block
end

#on_start(&block) ⇒ Object



11
12
13
# File 'lib/gamefic/scene/custom.rb', line 11

def on_start &block
  @start = block
end

#start(actor) ⇒ Object



19
20
21
22
23
# File 'lib/gamefic/scene/custom.rb', line 19

def start actor
  data = start_data_for(actor)
  do_start_block actor, data
  data
end