class CoopAl::Chapter
Attributes
description[R]
encounters[R]
links[R]
name[R]
Public Class Methods
new(name, description, adventure)
click to toggle source
# File lib/coop_al/chapter.rb, line 8 def initialize(name, description, adventure) @name = name @description = description @adventure = adventure @encounters = [] @links = [] @links_to_downtime = false end
Public Instance Methods
absolute_path()
click to toggle source
# File lib/coop_al/chapter.rb, line 43 def absolute_path Path.Absolute(@adventure.name, @name) end
add_encounter(encounter)
click to toggle source
# File lib/coop_al/chapter.rb, line 21 def add_encounter(encounter) @encounters << encounter end
add_link(path)
click to toggle source
# File lib/coop_al/chapter.rb, line 25 def add_link(path) @links << path end
adventure_name()
click to toggle source
# File lib/coop_al/chapter.rb, line 17 def adventure_name @adventure.description end
follow(state, log)
click to toggle source
# File lib/coop_al/chapter.rb, line 37 def follow(state, log) @encounters.each do |encounter| encounter.run(state, log) end end
full_name()
click to toggle source
# File lib/coop_al/chapter.rb, line 47 def full_name @adventure.full_name + ' - ' + @description end
link_to_downtime()
click to toggle source
# File lib/coop_al/chapter.rb, line 29 def link_to_downtime @links_to_downtime = true end
links_to_downtime?()
click to toggle source
# File lib/coop_al/chapter.rb, line 33 def links_to_downtime? @links_to_downtime end