Skip to content

Reference

tilttek/downtime

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

Rules

TypeRole
SystemRulesThe activities the rules of one game system declare, each key once.
ActivityAn activity: its name, days, costs, outcomes and resolution.
CostWhat an activity costs in one resource, once or for each day.
CostBasisOnce or per day.
OutcomeOne result an activity may end with: its label, text and effects.
EffectA gain or a loss in one resource.
ResolutionHow an activity ends: a fixed outcome, or the band its roll falls in.
BandThe totals of a roll that end an activity with one outcome.

The log

TypeRole
DowntimeThe service: choose, advance a campaign, record a roll, confirm, cancel, read a log and an entry.
EntryOne activity in the log of a character, with the days spent, the roll, the outcome and its stage.
StageQueued, awaiting its roll, resolved, confirmed or cancelled.

Ports and in-memory implementations

TypeRole
Contract\EntryStoreKeeps the entries at a version, all or none, and reads them in the order chosen.
Contract\RuleBookThe activities the rules of each system declare.
Contract\RosterWho runs a campaign and who plays each character.
Contract\RollerThe total of one roll of a dice expression.
Contract\DowntimeObserverTold of the events of the entries.
Rules\InMemoryRuleBookThe rules of the systems an application declares once.
Store\InMemoryEntryStoreThe entries in memory, for tests.

Events

TypeRole
Event\DowntimeEventEvery event: the entry, its campaign and its character.
Event\ActivityChosenA character chose an activity.
Event\ActivityProgressedDays were spent on an activity, and some remain.
Event\ActivityCompletedAll the days of an activity were spent, and its roll is awaited.
Event\ActivityResolvedAn activity ended with an outcome.
Event\ActivityConfirmedThe game master confirmed the outcome.
Event\ActivityCancelledAn activity was cancelled.

Exceptions

TypeRole
Exception\DowntimeExceptionEvery exception of the library.
Exception\InvalidDowntimeA value out of its shape or its bounds, or parts that do not agree.
Exception\UnknownActivityThe rules of the system declare no activity of the key.
Exception\DowntimeRefusedA change the service does not allow.
Exception\EntryNotFoundNo entry has the identifier.
Exception\DowntimeConflictAn entry changed since it was read.

Internal

TypeRole
Internal\IdentifierThe shape of an identifier and of a key, and the first value of a list that comes twice.
Internal\TextOne line or lines of text, checked and bounded.