Reference
tilttek/player-knowledgeEvery public type of the package, with its role. The types marked internal may change in any version.
Knowledge
| Type | Role |
|---|---|
Knowledge | The service: record, get, list, retitle and remove secrets; reveal, share, retract, forget; who knows, what a perspective learned, its snapshot, what a player knows out of character. |
Secret | A secret of a campaign: its title, its origin and its version. |
Origin | Where the text of a secret lives: a kind and a reference. |
Knower | A character, a player, every character or every player, and its key. |
KnowerKind | Character or player. |
Revelation | A secret revealed to a knower: when, by whom, how, in which session, from which character. |
Means | How a secret came to be known: told, discovered, handout or shared. |
Perspective | Whose knowledge a page reads: the game master, a character, a player at the table, a player. |
KnowledgeSnapshot | What a perspective knows of a campaign, read once: knows, knows all, since, filter. |
Ports and stores
| Type | Role |
|---|---|
Contract\KnowledgeStoreInterface | Keeps the secrets at a version and their revelations. |
Contract\KnowledgeObserverInterface | Told of the events of the knowledge of a campaign. |
Store\InMemoryKnowledgeStore | The secrets and revelations in memory, for tests. |
Events
| Type | Role |
|---|---|
Event\KnowledgeEventInterface | Every event. |
Event\SecretRecorded | A secret was recorded. |
Event\SecretChanged | The title or the origin of a secret changed. |
Event\SecretRemoved | A secret was erased, with its revelations. |
Event\SecretRevealed | A secret was revealed to knowers, by key, with the means. |
Event\RevelationRetracted | A revelation was taken back. |
Event\KnowerForgotten | Every revelation to a knower was erased. |
Exceptions
| Type | Role |
|---|---|
Exception\PlayerKnowledgeExceptionInterface | Every exception of the library. |
Exception\InvalidKnowledge | A value out of its shape or its bounds. |
Exception\KnowledgeRefused | A call well formed but not allowed. |
Exception\SecretNotFound | No secret has the identifier. |
Exception\KnowledgeConflict | What is kept changed since it was read. |
Internal
| Type | Role |
|---|---|
Internal\Identifier | The shape of an identifier. Internal. |
Internal\Text | The shape of a title. Internal. |