Installation
tilttek/table-rulescomposer require tilttek/table-rules
The package needs PHP 8.5 or later, psr/clock, whose clock gives the service the time, and tilttek/rpg-systems,
whose game systems give the rule variants a version may choose.
An application gives TableRules:
- a
Contract\RulebookStorethat keeps each table's rulebook and every version published in its database; - a PSR-20
ClockInterface, such as theNativeClockofsymfony/clock; - a
Contract\TableRulesObserver, to send its messages, or nothing; - a
Contract\VariantCatalogueof the variants its game systems offer —Catalogue\SystemVariantCataloguereads those of itstilttek/rpg-systemssystems —, or nothing, to take any identifier as a variant; - a
Diff\RulebookDiffer, or the default.
The service and the comparer keep no state between calls, so one instance of each serves every request of a long-running worker.
Store\InMemoryRulebookStore keeps the rulebooks in memory, for tests.