Skip to content

Reference

tilttek/table-rules

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

Rules and versions

TypeRole
RuleOne house rule: identifier, title, text and category.
RulebookVersionOne published version: number, rules, variants, system, note, author, moment and whether it requires acceptance.
RulebookWhere a table's rules stand: the current version, the baseline, each player's last decision and the revision.
AcceptanceA player's last decision: the version, accepted or declined, and when.
DecisionAccepted or declined.
AcceptanceStatePending, accepted, outdated or declined.
TableRulesThe service: publish, accept, decline, forget, version, status, roster and comparison.

What changed

TypeRole
Diff\RulebookDifferCompares two versions.
Diff\RulebookDiffThe rules added, removed, changed and moved, the variants chosen and dropped, the system before and after.
Diff\RuleChangeA rule of both versions with another title, text or category, and the lines of its text.
Diff\LineChangeOne line of a text, kept, removed or added.
Diff\LineKindKept, removed or added.

Views

TypeRole
View\PlayerStatusWhere a player stands, and what changed since the version answered.
View\RosterViewWhere the players named stand, and how many are in each state.

Ports and stores

TypeRole
Contract\RulebookStoreKeeps each table's rulebook at a revision, and every version published.
Contract\TableRulesObserverTold of each fact once the rulebook is kept.
Contract\VariantCatalogueSays whether a game system offers a variant.
Catalogue\SystemVariantCatalogueThe catalogue of the rule variants of the tilttek/rpg-systems systems.
Store\InMemoryRulebookStoreThe rulebooks in memory, for tests.

Events

TypeRole
Event\RulesEventA fact of a table's rules, by identifiers only.
Event\RulebookPublishedA new version was published.
Event\RulesAcceptedA player accepted the version that holds.
Event\RulesDeclinedA player declined the version that holds.
Event\PlayerForgottenThe decision of a player was forgotten.

Exceptions

TypeRole
Exception\TableRulesExceptionEvery exception of the library.
Exception\InvalidRulesA value out of its shape or its bounds.
Exception\RulesRefusedA change not allowed on the rulebook in its state.
Exception\RulesNotFoundNo rules published, or no version of the number.
Exception\RulesConflictThe rulebook changed since it was read.

Internal

TypeRole
Internal\IdentifierThe shape of every identifier.
Internal\TextThe shape of titles, texts and notes, and their length.
Internal\LcsThe longest common subsequence of two lists of strings.