Skip to content
ct

Class

PlacementValidationContext

Generated GDScript class reference for GridPlacement.PlacementValidationContext.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Context object carrying all necessary data for placement validation. Supports both object-based (via indicators) and terrain-based (via cells) validation.

Source: addons/grid_placement/placement/placement_rules/placement_validation_context.gd

Syntax

class PlacementValidationContext extends RefCounted

Members

NameKindSummary
action_typePropertyThe type of action being validated.
cellPropertyThe cell being validated.
terrain_namePropertyThe terrain name (if in PAINT_TILE mode).
placeablePropertyThe placeable resource (if in PLACE_OBJECT mode).
preview_cellsPropertyAll cells currently being placed/previewed (for adjacency checks in a brush). Also known as batch cells.
indicatorPropertyThe indicator being validated (if in PLACE_OBJECT mode).
target_mapPropertyThe target TileMapLayer.
targeting_statePropertyReference to the targeting state for occupancy and collision queries.
world_facts_provider_2dPropertyOptional game-owned provider for placement-relevant world/physics facts. Grid Placement consumes this abstraction but does not own the backend (Godot Physics, Avian 2D, custom simulation, etc.).
shared_cachePropertyPer-batch scratch cache shared across every cell context in one multi-cell validation pass (line/rect/outline/flood). Rules memoize expensive, cell-independent resolutions here (e.g. a terrain's collision polygons) so a batch resolves them once instead of once per cell. Empty for single-cell validation. Lifetime = one batch; never global static state.
for_terrainMethod
ctxProperty
for_objectMethod
ctxProperty