Module: Gamefic::Scriptable::Events
- Included in:
- Narrative, Gamefic::Scriptable
- Defined in:
- lib/gamefic/scriptable/events.rb
Overview
Scriptable methods related to creating event callbacks.
Instance Method Summary collapse
- #on_conclude(&block) ⇒ Object
- #on_player_conclude {|| ... } ⇒ Proc
- #on_player_output {|, | ... } ⇒ Proc
-
#on_player_ready {|| ... } ⇒ Object
Add a block to be executed for each player at the beginning of a turn.
-
#on_player_update {|| ... } ⇒ Object
Add a block to be executed for each player at the end of a turn.
-
#on_ready(&block) ⇒ Object
Add a block to be executed on preparation of every turn.
-
#on_update(&block) ⇒ Object
Add a block to be executed after the Plot is finished updating a turn.
Instance Method Details
#on_conclude(&block) ⇒ Object
47 48 49 |
# File 'lib/gamefic/scriptable/events.rb', line 47 def on_conclude &block rulebook.events.on_conclude(&block) end |
#on_player_conclude {|| ... } ⇒ Proc
53 54 55 |
# File 'lib/gamefic/scriptable/events.rb', line 53 def on_player_conclude &block rulebook.events.on_player_conclude(&block) end |
#on_player_output {|, | ... } ⇒ Proc
60 61 62 |
# File 'lib/gamefic/scriptable/events.rb', line 60 def on_player_output &block rulebook.events.on_player_output(&block) end |
#on_player_ready {|| ... } ⇒ Object
Add a block to be executed for each player at the beginning of a turn.
30 31 32 |
# File 'lib/gamefic/scriptable/events.rb', line 30 def on_player_ready &block rulebook.events.on_player_ready(&block) end |
#on_player_update {|| ... } ⇒ Object
Add a block to be executed for each player at the end of a turn.
43 44 45 |
# File 'lib/gamefic/scriptable/events.rb', line 43 def on_player_update &block rulebook.events.on_player_update(&block) end |
#on_ready(&block) ⇒ Object
Add a block to be executed on preparation of every turn.
16 17 18 |
# File 'lib/gamefic/scriptable/events.rb', line 16 def on_ready &block rulebook.events.on_ready(&block) end |
#on_update(&block) ⇒ Object
Add a block to be executed after the Plot is finished updating a turn.
36 37 38 |
# File 'lib/gamefic/scriptable/events.rb', line 36 def on_update &block rulebook.events.on_update(&block) end |