Scene-free brush lifecycle coordinator. Gives the brush coordination concern its own single-responsibility home. Owns the [BrushState] instance and coordinates the start/complete/anchor/commit/cancel/paint sequence for terrain brushes. Mirrors the pattern of [TerrainPlacementService2D] (instance + configure) and [PlacementInputHandler] (instance + configure) so the brush behavior is swappable per-game by subclassing. Signal emission is intentionally NOT done here — the coordinator returns a [PlacementReport] for every paint attempt, and the host's thin delegator emits the appropriate success/failed signal. This keeps the coordinator pure (no side effects beyond state mutation in [BrushState]). Usage: var coord := BrushCoordinator.new() coord.configure(states, terrain_service) coord.set_brush_shape(PlacementEnums.ObjectTool.LINE) coord.start_terrain_brush_drag() var report := coord.complete_terrain_brush()
Source: addons/grid_placement/systems/building/components/brush_coordinator.gd
Syntax
class BrushCoordinator extends BrushServiceContract