Reference
tilttek/character-sheetEvery public type of the package, with its role. The types marked internal may change in any version.
Sheets
| Type | Role |
|---|---|
CharacterSheets | The 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. |
CharacterSheet | A sheet: its owner, system, name, attributes, level, items, charges spent, campaign fields and version. |
Item | A piece of equipment: its name, quantity, whether it is equipped, and what it gives to stats. |
Change | What changed on a sheet: its name, an attribute, its level, its equipment, its charges or a field. |
SheetRules | The rules of a system: its derived values in the order they are computed, its pools, its highest level. |
Formula | A bounded whole-number formula: read, computed, and written back canonically. |
SheetCalculator | Computes a sheet by its rules, with adjustments. |
View\ComputedSheet | A computed sheet: level, attributes, gear, derived values and pools, and every value by name. |
View\Pool | A pool as computed: its maximum, the charges spent and those left. |
Ports and stores
| Type | Role |
|---|---|
Contract\SheetStore | Keeps the sheets at a version. |
Contract\RuleBook | Gives the rules of each system. |
Contract\SheetObserver | Told of the events of a sheet. |
Rules\StaticRuleBook | The rules of a fixed list of systems. |
Store\InMemorySheetStore | The sheets in memory, for tests. |
Events
| Type | Role |
|---|---|
Event\SheetEvent | Every event: the sheet's identifier. |
Event\SheetCreated | A sheet was created, with its owner. |
Event\SheetChanged | Something of a sheet changed, with what. |
Event\CampaignJoined | A sheet joined a campaign. |
Event\CampaignLeft | A sheet left a campaign, whose fields were erased. |
Event\SheetDeleted | A sheet was erased. |
Exceptions
| Type | Role |
|---|---|
Exception\CharacterSheetException | Every exception of the library. |
Exception\InvalidSheet | A value out of its shape or its bounds. |
Exception\InvalidFormula | A formula that cannot be read, checked or computed. |
Exception\SheetRefused | A change not allowed on the sheet as it is. |
Exception\SheetNotFound | No such sheet, or no rules for its system. |
Exception\SheetConflict | The sheet changed since it was read. |
Internal
| Type | Role |
|---|---|
Internal\FormulaParser | Reads the text of a formula into its steps. |
Internal\Identifier | The shape of an identifier. |
Internal\Text | The shape of a name, a key and a field text. |