the die manager
the stock element (should be an empty HTML Element)
a SlotStockSettings
object
Protected
diceProtected
elementthe stock element (should be an empty HTML Element)
Protected
managerthe die manager
Protected
Optional
mapOptional
onCalled when selection change. Returns the clicked die.
die: the clicked die (can be selected or unselected)
Optional
onProtected
selectedProtected
selectionProtected
slotProtected
slotsProtected
slotsProtected
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: AddDieToSlotSettingsa AddDieToSlotSettings
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: AddDieToSlotSettingsthe addDie settings
if the die can be added
a die
if the die is present in the stock
Protected
createProtected
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
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
Change the slots ids. Will empty the stock before re-creating the slots.
the new slotsIds. Will replace the old ones.
Swap dice inside the slot stock.
the dice to swap
Optional
settings: AddDieSettingsfor updateInformations
and selectable
Set unselected state to a die.
the die to unselect
Generated using TypeDoc
A stock with fixed slots (some can be empty)