ComparisonModifier
Modifier
ComparisonModifier ⇐ 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:
TypeError
comparePoint
must be an instance ofComparePoint
orundefined
Param | Type | Description |
---|---|---|
[comparePoint] | ComparePoint | The comparison object |
ComparePoint
| undefined
comparisonModifier.comparePoint ⇒ The compare point.
Kind: instance property of ComparisonModifier
comparisonModifier.comparePoint
Set the compare point.
Kind: instance property of ComparisonModifier
Throws:
TypeError
value must be an instance ofComparePoint
Param | Type |
---|---|
comparePoint | ComparePoint |
string
comparisonModifier.name ⇒ The name of the modifier.
Kind: instance property of ComparisonModifier
Returns: string
- 'comparison'
string
comparisonModifier.notation ⇒ The modifier's notation.
Kind: instance property of ComparisonModifier
null
comparisonModifier.defaultComparePoint(_context) ⇒ Empty default compare point definition
Kind: instance method of ComparisonModifier
Param | Type | Description |
---|---|---|
_context | StandardDice | RollGroup | The object that the modifier is attached to |
object
comparisonModifier.defaults(_context) ⇒ 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 |
boolean
comparisonModifier.isComparePoint(value) ⇒ 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 |
Object
comparisonModifier.toJSON() ⇒ Return an object for JSON serialising.
This is called automatically when JSON encoding the object.
Kind: instance method of ComparisonModifier