class CoopAl::ChapterGenerator

ChapterGenerator

Attributes

chapter[R]

Public Class Methods

new(name, description, adventure, bestiary) click to toggle source
# File lib/coop_al/chapter_generator.rb, line 8
def initialize(name, description, adventure, bestiary)
  @adventure = adventure
  @chapter = Chapter.new(name, description, adventure)
  @bestiary = bestiary
end

Public Instance Methods

encounter(name, &blk) click to toggle source
# File lib/coop_al/chapter_generator.rb, line 14
def encounter(name, &blk)
  generator = EncounterGenerator.new(name, @chapter, @bestiary)
  @chapter.add_encounter(generator.generate_encounter(&blk))
end
random(name, &blk) click to toggle source
# File lib/coop_al/chapter_generator.rb, line 19
def random(name, &blk)
  generator = RandomEncounterGenerator.new(name, @chapter, @bestiary)
  @chapter.add_encounter(generator.generate_encounter(&blk))
end