Class: CoopAl::StateReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/coop_al/state_reporter.rb

Overview

StateReporter

Instance Method Summary collapse

Constructor Details

#initialize(state, library, options = {}) ⇒ StateReporter

Returns a new instance of StateReporter.



6
7
8
9
10
11
12
13
# File 'lib/coop_al/state_reporter.rb', line 6

def initialize(state, library, options = {})
  @state = state
  @library = library
  @party_size = options.key?(:party_size) ? options[:party_size] : 6
  @show_xp = options.key?(:show_xp) ? options[:show_xp] : true
  @show_loot = options.key?(:show_loot) ? options[:show_loot] : true
  @show_paths = options.key?(:show_paths) ? options[:show_paths] : true
end

Instance Method Details

#report(s) ⇒ Object



15
16
17
18
19
# File 'lib/coop_al/state_reporter.rb', line 15

def report(s)
  report_xp(s) if @show_xp
  report_loot(s) if @show_loot
  report_paths(s) if @show_paths
end