Module: Gamefic::Plot::Host
- Included in:
- Gamefic::Plot
- Defined in:
- lib/gamefic/plot/host.rb
Overview
Methods for hosting and managing subplots.
Instance Method Summary collapse
-
#branch(subplot_class = Gamefic::Subplot, introduce: nil, next_cue: nil, **more) ⇒ Gamefic::Subplot
Start a new subplot based on the provided class.
-
#in_subplot?(player) ⇒ Boolean
Determine whether the player is involved in a subplot.
-
#subplots ⇒ Array<Subplot>
Get an array of all the current subplots.
-
#subplots_featuring(player) ⇒ Array<Subplot>
Get the player’s current subplots.
Instance Method Details
#branch(subplot_class = Gamefic::Subplot, introduce: nil, next_cue: nil, **more) ⇒ Gamefic::Subplot
Start a new subplot based on the provided class.
18 19 20 21 22 |
# File 'lib/gamefic/plot/host.rb', line 18 def branch subplot_class = Gamefic::Subplot, introduce: nil, next_cue: nil, **more subplot = subplot_class.new(self, introduce: introduce, next_cue: next_cue, **more) subplots.push subplot subplot end |
#in_subplot?(player) ⇒ Boolean
Determine whether the player is involved in a subplot.
38 39 40 |
# File 'lib/gamefic/plot/host.rb', line 38 def in_subplot? player !subplots_featuring(player).empty? end |