class CoopAl::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
link_to(chapter)
click to toggle source
# File lib/coop_al/chapter_generator.rb, line 24 def link_to(chapter) @chapter.add_link(Path.absolute(@adventure.name, chapter)) end
link_to_downtime()
click to toggle source
# File lib/coop_al/chapter_generator.rb, line 28 def link_to_downtime @chapter.link_to_downtime 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