Class: BCDice::GameSystem::FilledWith::D66Table

Inherits:
Object
  • Object
show all
Defined in:
lib/bcdice/game_system/FilledWith.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, rows) ⇒ D66Table

Returns a new instance of D66Table.



284
285
286
287
# File 'lib/bcdice/game_system/FilledWith.rb', line 284

def initialize(name, rows)
  @name = name
  @rows = rows
end

Instance Method Details

#roll(randomizer, difficality) ⇒ Object



289
290
291
292
293
294
# File 'lib/bcdice/game_system/FilledWith.rb', line 289

def roll(randomizer, difficality)
  value = randomizer.roll_d66(D66SortType::NO_SORT)
  chosen = @rows[value]

  "#{@name}<#{difficality.name}>(#{value}):#{chosen.format(difficality)}"
end