IndicatorManager
Summary
Section titled “Summary”Manages placement validation and indicator visualization for grid-based object placement.
Coordinates the creation, validation, and display of placement indicators, integrating with rule-based validation systems to provide visual feedback on valid or invalid placement locations. Emits signals to notify changes in indicator states.
Constants
Section titled “Constants”const DEFAULT_NAME = “IndicatorManager”
Signals
Section titled “Signals”signal indicators_changed( indicators: Array[RuleCheckIndicator] )
Emitted when the active placement indicators are updated.
Properties
Section titled “Properties”initialized: bool = false
Whether the manager has been initalized yet or not
Methods
Section titled “Methods”get_runtime_issues( ) -> Array[String]
Validates required dependencies and returns any issues found. [returns] An array of issue strings (empty if valid).
resolve_gb_dependencies( p_container: GBCompositionContainer ) -> void
Resolves and injects dependencies from the composition container. [param p_container] The dependency injection container.
setup_indicators( p_test_object: Node2D, p_tile_check_rules: Array[TileCheckRule] ) -> IndicatorSetupReport
Sets up placement indicators for a test object using specified tile check rules. [param p_test_object] The object to test for placement. [param p_tile_check_rules] The tile check rules to apply. [returns] An IndicatorSetupReport with indicators and diagnostic information.
get_indicators( ) -> Array[RuleCheckIndicator]
Returns the current active placement indicators. [returns] An array of RuleCheckIndicator instances.
get_colliding_indicators( ) -> Array[RuleCheckIndicator]
Returns indicators currently in collision. [returns] An array of colliding RuleCheckIndicator instances.
get_colliding_nodes( ) -> Array[Node2D]
Returns nodes colliding with any indicators. [returns] An array of Node2D instances in collision.
try_setup( p_placeable_rules: Array[PlacementRule], p_gts: GridTargetingState, p_ignore_base ) -> PlacementReport
Attempts to set up a placement action and returns a setup report. [param p_placeable_rules] The placement rules to apply. [param p_gts] The grid targeting state. [param p_ignore_base] Whether to ignore base rules. [returns] A PlacementReport with setup results.
clear( )
tear_down( ) -> void
Resets the manager, clearing indicators and validation state.
apply_rules( ) -> void
Applies placement rules through the validator.
validate_placement( ) -> ValidationResults
Validates placement using indicators and rules. [returns] A ValidationResults object with validation outcome.
inject_collision_mapper_dependencies( container: GBCompositionContainer ) -> bool
Updates the collision mapper with dependency injection if a composition container is available. [param container] The dependency injection container. [returns bool] Whether the injection was successful or not
get_or_create_testing_indicator( parent_node: Node ) -> RuleCheckIndicator
Returns the shared testing indicator, creating it if it doesn’t exist. [param parent_node] The parent node for the testing indicator. [returns] The testing indicator instance.
setup_collision_mapper( testing_indicator: RuleCheckIndicator, setups: Dictionary ) -> void
Sets up the collision mapper with the testing indicator and test setups. [param testing_indicator] The testing indicator to use. [param setups] The collision test setups.
get_collision_mapper( ) -> CollisionMapper
Gets the collision mapper from the indicator service. [returns] The collision mapper instance.
Source
Section titled “Source”addons/grid_building/placement/manager/indicator_manager.gd
This page was auto-generated from GDScript source. Edit the source file to improve documentation.
Generated on 2025-09-07