Class: Gamefic::Scene::Custom
- Inherits:
-
Base
- Object
- Base
- Gamefic::Scene::Custom
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.
Instance Method Summary
collapse
Methods inherited from Base
#data_class, #prompt_for, #type
Constructor Details
#initialize {|_self| ... } ⇒ Custom
Returns a new instance of Custom.
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
|