ComparisonModifier
ComparisonModifier ⇐ Modifier
Abstract class
This is an abstract class and should not be used directly. You should use one of the extended classes, or extend the class yourself.
A ComparisonModifier is the base modifier class for comparing values.
Kind: global abstract class
Extends: Modifier
See
- ComparisonModifier ⇐
Modifier- new ComparisonModifier([comparePoint])
- .comparePoint ⇒
ComparePoint|undefined - .comparePoint
- .name ⇒
string - .notation ⇒
string - .defaultComparePoint(_context) ⇒
null - .defaults(_context) ⇒
object - .isComparePoint(value) ⇒
boolean - .toJSON() ⇒
Object
new ComparisonModifier([comparePoint])
Create a ComparisonModifier instance.
Throws:
TypeErrorcomparePointmust be an instance ofComparePointorundefined
| Param | Type | Description |
|---|---|---|
| [comparePoint] | ComparePoint | The comparison object |
comparisonModifier.comparePoint ⇒ ComparePoint | undefined
The compare point.
Kind: instance property of ComparisonModifier
comparisonModifier.comparePoint
Set the compare point.
Kind: instance property of ComparisonModifier
Throws:
TypeErrorvalue must be an instance ofComparePoint
| Param | Type |
|---|---|
| comparePoint | ComparePoint |
comparisonModifier.name ⇒ string
The name of the modifier.
Kind: instance property of ComparisonModifier
Returns: string - 'comparison'
comparisonModifier.notation ⇒ string
The modifier's notation.
Kind: instance property of ComparisonModifier
comparisonModifier.defaultComparePoint(_context) ⇒ null
Empty default compare point definition
Kind: instance method of ComparisonModifier
| Param | Type | Description |
|---|---|---|
| _context | StandardDice | RollGroup | The object that the modifier is attached to |
comparisonModifier.defaults(_context) ⇒ object
Eases processing of simple "compare point only" defaults
Kind: instance method of ComparisonModifier
| Param | Type | Description |
|---|---|---|
| _context | StandardDice | RollGroup | The object that the modifier is attached to |
comparisonModifier.isComparePoint(value) ⇒ boolean
Check whether value matches the compare point or not.
Kind: instance method of ComparisonModifier
Returns: boolean - true if the value matches, false otherwise
| Param | Type | Description |
|---|---|---|
| value | number | The value to compare with |
comparisonModifier.toJSON() ⇒ Object
Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of ComparisonModifier