Skip to content

Reference

tilttek/encounter

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

Encounters

TypeRole
EncounterAn encounter: its game master, game system, title, participants in order, whether it was launched, its revision.
ParticipantOne line of an encounter: a character, or copies of an adversary or an ally, with its rating, controller, visibility, bonus and record.
KindCharacter, adversary or ally.
EncounterPlannerThe service: prepare, retitle, add, change, move, remove, assess, roster, launch and forget.
RulebooksThe rules of difficulty of each game system, found by its key or its GameSystem; read from the difficulty numbers of systems, with the application's own in their place.

Difficulty

TypeRole
Difficulty\AssessmentThe cost, the bands with their thresholds, and the band reached.
Difficulty\BandOne band of difficulty and its threshold.
Difficulty\BudgetRulesRules by budget: amounts by character level, costs by adversary challenge, multipliers by number.
Difficulty\LevelRulesRules by level: budgets for a standard party, adjustments by its size, costs by level difference.
Difficulty\MultiplierThe percentage the cost is multiplied by from a number of adversaries on.
Difficulty\DeclarationReads rules of difficulty from the difficulty numbers of a system, or from plain data.

Initiative

TypeRole
Initiative\InitiativeRosterWhat a tracker receives: the encounter, its game master, its system and its combatants in order.
Initiative\RosterEntryOne combatant: its identifier, participant, kind, controller, visibility, bonus and record.

Ports and stores

TypeRole
Contract\EncounterStoreKeeps each encounter at a revision.
Contract\EncounterObserverTold of each fact once the encounter is kept.
Contract\DifficultyRulesThe rules of difficulty of one game system.
Contract\InitiativeHandOffHands a launched encounter to an initiative tracker.
Store\InMemoryEncounterStoreThe encounters in memory, for tests.

Events

TypeRole
Event\EncounterEventA fact of an encounter, by identifiers only.
Event\EncounterPreparedA new encounter was prepared.
Event\EncounterRetitledIts title changed or was taken away.
Event\ParticipantAddedA participant was added.
Event\ParticipantChangedA participant was changed.
Event\ParticipantMovedA participant moved in the order.
Event\ParticipantRemovedA participant was removed.
Event\EncounterLaunchedThe encounter was launched.
Event\EncounterForgottenThe encounter was removed from the store.

Exceptions

TypeRole
Exception\EncounterExceptionEvery exception of the library.
Exception\InvalidEncounterA value out of its shape or its bounds.
Exception\EncounterRefusedA call not allowed on the encounter in its state.
Exception\EncounterNotFoundNo encounter of the identifier.
Exception\EncounterConflictThe encounter changed since it was read, or already exists.
Exception\UnknownSystemNo rules of difficulty for the game system.

Internal

TypeRole
Internal\IdentifierThe shape of an identifier.
Internal\RatingThe shape of a rating.
Internal\TextThe shape of a line of text.