Skip to content

PlacementValidator

Runs tests for each rule using RuleCheckIndicators to determine if placement in the targeted location is valid if all rules validate successfully

const ISSUE_MATCHING_PRIORITY = “Info: %d rules share visual priority [%d] %s (allowed)“
signal finished( results: ValidationResults )

Emitted when the placement validator is done evaluating a set of rules on a scene node

signal setup_failed( issues: Dictionary[PlacementRule, Array] )

Emitted when the setup failed

active_rules: Array[PlacementRule] = []

Rules that are enforced whenever placing any object into the game world by default Exists so you don’t have to add the same rule to every single object individually

Output messages to give context for what occured during validation

Debug settings to pass into rules. Override in resource inspector if desired.

Full list of rules being used by the placement validator to test object placement

resolve_gb_dependencies( container: GBCompositionContainer ) -> bool

Passes. No injection needed. Returns: bool - True if dependencies were successfully resolved, false otherwise

get_runtime_issues( ) -> Array[String]

Validates that all required dependencies are properly set. Returns: Array[String] - List of validation issues (empty if valid)

validate_placement( ) -> ValidationResults

Validates placement rules against the current target state. Returns the validation results including details of each placement rule result.

Returns: ValidationResults - Comprehensive validation results with rule details and success status

setup( p_rules: Array[PlacementRule], p_gts: GridTargetingState ) -> Dictionary

Sets the active rules set and rule_check_indicators for validating the current target’s placement position Uses pure logic class for composition over inheritance Returns a dictionary of issues

get_combined_rules( p_outside_rules: Array, false: p_ignore_base = ) -> Array[PlacementRule]

Gets the rules of the placement validator combined with the rules of the placeable resource Uses pure logic class for composition over inheritance

tear_down( )

Tear down base & placeable specific rules

apply_rules( )

Clean up null indicators from all active tile check rules. This prevents null reference errors during validation. Uses pure logic for composition over inheritance Runs execute on each of the active rules

This is code that generally runs after validation is successful and the validated action takes place

addons/grid_building/placement/manager/components/placement_validator.gd


This page was auto-generated from GDScript source. Edit the source file to improve documentation.

Generated on 2025-09-07