Class: ParaDice::PolyBag

Inherits:
Object
  • Object
show all
Defined in:
lib/para_dice/poly_bag.rb

Overview

A ParaDice bag that has all of the standard dice: d6, d10, d10, and that you can add more like d33

Constant Summary collapse

DEFAULT_DICE =

contains all of the dice to start the bag with

[2, 3, 4, 6, 8, 10, 12, 20, 30, 100]
DEFAULT_READERS =

the result stack that Bag will pass by default to cups.

[Results::Number]

Class Method Summary collapse

Class Method Details

.get(rng = nil) ⇒ PolyBag

generate a new poly bag with optional rng

Parameters:

  • random (nil, Random, #rand)

    number generator to pass to all cups (which will in turn pass it to each)

Returns:



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/para_dice/poly_bag.rb', line 19

def self.get(rng = nil)
  a = ParaDice::Bag.new(name:            'Poly Dice',
                        rng:             rng,
                        default_readers: DEFAULT_READERS)

  DEFAULT_DICE.each do |num|
    die = NumberedDie.get(num)
    a.add_die(die)
  end
  return a
end