IndicatorManager

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Manages placement validation and indicator visualization for grid-based object placement.

Source File: addons/grid_building/placement/manager/indicator_manager.gd

Extends: GBNode2D

Signals

  • Signal: indicators_changed(indicators: Array[RuleCheckIndicator]) - Emitted when the active placement indicators are updated.

Properties

  • Property: initialized : bool = false - Whether the manager has been initalized yet or not

Private Properties

  • Property: _indicator_context: [IndicatorContext](./indicator-context/) = null (private)
  • Property: _owner_context : [GBOwnerContext](./gb-owner-context/) (private)
  • Property: _logger: [GBLogger](./gb-logger/) = null (private)
  • Property: _indicator_template: PackedScene = null (private)
  • Property: _targeting_state: [GridTargetingState](./grid-targeting-state/) = null (private)
  • Property: _manipulation_state: [ManipulationState](./manipulation-state/) = null (private)
  • Property: _indicator_service: [IndicatorService](./indicator-service/) (private)
  • Property: _placement_validator: [PlacementValidator](./placement-validator/) = null (private)
  • Property: _test_setup_factory: [TestSetupFactory](./test-setup-factory/) = null (private)
  • Property: _last_setup_test_object: Node = null (private)

Constants

  • Constant: DEFAULT_NAME = "IndicatorManager"

Public Methods

create_with_injection

1
2
3
4
create_with_injection(
    container: GBCompositionContainer,
    parent: Node = null
) -> IndicatorManager

Flags: static

Creates an IndicatorManager with dependencies injected from the provided container. container The dependency injection container. parent Optional parent node to attach the IndicatorManager to. [returns] A configured IndicatorManager instance.


get_runtime_issues

1
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

1
resolve_gb_dependencies(p_container: GBCompositionContainer) -> void

Resolves and injects dependencies from the composition container. p_container The dependency injection container.


setup_indicators

1
2
3
4
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. p_test_object The object to test for placement. p_tile_check_rules The tile check rules to apply. [returns] An IndicatorSetupReport with indicators and diagnostic information.


get_indicator_count

1
2
3
4
get_indicator_count(
    p_test_object: Node2D,
    p_tile_check_rules: Array[TileCheckRule]
) -> int

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. p_test_object The object to test for placement. 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

1
get_indicators() -> Array[RuleCheckIndicator]

Returns the current active placement indicators. [returns] An array of RuleCheckIndicator instances.


get_colliding_indicators

1
get_colliding_indicators() -> Array[RuleCheckIndicator]

Returns indicators currently in collision. [returns] An array of colliding RuleCheckIndicator instances.


get_colliding_nodes

1
get_colliding_nodes() -> Array[Node2D]

Returns nodes colliding with any indicators. [returns] An array of Node2D instances in collision.


try_setup

1
2
3
4
5
try_setup(
    p_placeable_rules: Array[PlacementRule],
    p_gts : GridTargetingState,
    p_ignore_base := false
) -> PlacementReport

Attempts to set up a placement action and returns a setup report. p_placeable_rules The placement rules to apply. p_gts The grid targeting state. p_ignore_base Whether to ignore base rules. [returns] A PlacementReport with setup results.


clear

1
clear()

tear_down

1
tear_down() -> void

Resets the manager, clearing indicators and validation state.


apply_rules

1
apply_rules() -> void

Applies placement rules through the validator.


validate_placement

1
validate_placement() -> ValidationResults

Validates placement using indicators and rules. [returns] A ValidationResults object with validation outcome.


inject_collision_mapper_dependencies

1
inject_collision_mapper_dependencies(container: GBCompositionContainer) -> bool

Updates the collision mapper with dependency injection if a composition container is available. container The dependency injection container. [returns bool] Whether the injection was successful or not


get_or_create_testing_indicator

1
get_or_create_testing_indicator(parent_node: Node) -> RuleCheckIndicator

Returns the shared testing indicator, creating it if it doesn’t exist. parent_node The parent node for the testing indicator. [returns] The testing indicator instance.


setup_collision_mapper

1
2
3
4
setup_collision_mapper(
    testing_indicator: RuleCheckIndicator,
    setups: Dictionary
) -> void

Sets up the collision mapper with the testing indicator and test setups. testing_indicator The testing indicator to use. setups The collision test setups.


get_collision_mapper

1
get_collision_mapper() -> CollisionMapper

Gets the collision mapper from the indicator service. [returns] The collision mapper instance.


get_placement_validator

1
get_placement_validator() -> PlacementValidator

Exposes the underlying PlacementValidator for advanced/test usages. Tests use this to drive validation directly when needed.


force_shapecast_update

1
force_shapecast_update() -> void

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 force_indicators_validity_evaluation instead.


force_indicators_validity_evaluation

1
force_indicators_validity_evaluation() -> int

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 RuleCheckIndicator.force_validity_evaluation on each managed indicator. [returns] The number of indicators that were updated.


Private Methods

_init

1
_init() -> void

Flags: private


_log_target_diagnostics

1
_log_target_diagnostics(target: Node) -> void

Flags: private


_log_indicator_report

1
_log_indicator_report(indicators_report: IndicatorSetupReport) -> void

Flags: private


_build_failed_report

1
2
3
4
_build_failed_report(
    validator_issues: Dictionary,
    target: Node
) -> PlacementReport

Flags: private


_on_manipulation_canceled

1
_on_manipulation_canceled(_data: ManipulationData) -> void

Flags: private

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.). _data The manipulation data (unused, but required by signal signature).