aboutsummaryrefslogtreecommitdiff
path: root/engine/entities/institution.ts
blob: ebf571c7e22e4e71cdfd14528981703639707728 (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
34
35
36
37
38
39
40
import type { GameTime } from '@hollowdark/time'
import type { BaseEntity, InstitutionId, PersonId, PlaceId } from './base'
import type { CultureDescriptor } from './place'

export type InstitutionType =
  | 'company'
  | 'government'
  | 'university'
  | 'school'
  | 'hospital'
  | 'religious'
  | 'nonprofit'
  | 'news'
  | 'cultural'
  | 'criminal'
  | 'military'

export interface InstitutionEvent {
  readonly at: GameTime
  readonly kind: string
  readonly summary: string
}

export interface Institution extends BaseEntity<InstitutionId, 'institution'> {
  readonly name: string
  readonly type: InstitutionType
  readonly placeId: PlaceId
  readonly foundedAt: GameTime

  readonly culture: CultureDescriptor

  /** Role tag (e.g., "manager", "ceo", "teacher") → person IDs holding it. */
  readonly members: ReadonlyMap<string, readonly PersonId[]>

  readonly prosperity: number
  readonly reputation: number
  readonly stability: number

  readonly majorEvents: readonly InstitutionEvent[]
}