Skip to content

IndicatorSetupReport

Represents a structured report of an IndicatorManager.setup_indicators() run. Holds the produced indicators plus diagnostic metadata that can be logged or asserted in tests.

indicators: Array[RuleCheckIndicator] = []

The indicators created during setup

targeting_state: GridTargetingState

The targeting state being used for indicators to be created and tested against for placement and validation

template: PackedScene

The template being used for instantiating indicators

rules: Array[TileCheckRule] = []

The rules that were being evaluated in the creation of the indicators

tile_positions: Array[Vector2i] = []

All distinct tile positions that were used for the creation of indicators

position_rules_map: Dictionary[Vector2i, Array] = {}

The mapping between tile positions and an array of TileCheckRules that were assigned for an indicator at those positions

owner_shapes: Dictionary[Node2D, Array] = {}

List of owners and their attached collision shapes and polygons

indicator_test_setups: Array[CollisionTestSetup2D] = []

Collision test setups for each collision shape / polygon 2D to be tested.

issues: Array[String] = []

The issues that occured during setup, if any

notes: Array[String] = []

Verbose diagnostic notes to detail what happened during indicator setup. These notes do not represent issues with the setup but may aid in debugging.

func _init( p_rules: Array[TileCheckRule], p_targeting_state: GridTargetingState, p_template: PackedScene ) -> void

Defines basically validation dependencies for the indicator setup but does not solely build report. Be sure to add issues and notes while handling the indicator instantiation process to keep the report updated.

func get_indicators_issues( ) -> Array[String]

Lists issues that are preventing a proper indicators validation during runtime

func finalize( ) -> void

Populate derived fields (distinct tiles, type counts) after core fields set.

func add_issue( p_issue: String ) -> void

Add an extra issue to the report

func has_issues( ) -> bool

Whether the report currently has issues. Useful as a guard check.

func add_note( p_node: String ) -> void

Adds a diagnostics note to the report

func set_test_setups( p_test_setups: Array[CollisionTestSetup2D] ) -> void

Sets the collision object test setups for the report For each indicator that was tested

func validate_setup_environment( p_test_object: Node ) -> bool

Perform preflight validation of indicator setup environment

Checks required dependencies and runtime state before indicator generation. If issues are found they are appended to the provided IndicatorSetupReport so callers can decide whether to abort and surface a clear error report instead of throwing exceptions.

Parameters: p_test_object : Node - The preview/test object that will be used to derive collision shapes. p_tile_check_rules : Array[TileCheckRule] - The set of tile rules that will be evaluated. p_report : IndicatorSetupReport - Mutable report where discovered issues will be pushed.

Returns: bool - True when the environment looks valid (no issues appended); false otherwise.

func to_summary_string( ) -> String

Generates a textual summary of the indicator setup report.

func _ensure_positioner_grid_alignment( ) -> bool

Ensures the positioner is properly aligned to the grid before collision calculations. This prevents asymmetric indicator generation due to fractional positioning. The positioner position is snapped to the nearest tile center for consistent geometry.

:::note[Note] Only updates position if it’s not already aligned within a small tolerance. Includes verbose logging when alignment adjustments are made. :::

func _compute_distinct_tiles( ) -> void

Calculates the number of tiles that have an indicator over them. There should only be one indicator per tile!

addons/grid_building/placement/manager/components/indicator_setup_report.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.