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

new ComparisonModifier([comparePoint])

Create a ComparisonModifier instance.

Throws:

  • TypeError comparePoint must be an instance of ComparePoint or undefined
ParamTypeDescription
[comparePoint]ComparePointThe 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:

  • TypeError value must be an instance of ComparePoint
ParamType
comparePointComparePoint

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

ParamTypeDescription
_contextStandardDice | RollGroupThe object that the modifier is attached to

comparisonModifier.defaults(_context) ⇒ object

Eases processing of simple "compare point only" defaults

Kind: instance method of ComparisonModifier

ParamTypeDescription
_contextStandardDice | RollGroupThe 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

ParamTypeDescription
valuenumberThe 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