extends Node ## Runtime entity registry + tile-related sim state. ## ## All gameplay entities (pawns, items, furniture, animals, corpses) live here. ## TileMap data is owned by the world-view scene; World holds the *indirect* ## state (designation queue, dirty-haul set, zone records, etc.) that doesn't ## belong on the TileMap itself. ## ## See docs/architecture.md. # Phase 2 — pawn registry. items/furniture/animals/corpses arrive in later phases. var pawns: Array[Pawn] = [] func register_pawn(p: Pawn) -> void: assert(p != null, "World.register_pawn: pawn is null") if pawns.has(p): return pawns.append(p) func unregister_pawn(p: Pawn) -> void: pawns.erase(p) func pawn_at_tile(tile: Vector2i) -> Pawn: for p in pawns: if p.tile == tile: return p return null func clear_pawns() -> void: # For save-load / new-game flow in Phase 16. pawns.clear()