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.



280
281
282
283
# File 'lib/bcdice/game_system/FilledWith.rb', line 280

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

Instance Method Details

#roll(randomizer, difficality) ⇒ Object



285
286
287
288
289
290
# File 'lib/bcdice/game_system/FilledWith.rb', line 285

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

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