A new dice-roll-list component has been introduced.
This is a very generic component, which only defines a very basic contract for "rollable"-formula-representing list items.
A new damage-definition-list component has been introduced.
This is a composite component, which really only wraps the new dice-roll-list component and encapsulates the logic to roll multiple damage definitions at once.
While this component now allows easy re-use of a list of rollable damage definitions, it has a caveat: it expects an underlying TransientDocument instance to be provided, which holds an array of DamageAndType instances. So, in order to use this component, one must either provide a real or a mocked TransientDocument, which exposes a damage definitions array.
The logic to roll a SkillAbility's damage is now abstracted away by these two new components, which allows the skill-ability-list-item-viewmodel to become much smaller and more maintainable. Likewise, its corresponding template has also become smaller.
dice-roll-list
component has been introduced.damage-definition-list
component has been introduced.dice-roll-list
component and encapsulates the logic to roll multiple damage definitions at once.TransientDocument
instance to be provided, which holds an array ofDamageAndType
instances. So, in order to use this component, one must either provide a real or a mockedTransientDocument
, which exposes a damage definitions array.SkillAbility
's damage is now abstracted away by these two new components, which allows theskill-ability-list-item-viewmodel
to become much smaller and more maintainable. Likewise, its corresponding template has also become smaller.