aboutsummaryrefslogtreecommitdiff
path: root/engine/entities/event-log-entry.ts
blob: 1e107f4d4e83ca45d63b4b187773f2c9d0ffda97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import type { GameTime } from '@hollowdark/time/gameTime'
import type { EventLogEntryId, PersonId } from '@hollowdark/engine/entities/base'

/**
 * Consequences logged against a specific event resolution. The shape is
 * kept deliberately open — events may mutate a wide range of state — and
 * the consequence writer (events/consequence.ts, later) fills it in.
 */
export interface AppliedConsequence {
  readonly targetPath: string
  readonly operation: 'set' | 'add' | 'multiply' | 'append'
  readonly value: unknown
}

/**
 * One event's entry in a character's event log. Entry IDs are stable so
 * memoir generation and History views can reference specific moments.
 * Passage text lives in the content registry, keyed by renderedPassageRef,
 * so logs stay small.
 */
export interface EventLogEntry {
  readonly id: EventLogEntryId
  readonly personId: PersonId
  readonly time: GameTime
  readonly eventTypeId: string
  readonly participants: readonly PersonId[]
  readonly emotionalWeight: number
  readonly themes: readonly string[]
  readonly consequences: readonly AppliedConsequence[]
  readonly renderedPassageRef: string
  readonly playerChoice: string | null
  readonly memorableMarker: boolean
}