import { type EnvironmentField, type EnvironmentFieldConfig } from "./envField.js"; import type { WeatherState } from "./weather.js"; /** The recomposable environment parameters a realm card can override. */ export interface RealmEnvironmentParams { baseTemperature: number; nightDrop: number; altitudeLapse: number; /** Game-seconds per day (a "long night" minor card shortens the day cycle). */ dayLength: number; /** Ambient rain intensity 0..1. */ rain: number; /** Ambient light floor 0..1 (moonlight). */ ambientFloor: number; } export declare const DEFAULT_REALM_ENVIRONMENT: RealmEnvironmentParams; /** Spawn-table edits a card layers on: replace weights, add/scale, or remove ids. */ export interface SpawnTableOverride { set?: Record; add?: Record; scale?: Record; remove?: readonly string[]; } export interface RealmCard { id: string; /** A major card sets the biome base; minors layer weather/day-length/aesthetic on top. */ kind: "major" | "minor"; /** Environment param overrides (last write wins across the ordered deck). */ environment?: Partial; /** Weather state overrides (kind/intensity/wind). */ weather?: Partial; /** Spawn-table edits applied in deck order. */ spawn?: SpawnTableOverride; /** Opaque aesthetic tag (skybox, palette) the renderer maps — engine never inspects it. */ aesthetic?: string; } export interface RealmBase { environment?: Partial; weather?: WeatherState; spawn?: Record; } export interface ComposedRealm { params: RealmEnvironmentParams; weather: WeatherState; spawnTable: Record; aesthetics: readonly string[]; cards: readonly RealmCard[]; /** * Build an environment field (#91) from the composed params, wired to the composed * weather's rain intensity. Extra config (terrain, occluders, heat sources) merges on top. */ environmentField(extra?: Omit): EnvironmentField; } /** * Assemble a played realm instance at runtime from a deck of modifier cards — the * Nightingale "realm card" model. A major card is the biome base; minor cards layer * weather, day length, and spawn edits. The result recomposes both the environment * (into a sampleable field via `environmentField()`) and the spawn table, and it depends * on the weather hooks in this group (#92) to turn its `weather` into gameplay modifiers. * Cards apply in array order; sort your deck (majors first) before composing. */ export declare function composeRealm(base: RealmBase, cards: readonly RealmCard[]): ComposedRealm;