aboutsummaryrefslogtreecommitdiff
path: root/engine/entities/scheduled-event.ts
blob: 254e979e66826200add081f00d30084e49d8a463 (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
import type { GameTime } from '@hollowdark/time/gameTime'
import type { PersonId, ScheduledEventId } from '@hollowdark/engine/entities/base'

/**
 * A future event trigger, either at a fixed time or when conditions hold.
 * Taking a bribe at 30 might schedule a `bribery_audit` at +15 years with
 * elevated weight.
 */
export interface ConditionalTrigger {
  readonly kind: 'conditional'
  readonly condition: string
  readonly earliestTime: GameTime | null
  readonly latestTime: GameTime | null
}

export interface ScheduledEvent {
  readonly id: ScheduledEventId
  readonly eventTypeId: string
  readonly scheduledFor: GameTime | ConditionalTrigger
  readonly targetPersonId: PersonId
  readonly context: Readonly<Record<string, unknown>>
  readonly eligibilityRecheck: boolean
  readonly priority: number
}