Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.
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 RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
action_type | Property | The type of action being validated. |
cell | Property | The cell being validated. |
terrain_name | Property | The terrain name (if in PAINT_TILE mode). |
placeable | Property | The placeable resource (if in PLACE_OBJECT mode). |
preview_cells | Property | All cells currently being placed/previewed (for adjacency checks in a brush). Also known as batch cells. |
indicator | Property | The indicator being validated (if in PLACE_OBJECT mode). |
target_map | Property | The target TileMapLayer. |
targeting_state | Property | Reference to the targeting state for occupancy and collision queries. |
shared_cache | Property | Per-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_terrain | Method | |
ctx | Property | |
for_object | Method | |
ctx | Property |
Source
addons/grid_placement/placement/placement_rules/placement_validation_context.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs