class Gamefic::Subplot


started and concluded at any time during the parent plot’s runtime.
Subplots are disposable plots that run inside a parent plot. They can be

def self.persist!

def self.persist!
  @persistent = true
end

def self.persistent?

def self.persistent?
  @persistent ||= false
end

def branch subplot_class = Gamefic::Subplot, introduce: [], **config

Returns:
  • (Gamefic::Subplot) -

Parameters:
  • config (Hash) -- Subplot configuration
  • introduce (Gamefic::Actor, Array, nil) -- Players to introduce
  • subplot_class (Class) -- The Subplot class

Other tags:
    Note: - A subplot's host is always the base plot, regardless of whether
def branch subplot_class = Gamefic::Subplot, introduce: [], **config
  plot.branch subplot_class, introduce: introduce, **config
end

def conclude

def conclude
  conclude_blocks.each(&:call)
  players.each do |plyr|
    player_conclude_blocks.each { |blk| blk[plyr] }
    uncast plyr
  end
  entities.each { |ent| destroy ent }
  @concluded = true
end

def concluding?

def concluding?
  return super unless persistent?
  @concluded
end

def config

def config
  Proxy::Config.new
end

def configure; end


options.
Subclasses can override this method to handle additional configuration
def configure; end

def initialize plot, introduce: [], **config

Parameters:
  • config (Hash) --
  • introduce (Gamefic::Actor, Array, nil) --
  • plot (Gamefic::Plot) --
def initialize plot, introduce: [], **config
  @plot = plot
  @config = config
  configure
  @config.freeze
  super()
  @concluded = false
  [introduce].flatten.each { |plyr| self.introduce plyr }
end

def inspect

def inspect
  "#<#{self.class}>"
end

def introduce(player)

def introduce(player)
  @concluded ? player : super
end

def persistent?

def persistent?
  self.class.persistent?
end

def prepare(...)

def prepare(...)
  super || plot.prepare(...)
end

def seeds

def seeds
  super - plot.seeds
end