Class TerrainDemolishData
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
Specialized [ManipulationData] for the terrain DEMOLISH action.\n\nCarries the terrain name, cells to erase, target map, and cell count for demolish operations. Exposes a [method veto] hook that listeners can call from the [signal PlacementState.pre_terrain_demolish] callback to cancel the demolition.\n\nLifecycle (5.1.0-P): [codeblock] try_demolish_terrain: status = STARTED emit pre_terrain_demolish(data) # listeners may call data.veto() if data.vetoed: status = CANCELED return erase_cells() emit post_terrain_demolish(data) emit post_terrain_removed(data) status = FINISHED [/codeblock]
class TerrainDemolishData extends ManipulationData
Properties
terrain_name
The terrain name being demolished (e.g. "dungeon_floor"). Resolved from the TileSet at erase time.
var terrain_name: StringName
cells
The grid cells to erase.
var cells: Array[Vector2i] = []
target_map
The TileMapLayer where the terrain will be erased.
var target_map: TileMapLayer
vetoed
True after any [signal PlacementState.pre_terrain_demolish] listener calls [method veto]. [code]try_demolish_terrain[/code] checks this flag after the signal fires and short-circuits to [enum PlacementEnums.Status.CANCELED] when set, preserving the terrain.
var vetoed: bool = false
Methods
veto
func veto() -> void: