Skip to content

Reference

tilttek/player-knowledge

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

Knowledge

TypeRole
KnowledgeThe 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.
SecretA secret of a campaign: its title, its origin and its version.
OriginWhere the text of a secret lives: a kind and a reference.
KnowerA character, a player, every character or every player, and its key.
KnowerKindCharacter or player.
RevelationA secret revealed to a knower: when, by whom, how, in which session, from which character.
MeansHow a secret came to be known: told, discovered, handout or shared.
PerspectiveWhose knowledge a page reads: the game master, a character, a player at the table, a player.
KnowledgeSnapshotWhat a perspective knows of a campaign, read once: knows, knows all, since, filter.

Ports and stores

TypeRole
Contract\KnowledgeStoreInterfaceKeeps the secrets at a version and their revelations.
Contract\KnowledgeObserverInterfaceTold of the events of the knowledge of a campaign.
Store\InMemoryKnowledgeStoreThe secrets and revelations in memory, for tests.

Events

TypeRole
Event\KnowledgeEventInterfaceEvery event.
Event\SecretRecordedA secret was recorded.
Event\SecretChangedThe title or the origin of a secret changed.
Event\SecretRemovedA secret was erased, with its revelations.
Event\SecretRevealedA secret was revealed to knowers, by key, with the means.
Event\RevelationRetractedA revelation was taken back.
Event\KnowerForgottenEvery revelation to a knower was erased.

Exceptions

TypeRole
Exception\PlayerKnowledgeExceptionInterfaceEvery exception of the library.
Exception\InvalidKnowledgeA value out of its shape or its bounds.
Exception\KnowledgeRefusedA call well formed but not allowed.
Exception\SecretNotFoundNo secret has the identifier.
Exception\KnowledgeConflictWhat is kept changed since it was read.

Internal

TypeRole
Internal\IdentifierThe shape of an identifier. Internal.
Internal\TextThe shape of a title. Internal.