ValidPlacementTileRule
Summary
Section titled “Summary”Rule that checks tilemap custom data fields for placement validation.
Properties
Section titled “Properties”expected_tile_custom_data = {}
Expected custom data fields and values for valid tiles.
settings: ValidPlacementRuleSettings
Settings for the valid placement tile rule. Defines custom messages for this rule’s validation.
Methods
Section titled “Methods”setup( p_gts: GridTargetingState ) -> Array[String]
Creates tile indicators on matching layers to test that colliding tiles exist in shape spaces around the object to be placed
validate_placement( ) -> RuleResult
Check each tile indicator of this test to ensure that they collide with the tilemap
tear_down( )
Frees tile indicators created for this test when the building system no longer is using this rule
does_tile_have_valid_data( p_indicator: RuleCheckIndicator, p_maps: Array[TileMapLayer] ) -> bool
Validates if tile data contains all expected custom data across provided maps. Returns true only if all expected custom data keys match at least one layer in the tile data.
p_indicator
: RuleCheckIndicator - The indicator object marking the tile position to checkp_maps
: Array[TileMapLayer] - Array of TileMapLayer or TileMap nodes to check against
Source
Section titled “Source”addons/grid_building/placement/placement_rules/template_rules/valid_placement_tile_rule.gd
This page was auto-generated from GDScript source. Edit the source file to improve documentation.
Generated on 2025-09-07