PlacementRule

PlacementRule

Base class for placement validation conditions. Ported from: godot/addons/grid_building/systems/placement/validators/placement_rules/placement_rule.gd

Project: GridPlacement v6.0
Layer: Godot
Source: Godot/_Legacy/Systems/Placement/Validators/PlacementRules/PlacementRule.cs
Namespace: GridBuilding.Godot.Systems.Placement.Validators.PlacementRules
Kind: class

Parsing Method: AST-based (Roslyn) - NOT regex

⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.

Properties

Id

Unique identifier for the rule.

Name

Human-readable name for the rule.

Methods

ValidatePlacement

Checks a set of shape casts for building validity and returns whether the condition has been met or not.

Returns: RuleResult

Setup

The base function sets the grid targeting state for context which sources the target object being placed and the placer. Returns any issues found in the setup as an Array.

Returns: string[]

Parameters:

  • SystemsContext systemsContext

Apply

Optional code to be executed if this and all other tested rules validate successfully.

Returns: string[]

TearDown

Any cleanup code to run after the system changes preview instances or stops building. Runs before the building system changes placeable preview.

Returns: void

GetEditorIssues

Returns an array of issues found during editor validation.

Returns: List<string>

GetRuntimeIssues

Returns an array of issues found during runtime validation.

Returns: List<string>

ToString

Returns: string