Module: BCDice::CommonCommand::Calc

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

Defined Under Namespace

Modules: Node Classes: Parser

Constant Summary collapse

PREFIX_PATTERN =
/C[+\-(]*\d+/.freeze

Class Method Summary collapse

Class Method Details

.eval(command, game_system, _randomizer) ⇒ Object



11
12
13
14
# File 'lib/bcdice/common_command/calc.rb', line 11

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