Class PlacementActionData
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
class PlacementActionData extends RefCounted
Fields
INVALID_CELL
Values for an attempted placement action
const INVALID_CELL = Vector2i(-1, -1)
Properties
placeable
The resource defining the rules and scene to instance for a placeable object
var placeable: ScenePlacementEntry
build_resource
The active resource used for the build action. May be a ScenePlacementEntry. Terrain-name painting keeps the TileSet as SSOT and does not attach a duplicate terrain resource.
var build_resource: Resource
report
The placement report from the attempted action
var report: PlacementReport
build_type
Type of build operation (SINGLE, DRAG, TERRAIN, or AREA)
var build_type: PlacementEnums.BuildType = PlacementEnums.BuildType.SINGLE
terrain_name
Semantic terrain name for tile-paint actions (TERRAIN). The TileSet is the SSOT for terrain identity, so no separate terrain resource is attached; the name is the user-facing label for action-log output and similar listeners. Empty for non-terrain build types.
var terrain_name: StringName = StringName()
terrain_cell
Grid cell where terrain was painted (TERRAIN actions only). This enables per-cell cost deduction, undo journaling, and effects. For non-terrain actions, this value is INVALID_CELL.
var terrain_cell: Vector2i = INVALID_CELL
terrain_cell_count
Number of cells painted in this terrain operation (TERRAIN actions only). 0 means the count is unknown (e.g. single-cell backward compat). >1 means a multi-cell brush (LINE, RECTANGLE_FILL, FLOOD_FILL) was used.
var terrain_cell_count: int = 0
resource
var resource: Resource = get_built_resource()
Methods
get_display_name
func get_display_name() -> String:
Returns
get_built_resource
func get_built_resource() -> Resource:
Returns
is_tile_paint
func is_tile_paint() -> bool:
Returns
get_preview
func get_preview() -> Node:
Returns
get_placed_position
func get_placed_position() -> Vector2: