Skip to content

Reference

tilttek/conditions

Every public type of the package, with its role. The types marked internal may change in any version.

The catalogue

TypeRole
ConditionCatalogueThe conditions of a game system, and the ones each brings.
ConditionDefinitionA condition: stacking, value, decay, modifiers, conditions brought and duration.
StackingWhat a new application does to one in place.
DecayHow a value falls at the affected character's turns.
DurationHow long a condition lasts, and what is left of it.
DurationKindRounds, game time, real time, or until removed.
BoundaryThe start or the end of a turn or a round.
AnchorWhose turns a duration counts: the target's, the source's, or the rounds.
ModifierWhat a condition does to one statistic.
OperationMultiply, add, upgrade, downgrade or override.

The conditions of a character

TypeRole
ConditionsThe service: apply, remove, set a value, turns, rounds, game time, expiry, view and effects.
CharacterConditionsA character's applications, the last tick counted and the version.
ActiveConditionOne application: instance, condition, value, source, duration left and end.
EndReasonRemoved, expired, decayed or replaced.
View\ConditionsViewA character's conditions to show the table, and the next end in real time.
View\ConditionStateOne condition in the view, applied or brought.

Effects

TypeRole
Effect\EffectCalculatorThe statistics once the modifiers are counted.
Effect\AppliedModifierA modifier in force, its condition and its amount.
Effect\StatValueA statistic's base, value and the modifiers that made the difference.
RoundingHow a multiplication rounds.

Ports and stores

TypeRole
Contract\ConditionStoreKeeps each character's conditions at a version.
Contract\ConditionObserverTold of the events of the conditions.
Store\InMemoryConditionStoreThe conditions in memory, for tests.

Events

TypeRole
Event\ConditionEventEvery event: the character, the instance and the condition.
Event\ConditionAppliedA condition was applied.
Event\ConditionChangedAn application changed.
Event\ConditionEndedAn application ended, and why.

Exceptions

TypeRole
Exception\ConditionsExceptionEvery exception of the library.
Exception\InvalidConditionA value out of its shape or its bounds.
Exception\ConditionRefusedA change the character's conditions do not allow.
Exception\ConditionNotFoundNo condition or instance has the identifier.
Exception\ConditionConflictThe conditions changed since they were read.

Internal

TypeRole
Internal\IdentifierThe shape of an identifier.
Internal\MillisInstants as milliseconds since the epoch.