Module: GamesDice
- Defined in:
- lib/games_dice.rb,
lib/games_dice/version.rb,
lib/games_dice/constants.rb
Defined Under Namespace
Classes: Bunch, ComplexDie, Dice, Die, DieResult, MapRule, Parser, Probabilities, RerollRule
Constant Summary collapse
- VERSION =
"0.3.10"
- REROLL_TYPES =
Reasons for making a reroll, and text explanation symbols for them
{ :basic => ',', :reroll_add => '+', :reroll_subtract => '-', :reroll_replace => '|', :reroll_use_best => '/', :reroll_use_worst => '\\', # These are not yet implemented: # :reroll_new_die => '*', # :reroll_new_keeper => '*', }
Class Method Summary collapse
-
.create(dice_description, prng = nil) ⇒ GamesDice::Dice
Creates an instance of GamesDice::Dice from a string description.
Class Method Details
.create(dice_description, prng = nil) ⇒ GamesDice::Dice
Creates an instance of GamesDice::Dice from a string description.
27 28 29 30 |
# File 'lib/games_dice.rb', line 27 def self.create dice_description, prng = nil parsed = @@parser.parse( dice_description ) GamesDice::Dice.new( parsed[:bunches], parsed[:offset], prng ) end |