IndicatorSetupUtils

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

IndicatorSetupUtils - Static utility functions for indicator setup operations.

Source File: addons/grid_building/placement/manager/components/indicator_setup_utils.gd

Extends: RefCounted

Public Methods

create_testing_indicator

1
2
3
4
create_testing_indicator(
    indicator_template: PackedScene,
    parent_node: Node
) -> RuleCheckIndicator

Flags: static

Returns a shared testing indicator, creating it if it doesn’t exist. The testing indicator is used for collision setup and validation before creating real indicators. This method implements lazy initialization and is safe to call multiple times. The testing indicator is configured to suppress rule-ready logs and is named “_TestingIndicator” for easy identification.

Parameters: indicator_template: PackedScene - Template for creating the indicator parent_node: Node - Parent node to attach the testing indicator to

Returns: RuleCheckIndicator - The shared testing indicator instance, or null if creation fails


gather_collision_shapes

1
gather_collision_shapes(test_object: Node2D) -> Dictionary

Flags: static

Performs the complete indicator setup workflow for a test object. This is the core logic extracted from IndicatorService.setup_indicators for better testability. Handles collision shape gathering, test setup creation, collision mapping, and indicator generation.

Parameters: test_object: Node2D - The object being tested for placement tile_check_rules: Array[TileCheckRule] - Rules to create indicators for collision_mapper: CollisionMapper - Collision mapper for position mapping indicator_template: PackedScene - Template for indicator creation parent_node: Node - Parent node for indicators targeting_state: GridTargetingState - Grid targeting configuration

Returns: SetupResult - Result containing generated indicators and diagnostic info Gathers collision shapes from a test object, organized by owner nodes. This is a wrapper around GBGeometryUtils for consistent API in tests.

Parameters: test_object: Node2D - Object to gather collision shapes from

Returns: Dictionary[Node2D, Array] - Dictionary mapping collision owners to their shapes


extract_valid_test_setups

1
extract_valid_test_setups(setups_dict: Dictionary) -> Array[CollisionTestSetup2D]

Flags: static

Extracts valid CollisionTestSetup2D objects from a dictionary of setups. Filters out null values and ensures only valid setup objects are returned.

Parameters: setups_dict: Dictionary - Dictionary of setups (owner -> setup)

Returns: Array[CollisionTestSetup2D] - List of valid test setups