IndicatorSetupReport

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

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.

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

Extends: RefCounted

Properties

  • Property: indicators: Array[RuleCheckIndicator] = [] - The indicators created during setup

  • Property: targeting_state : [GridTargetingState](./grid-targeting-state/) - The targeting state being used for indicators to be created and tested against for placement and validation

  • Property: template : PackedScene - The template being used for instantiating indicators

  • Property: rules: Array[TileCheckRule] = [] - The rules that were being evaluated in the creation of the indicators

  • Property: tile_positions: Array[Vector2i] = [] - All distinct tile positions that were used for the creation of indicators

  • Property: 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

  • Property: owner_shapes : Dictionary[Node2D, Array] = {} - List of owners and their attached collision shapes and polygons

  • Property: indicator_test_setups : Array[CollisionTestSetup2D] = [] - Collision test setups for each collision shape / polygon 2D to be tested.

  • Property: issues : Array[String] = [] - The issues that occured during setup, if any

  • Property: 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.

Public Methods

get_indicators_issues

1
get_indicators_issues() -> Array[String]

Lists issues that are preventing a proper indicators validation during runtime


finalize

1
finalize() -> void

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


add_issue

1
add_issue(p_issue : String) -> void

Add an extra issue to the report


has_issues

1
has_issues() -> bool

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


is_successful

1
is_successful() -> bool

Whether the report indicates a successful setup. [return] true if no issues were recorded, false otherwise.


add_note

1
add_note(p_node : String) -> void

Adds a diagnostics note to the report


set_test_setups

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

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


validate_setup_environment

1
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.


to_summary_string

1
to_summary_string() -> String

Generates a textual summary of the indicator setup report.


Private Methods

_init

1
2
3
4
5
_init(
    p_rules: Array[TileCheckRule],
    p_targeting_state : GridTargetingState,
    p_template : PackedScene
) -> void

Flags: private

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.


_ensure_positioner_grid_alignment

1
_ensure_positioner_grid_alignment() -> bool

Flags: private

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: Only updates position if it’s not already aligned within a small tolerance. Includes verbose logging when alignment adjustments are made.


_compute_distinct_tiles

1
_compute_distinct_tiles() -> void

Flags: private

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