export type FactionRelation = "hostile" | "neutral" | "friendly"; export interface FactionDef { id: string; relations?: Readonly>; towardSelf?: FactionRelation; towardOthers?: FactionRelation; } export interface FactionGraphConfig { factions: readonly FactionDef[]; symmetric?: boolean; unaligned?: FactionRelation; } export interface FactionGraph { relationBetween(observer: string | null | undefined, other: string | null | undefined): FactionRelation; isHostile(observer: string | null | undefined, other: string | null | undefined): boolean; isFriendly(observer: string | null | undefined, other: string | null | undefined): boolean; isNeutral(observer: string | null | undefined, other: string | null | undefined): boolean; has(factionId: string): boolean; ids(): string[]; } export declare function createFactionGraph(config: FactionGraphConfig): FactionGraph; export interface FactionRoster { assign(entityId: string, factionId: string | null): void; factionOf(entityId: string): string | null; relationBetweenEntities(observer: string, other: string): FactionRelation; isHostile(observer: string, other: string): boolean; isFriendly(observer: string, other: string): boolean; members(factionId: string): string[]; hostilesOf(observer: string, candidates: Iterable): string[]; remove(entityId: string): void; clear(): void; } export declare function createFactionRoster(graph: FactionGraph): FactionRoster;