the die manager
the stock element (should be an empty HTML Element)
Optional settings: DieStockSettingsProtected diceProtected elementthe stock element (should be an empty HTML Element)
Protected managerthe die manager
Optional onCalled when selection change. Returns the clicked die.
die: the clicked die (can be selected or unselected)
Optional onProtected selectedProtected selectionPrivate Optional settingsProtected Optional sortAdd an array of dice to the stock.
the dice to add
Optional animation: DieAnimationa DieAnimation object
Optional settings: AddDieSettingsa AddDiceettings object
if number, the number of milliseconds between each die. if true, chain animations
Add a die to the stock.
the die to add
Optional animation: DieAnimationa DieAnimation object
Optional settings: AddDieSettingsa AddDiceettings object
the promise when the animation is done (true if it was animated, false if it wasn't)
Protected addOptional settings: AddDieSettingsProtected addProtected animationThe element to animate. The element is added to the destination stock before the animation starts.
Protected bindProtected canChecks if the die can be added. By default, only if it isn't already present in the stock.
the die to add
Optional settings: AddDieSettingsthe addDie settings
if the die can be added
a die
if the die is present in the stock
Protected dieNotify the stock that a die is removed.
the die to remove
a die in the stock
the HTML element generated for the die
Protected getPrivate getthe selected dice
Protected moveOptional settings: AddDieSettingsProtected moveOptional settings: AddDieSettingsRemove a set of dice from the stock.
the dice to remove
Remove a die from the stock.
die die to remove
Optional settings: RollDieSettingsOptional settings: RollDieSettingsSet selected state to a die.
the die to select
Set the selectable class for each die.
Optional selectableDice: BgaDie[]the selectable dice. If unset, all dice are marked selectable. Default unset.
Protected setSet if the stock is selectable, and if yes if it can be multiple. If set to 'none', it will unselect all selected dice.
the selection mode
Optional selectableDice: BgaDie[]the selectable dice (all if unset). Calls setSelectableDice method
Set unselected state to a die.
the die to unselect
Generated using TypeDoc
The abstract stock. It shouldn't be used directly, use stocks that extends it.