Module: Gamefic::World::Callbacks
- Included in:
- Gamefic::World
- Defined in:
- lib/gamefic/world/callbacks.rb
Instance Method Summary collapse
-
#before_player_update(&block) ⇒ Object
Add a block to be executed for each player before an update.
- #before_player_update_procs ⇒ Object
-
#on_player_conclude {|| ... } ⇒ Object
Add a block to be executed at the conclusion of the plot.
-
#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.
- #player_conclude_procs ⇒ Object
- #player_ready_procs ⇒ Object
- #player_update_procs ⇒ Object
- #ready_procs ⇒ Object
- #update_procs ⇒ Object
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/world/callbacks.rb', line 41 def before_player_update &block before_player_update_procs.push block end |
#before_player_update_procs ⇒ Object
75 76 77 |
# File 'lib/gamefic/world/callbacks.rb', line 75 def before_player_update_procs @before_player_update_procs ||= [] end |
#on_player_conclude {|| ... } ⇒ Object
Add a block to be executed at the conclusion of the plot.
55 56 57 |
# File 'lib/gamefic/world/callbacks.rb', line 55 def on_player_conclude &block player_conclude_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/world/callbacks.rb', line 34 def on_player_ready &block 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/world/callbacks.rb', line 48 def on_player_update &block 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/world/callbacks.rb', line 12 def on_ready &block 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/world/callbacks.rb', line 18 def on_update &block update_procs.push block end |
#player_conclude_procs ⇒ Object
59 60 61 |
# File 'lib/gamefic/world/callbacks.rb', line 59 def player_conclude_procs @player_conclude_procs ||= [] end |
#player_ready_procs ⇒ Object
71 72 73 |
# File 'lib/gamefic/world/callbacks.rb', line 71 def player_ready_procs @player_ready_procs ||= [] end |
#player_update_procs ⇒ Object
79 80 81 |
# File 'lib/gamefic/world/callbacks.rb', line 79 def player_update_procs @player_update_procs ||= [] end |
#ready_procs ⇒ Object
63 64 65 |
# File 'lib/gamefic/world/callbacks.rb', line 63 def ready_procs @ready_procs ||= [] end |
#update_procs ⇒ Object
67 68 69 |
# File 'lib/gamefic/world/callbacks.rb', line 67 def update_procs @update_procs ||= [] end |