class_name EditorTool extends RefCounted ## Base class for EditorCore tools (docs/architecture/editor.md ยง7.1 ## `ToolRegistry`: brush / object-place / select / erase / transform). ## ## A tool never mutates `ChunkEditorModel` "bare" -- every chunk-data ## mutation goes through `EditorCore.undo_redo` so it is always revertible. ## (Selection is the one exception: it is UI state, not chunk data, and ## `SelectTool` intentionally does not touch undo/redo -- see its comment.) var tool_id: String = "" ## Apply this tool's action against `core` with `args`. Returns a ## tool-specific result on success (often `true`/a new object id), or a ## falsy value (`false`/`""`/`null`) if nothing changed -- callers should ## treat falsy as "no-op, nothing to undo". func apply(_core: EditorCore, _args: Dictionary) -> Variant: push_error("EditorTool.apply() not implemented for tool '%s'" % tool_id) return null