Module: Gamefic::Plot::Callbacks
- Included in:
- Gamefic::Plot, Subplot
- Defined in:
- lib/gamefic/plot/callbacks.rb
Instance Method Summary collapse
-
#before_player_update(&block) ⇒ Object
Add a block to be executed for each player before an update.
-
#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
#before_player_update(&block) ⇒ Object
Add a block to be executed for each player before an update.
41 42 43 |
# File 'lib/gamefic/plot/callbacks.rb', line 41 def before_player_update &block p_before_player_update_procs.push block end |
#on_player_ready {|| ... } ⇒ Object
Add a block to be executed for each player at the beginning of a turn.
34 35 36 |
# File 'lib/gamefic/plot/callbacks.rb', line 34 def on_player_ready &block p_player_ready_procs.push block end |
#on_player_update {|| ... } ⇒ Object
Add a block to be executed for each player at the end of a turn.
48 49 50 |
# File 'lib/gamefic/plot/callbacks.rb', line 48 def on_player_update &block p_player_update_procs.push block end |
#on_ready(&block) ⇒ Object
Add a block to be executed on preparation of every turn.
12 13 14 |
# File 'lib/gamefic/plot/callbacks.rb', line 12 def on_ready &block p_ready_procs.push block end |
#on_update(&block) ⇒ Object
Add a block to be executed after the Plot is finished updating a turn.
18 19 20 |
# File 'lib/gamefic/plot/callbacks.rb', line 18 def on_update &block p_update_procs.push block end |