Skip to content

Reference

tilttek/initiative-cards

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

Encounters

TypeRole
InitiativeTrackerThe service: start, deal, end a turn, join, leave, defeat, revive, hide, reveal, end and view.
EncounterAn encounter: its game master, deck, piles, combatants in turn order, round and version.
CombatantOne combatant: its controller, whether it is hidden or defeated, its draws, its card and whether it acted.
StandardRankingThe ranking of the 52-card deck and its jokers, with an order of the suits.
View\InitiativeViewWhat one viewer may see of an encounter.
View\SlotOne combatant as a viewer sees it.

Ports and stores

TypeRole
Contract\EncounterStoreKeeps the encounters at a version.
Contract\CardRankingOrders the faces of a deck, and says which reshuffle.
Contract\InitiativeObserverTold of the events of an encounter.
Store\InMemoryEncounterStoreThe encounters in memory, for tests.

Events

TypeRole
Event\InitiativeEventEvery event: the encounter.
Event\CombatantEventThe events of one combatant: the encounter and the combatant.
Event\EncounterStartedAn encounter was started.
Event\RoundDealtA round was dealt.
Event\DeckReshuffledThe discard pile was shuffled back.
Event\TurnStartedA combatant's turn started.
Event\TurnEndedA combatant's turn ended.
Event\RoundEndedEvery combatant standing has acted.
Event\CombatantJoinedA combatant joined.
Event\CombatantLeftA combatant left.
Event\CombatantDefeatedA combatant was defeated.
Event\CombatantRevivedA defeated combatant stands again.
Event\CombatantRevealedA hidden combatant was revealed.
Event\CombatantHiddenA combatant was hidden.
Event\EncounterEndedAn encounter was ended.

Exceptions

TypeRole
Exception\InitiativeExceptionEvery exception of the library.
Exception\InvalidEncounterA value out of its shape or its bounds.
Exception\InitiativeRefusedA change the tracker does not allow.
Exception\EncounterNotFoundNo encounter or combatant has the identifier.
Exception\EncounterConflictThe encounter changed since it was read.

Internal

TypeRole
Internal\IdentifierThe shape of an identifier.