class_name SelectionManager extends RefCounted ## Tracks the currently-selected object in the in-game editor ## (docs/architecture/editor.md §7.1 `SelectionManager`). ## ## Selection is UI/session state, not chunk data: it is never pushed onto ## `EditorUndoRedoStack` and never encoded into the `ChunkPayload`. Scoped ## to a single selected object id, matching the 2D-tile-editor scope ## (docs/architecture/editor.md §8) -- multi-select is future work. signal selection_changed(object_id: String) var _selected_id: String = "" func select(object_id: String) -> void: if _selected_id == object_id: return _selected_id = object_id selection_changed.emit(_selected_id) func clear() -> void: select("") func get_selected() -> String: return _selected_id func has_selection() -> bool: return _selected_id != ""