IndicatorManager
AUTO-GENERATED FILE — DO NOT EDIT MANUALLY
Source: systems/placement/managers/indicator_manager.gd
Version: 5.1
class_name: IndicatorManager
extends: GBNode2D
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.
Signals
indicators_changed- Emitted when the active placement indicators are updated.
Exports
(none)
Methods
get_runtime_issues()- Validates required dependencies and returns any issues found. [returns] An array of issue strings (empty if valid).
_init()set_indicator_service()resolve_gb_dependencies()- Resolves and injects dependencies from the composition container. [param p_container] The dependency injection container.
_retry_resolve_gb_dependencies()initialize()- Initializes the IndicatorManager with required dependencies. [param p_indicator_context] The placement context. [param p_indicator_template] The PackedScene for indicator instances. [param p_targeting_service] The targeting service. [param p_manipulation_state] The manipulation state for listening to cancellation signals. [param p_logger] The logging system. [param p_rules] The placement rules. [param p_messages] The message system. [param p_manipulation_parent] The manipulation parent node.
setup_indicators()- 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_indicator_count()- Calculates the number of indicators that would be created for a test object without actually creating them. This is useful for performance-critical scenarios or UI calculations where you only need the count. [param p_test_object] The object to test for placement. [param p_tile_check_rules] The tile check rules to apply. [returns] The number of indicators that would be created, or -1 if calculation fails.
get_indicators()- Returns the current active placement indicators. [returns] An array of RuleCheckIndicator instances.
get_colliding_indicators()- Returns indicators currently in collision. [returns] An array of colliding RuleCheckIndicator instances.
get_colliding_nodes()- Returns nodes colliding with any indicators. [returns] An array of Node2D instances in collision.
try_setup()_log_target_diagnostics()_log_indicator_report()_build_failed_report()clear()tear_down()- Resets the manager, clearing indicators and validation state.
apply_rules()- Applies placement rules through the validator.
validate_placement()- Validates placement using indicators and rules. [returns] A GBValidationResults object with validation outcome.
inject_collision_mapper_dependencies()- 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()- 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()- 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()- Gets the collision mapper from the indicator service. [returns] The collision mapper instance.
get_placement_validator()- Exposes the underlying PlacementValidator for advanced/test usages. Tests use this to drive validation directly when needed.
force_shapecast_update()- Forces all managed indicators to update their shapecast collision detection immediately. This is useful for tests to avoid waiting for physics frames when you only need collision detection updated but don’t care about validity state yet. For tests that need both collision detection AND validity evaluation, use [method force_indicators_validity_evaluation] instead.
force_indicators_validity_evaluation()- Forces all managed indicators to immediately update collision detection and re-evaluate their validity state based on assigned rules. This is the preferred method for tests as it provides deterministic validation results without needing to wait for physics frames or process cycles. Calls [method RuleCheckIndicator.force_validity_evaluation] on each managed indicator. [returns] The number of indicators that were updated.
_on_manipulation_canceled()- Handles manipulation cancellation by cleaning up all active indicators. This ensures indicators are properly freed when manipulation ends unexpectedly (e.g., source object deleted, user cancels, etc.). [param _data] The manipulation data (unused, but required by signal signature).