Skip to content

Reference

tilttek/character-sheet

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

Sheets

TypeRole
CharacterSheetsThe service: create, get, compute, rename, set an attribute or the level, put, equip and remove items, spend and restore charges, join and leave campaigns, set campaign fields, delete.
CharacterSheetA sheet: its owner, system, name, attributes, level, items, charges spent, campaign fields and version.
ItemA piece of equipment: its name, quantity, whether it is equipped, and what it gives to stats.
ChangeWhat changed on a sheet: its name, an attribute, its level, its equipment, its charges or a field.
SheetRulesThe rules of a system: its derived values in the order they are computed, its pools, its highest level.
FormulaA bounded whole-number formula: read, computed, and written back canonically.
SheetCalculatorComputes a sheet by its rules, with adjustments.
View\ComputedSheetA computed sheet: level, attributes, gear, derived values and pools, and every value by name.
View\PoolA pool as computed: its maximum, the charges spent and those left.

Ports and stores

TypeRole
Contract\SheetStoreKeeps the sheets at a version.
Contract\RuleBookGives the rules of each system.
Contract\SheetObserverTold of the events of a sheet.
Rules\StaticRuleBookThe rules of a fixed list of systems.
Store\InMemorySheetStoreThe sheets in memory, for tests.

Events

TypeRole
Event\SheetEventEvery event: the sheet's identifier.
Event\SheetCreatedA sheet was created, with its owner.
Event\SheetChangedSomething of a sheet changed, with what.
Event\CampaignJoinedA sheet joined a campaign.
Event\CampaignLeftA sheet left a campaign, whose fields were erased.
Event\SheetDeletedA sheet was erased.

Exceptions

TypeRole
Exception\CharacterSheetExceptionEvery exception of the library.
Exception\InvalidSheetA value out of its shape or its bounds.
Exception\InvalidFormulaA formula that cannot be read, checked or computed.
Exception\SheetRefusedA change not allowed on the sheet as it is.
Exception\SheetNotFoundNo such sheet, or no rules for its system.
Exception\SheetConflictThe sheet changed since it was read.

Internal

TypeRole
Internal\FormulaParserReads the text of a formula into its steps.
Internal\IdentifierThe shape of an identifier.
Internal\TextThe shape of a name, a key and a field text.