Counter

Embodiment of a counter. Literally just a number with some ancillary metadata.

Constructors

this
this(string word)

Constructor. Only kept as a compatibility measure to ensure word always has a value. Remove later.

Members

Functions

resetEmptyPatterns
void resetEmptyPatterns()

Resets empty patterns with their default strings.

toJSON
auto toJSON()

Serialises this Counter into a JSON representation.

Static functions

fromJSON
auto fromJSON(JSONValue json)

Deserialises a Counter from a JSON representation.

Variables

count
long count;

Current count.

patternAssign
string patternAssign;

The pattern to use when formatting confirmations of counter assignments; e.g. "$word count was reset to $count!"

patternDecrement
string patternDecrement;

The pattern to use when formatting confirmations of counter decrements; e.g. "$word count was decreased by -$step and is now $count!".

patternIncrement
string patternIncrement;

The pattern to use when formatting confirmations of counter increments; e.g. "$word count was increased by +$step and is now $count!".

patternQuery
string patternQuery;

The pattern to use when formatting answers to counter queries; e.g. "The current $word count is currently $count.".

word
string word;

Counter word.