aboutsummaryrefslogtreecommitdiff
path: root/content-system/regions/schema.ts
blob: 6d053a57c8296240f1f8cd6b829edf4ea59e84df (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import type { Brand } from '@hollowdark/utils/types/brand'

/** Stable slug identifying a region across versions. */
export type RegionId = Brand<string, 'RegionId'>

/** Stable slug identifying a city across versions. */
export type CityId = Brand<string, 'CityId'>

/** Stable slug identifying an institution across versions. */
export type InstitutionContentId = Brand<string, 'InstitutionContentId'>

/** Dominant economic sector categories used across the world's regions. */
export type EconomicSector =
  | 'agriculture'
  | 'publishing'
  | 'education'
  | 'finance'
  | 'government'
  | 'industry'
  | 'logistics'
  | 'mining'
  | 'oil_and_gas'
  | 'renewable_energy'
  | 'services'
  | 'shipping'
  | 'technology'
  | 'timber'
  | 'tourism'
  | 'trades'
  | 'entertainment'
  | 'fishing'
  | 'retail'
  | 'design'
  | 'construction'
  | 'healthcare'
  | 'transportation'

/** Coarse measure of income disparity in a region. */
export type Inequality = 'flat' | 'moderate' | 'high' | 'extreme'

/**
 * Share of the population affiliated, nominally or actively, with each of
 * the three main religions plus secular/unaffiliated. Values in [0, 1],
 * sum ~= 1 per region.
 */
export interface ReligiousComposition {
  readonly covenant: number
  readonly old_faith: number
  readonly quiet_path: number
  readonly secular: number
}

/** Climate texture — prose for scenes, plus rough numeric anchors. */
export interface RegionClimate {
  readonly summary: string
  readonly temperature_range_c: readonly [number, number]
  readonly annual_rainfall_mm: number
}

/** The role a city plays relative to its region. */
export type CityRole =
  | 'metropolis'
  | 'port'
  | 'university_town'
  | 'industrial_town'
  | 'capital'
  | 'agricultural_hub'
  | 'resort'
  | 'mining_town'
  | 'frontier_town'
  | 'tourist'
  | 'mill_town'

/** Region-level content source, one YAML file per region. */
export interface RegionContent {
  readonly id: RegionId
  readonly display_name: string
  readonly population_weight: number
  readonly climate: RegionClimate
  readonly economy: {
    readonly summary: string
    readonly dominant_sectors: readonly EconomicSector[]
    readonly inequality: Inequality
  }
  readonly culture: {
    readonly summary: string
    readonly texture: string
  }
  readonly class_texture: string
  readonly religion: ReligiousComposition
  readonly city_ids: readonly CityId[]
  readonly institution_ids: readonly InstitutionContentId[]
  readonly stereotypes: {
    readonly held_by_others: string
    readonly self_image: string
  }
}

/** City-level content source, one YAML file per city. */
export interface CityContent {
  readonly id: CityId
  readonly region_id: RegionId
  readonly display_name: string
  readonly population: number
  readonly role: CityRole
  readonly character: string
}

/** Institution-level content source, one YAML file per institution. */
export interface InstitutionContent {
  readonly id: InstitutionContentId
  readonly region_id: RegionId
  readonly city_id: CityId
  readonly display_name: string
  readonly kind: 'publisher' | 'university' | 'hospital' | 'newspaper' | 'employer' | 'religious' | 'government'
  readonly character: string
}