Module: BCDice::CommonCommand::AddDice

Defined in:
lib/bcdice/common_command/add_dice.rb,
lib/bcdice/common_command/add_dice/node.rb,
lib/bcdice/common_command/add_dice/parser.rb,
lib/bcdice/common_command/add_dice/randomizer.rb

Defined Under Namespace

Modules: Node Classes: Parser, Randomizer

Constant Summary collapse

PREFIX_PATTERN =
/[+\-(]*(\d+|D\d+)/.freeze

Class Method Summary collapse

Class Method Details

.eval(command, game_system, randomizer) ⇒ Object



13
14
15
16
# File 'lib/bcdice/common_command/add_dice.rb', line 13

def eval(command, game_system, randomizer)
  cmd = Parser.parse(command)
  cmd&.eval(game_system, randomizer)
end