Skip to content

Reference

tilttek/factions

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

Rosters and factions

TypeRole
FactionsThe service: create, add, change and remove a faction, change the scale, shift or set a standing, set a rank, set and end relations, hand over, delete, read the history, and view.
RosterThe factions of one campaign, its scale and the relations between its factions, checked as a whole.
FactionA faction found by its key: its name, summary, ranks, standings, members and secrecy.
RankA rank of a faction, by its key, with its title.
MembershipThe rank a character holds within a faction.
StandingWhere a subject stands with a faction.
SubjectThe party, or one character, and its key.
ScaleThe bounds, the start and the tiers of the standings of a campaign.
TierA named step of a scale, from its lowest standing.
RelationHow two factions stand with each other, the pair kept lower key first.
StanceAllied, friendly, neutral, rival, hostile or war.
ReasonWhy a standing, a rank or a relation changed, and the session.

History

TypeRole
History\EntryOne change of the history: its campaign, faction, reason, author and time.
History\StandingEntryA standing moved, before and after.
History\RankEntryA rank changed, before and after.
History\RelationEntryA relation changed, before and after.

Views

TypeRole
View\RosterViewA roster as its reader sees it: the scale, the factions and the relations they know of.
View\FactionViewA faction as shown, with the standings and members its reader may see.
View\StandingViewA standing as shown: the subject, the value and its tier.

Ports and stores

TypeRole
Contract\RosterStoreKeeps the rosters at a version with their history, deletes them and reads the history of a faction.
Contract\RosterObserverTold of the events of a roster.
Store\InMemoryRosterStoreThe rosters and their history in memory, for tests.

Events

TypeRole
Event\RosterEventA fact of a roster, by identifiers only.
Event\RosterCreatedA roster was created.
Event\FactionAddedA faction was added.
Event\FactionChangedA faction's details changed.
Event\FactionRemovedA faction was removed.
Event\ScaleChangedThe scale changed.
Event\StandingChangedA standing moved.
Event\RankChangedA rank changed.
Event\RelationChangedA relation changed.
Event\RosterHandedOverThe roster changed hands.
Event\RosterDeletedThe roster was deleted.

Exceptions

TypeRole
Exception\FactionsExceptionEvery exception of the library.
Exception\InvalidRosterA value out of its shape or bounds, or a name the roster lacks.
Exception\RosterNotFoundNo roster for the campaign.
Exception\RosterRefusedA call not allowed.
Exception\RosterConflictThe roster changed since it was read.

Internal

TypeRole
Internal\IdentifierThe shape of identifiers and keys. Internal.
Internal\TextThe shape of texts. Internal.