Skip to content

RuleCheckIndicator

Tile indicator showing placement validity based on rules and collisions.

Displays visual feedback for tile validity during building preview by running all assigned TileCheckRules and updating its visuals accordingly. Used by IndicatorManager and PlacementValidator as part of the validation pipeline.

See project-architecture.md for system architecture and building flow documentation.

signal valid_changed( is_valid: bool )

Emitted when validity status changes.

validity_sprite: Sprite2D = null

Sprite showing tile validity status.

show_indicators: bool = true

Whether to show the indicator visual sprites for players or not.

valid_settings: IndicatorVisualSettings = null

Default display settings for when the rule check indicator is marked valid.

invalid_settings: IndicatorVisualSettings = null

Default display settings for when the rule check indicator is marked invalid.

rules: Array[TileCheckRule] = []

Internal flag to suppress the noisy _ready() log when intentionally created with no rules (e.g. testing indicator used only for collision mapping)

The rules to validate for whether this tile is valid for placement or not All rules must validate true to be valid. Otherwise, failed status will be shown

current_display_settings: IndicatorVisualSettings = null
valid: bool = false

Whether the rules were validated for the area under the rule check indicator in the last test

_ready( )
resolve_gb_dependencies( p_container: GBCompositionContainer ) -> void

Resolve dependencies for the indicator

get_rules( ) -> Array[TileCheckRule]

Returns the active tile check rules assigned to this indicator.

add_rule( p_rule: TileCheckRule )

Adds rule to indicator and self to indicators array on the rule for all indicator validation checks.

p_rule: TileCheckRule - Rule to add to this indicator

get_tile_position( p_map: TileMapLayer ) -> Vector2i

Gets the tile position that the indicator is currently positioned over.

p_map: TileMapLayer - TileMapLayer to convert global position to tile coordinates

clear( )

Clears reference to self from all rule indicator arrays

validate_rules( p_rules: Array[TileCheckRule] ) -> Array[TileCheckRule]

Tests each of the TileCheckRules against the indicator. Returns all failing rules.

p_rules: Array[TileCheckRule] - Array of rules to validate against this indicator

get_debug_info( ) -> Dictionary

Get current state information for debugging

validate_runtime( ) -> bool
trace_runtime_if_enabled( ) -> void

Highly verbose logging of the RuleCheckIndicator during runtime. Will only process if GBLogger is set to Trace verbosity (very high!)

get_runtime_issues( ) -> Array[String]

Gets issues with the indicator in the scene

get_editor_issues( ) -> Array[String]

Editor-time validations: checks useful in the editor / scene authoring

update_validity_state( ) -> bool

Update the validity of the rule check indicator by validating all rules attached

force_validity_evaluation( ) -> bool

Immediately force shapecast update and a check for the validity of each rule given the new shapecast state

addons/grid_building/placement/rule_check_indicator/rule_check_indicator.gd


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

Generated on 2025-09-07