import type { CombatSpatialDeps } from "../../combat/effects.js"; import type { GameEvents } from "../../game/events.js"; import { type BodyBind } from "../../scene/bodyBind.js"; import { type EntityStatsApi, type StatValueMap } from "../../scene/entityStats.js"; import { type EntityPosition, type EntityStore, type SceneEntity, type SpawnOptions } from "../../scene/entityStore.js"; import { type Forms } from "../../scene/form.js"; import { type EntityColliderSet, type MeasuredBounds } from "../../scene/colliders.js"; import { type CollisionMeshSource } from "../../scene/collisionMesh.js"; import { type ObjectStore } from "../../scene/objectStore.js"; import type { InventorySet, ItemTraits } from "../../inventory/inventoryModel.js"; import { type PaintLayer } from "../../scene/paintLayer.js"; import { type SelectionSet } from "../../scene/selection.js"; import { type SceneRaycastApi } from "../../scene/sceneRaycast.js"; import { type SpatialApi } from "../../scene/spatial.js"; import { type Targeting } from "../../scene/targeting.js"; import type { TerrainField } from "../../world/terrain.js"; import type { WorldSolids } from "../../world/worldSolids.js"; import type { SimClock } from "../../time/simClock.js"; import type { GameContextContent, GameContextEntityEntry, GameContextModels, GameContextObjectEntry, MoveTowardCommitOptions, SceneObjectContext } from "../gameContext.js"; /** @internal Live scene stores + spatial/collider/raycast wiring handed in by `createGameContext`. */ export interface SceneSubsystemDeps { content: GameContextContent; signalNotify: () => void; ground: TerrainField; solids?: Pick; events: GameEvents; /** Full sim clock — forms need `after` for timed shapeshift reversion. */ time: SimClock; occluder?: (from: EntityPosition, to: EntityPosition) => boolean; models?: GameContextModels; } /** @internal Always-on scene surface: entities, objects, colliders, spatial, raycast, targeting. */ export interface SceneSubsystem { entities: EntityStore; /** The player's selected entities, exposed as `ctx.scene.entity.selection`. */ entitySelection: SelectionSet; objects: ObjectStore; statsByInstance: Map; entityStats: EntityStatsApi; ensureInstanceStats: (instanceId: string) => StatValueMap; catalogEntry: (instanceId: string) => GameContextEntityEntry | null | undefined; catalogObject: (instanceId: string) => GameContextObjectEntry | null | undefined; spatial: SpatialApi; combatSpatial: CombatSpatialDeps; sceneRaycast: SceneRaycastApi; targeting: Targeting; entityColliders: Map; objectColliders: Map; entityCollidersOf: (instanceId: string) => EntityColliderSet | null; objectCollidersOf: (instanceId: string) => EntityColliderSet | null; reportEntityBounds: (kind: string, bounds: MeasuredBounds | null) => boolean; reportEntityCollisionMesh: (kind: string, mesh: CollisionMeshSource | null) => boolean; entityVisualScaleOf: (instanceId: string) => number; forms: Forms; paintLayer: PaintLayer; spawnEntity: (name: string, spawnOptions?: SpawnOptions) => string; despawnEntity: (instanceId: string) => boolean; moveEntityTowardCommit: (instanceId: string, target: EntityPosition | string, options: MoveTowardCommitOptions) => EntityPosition | null; resetAllToSpawn: (filter?: (entity: SceneEntity) => boolean) => number; bind: (key: string) => BodyBind; sceneObjects: SceneObjectContext; /** Install post-spawn side effects (death.revive) after combat is constructed. */ setOnAfterSpawn: (fn: (instanceId: string) => void) => void; /** Install post-despawn side effects (pose.clear) after player is constructed. */ setOnAfterDespawn: (fn: (instanceId: string) => void) => void; /** Hand the player subsystem's inventories to `sceneObjects.slots`, which is built before they exist. */ setInventoryAccess: (access: ObjectSlotInventoryAccess) => void; } /** @internal What `sceneObjects.slots` needs from the player subsystem to move items between a player and an object. */ export interface ObjectSlotInventoryAccess { traits: ItemTraits; hasInventory: (inventoryId: string) => boolean; inventoryFor: (userId: string) => InventorySet; } /** @internal */ export declare function createSceneSubsystem(d: SceneSubsystemDeps): SceneSubsystem;