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 setupProperty:
targeting_state : [GridTargetingState](./grid-targeting-state/)- The targeting state being used for indicators to be created and tested against for placement and validationProperty:
template : PackedScene- The template being used for instantiating indicatorsProperty:
rules: Array[TileCheckRule] = []- The rules that were being evaluated in the creation of the indicatorsProperty:
tile_positions: Array[Vector2i] = []- All distinct tile positions that were used for the creation of indicatorsProperty:
position_rules_map: Dictionary[Vector2i, Array] = {}- The mapping between tile positions and an array of TileCheckRules that were assigned for an indicator at those positionsProperty:
owner_shapes : Dictionary[Node2D, Array] = {}- List of owners and their attached collision shapes and polygonsProperty:
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 anyProperty:
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
Lists issues that are preventing a proper indicators validation during runtime
finalize
Populate derived fields (distinct tiles, type counts) after core fields set.
add_issue
Add an extra issue to the report
has_issues
Whether the report currently has issues. Useful as a guard check.
is_successful
Whether the report indicates a successful setup.
[return] true if no issues were recorded, false otherwise.
add_note
Adds a diagnostics note to the report
set_test_setups
Sets the collision object test setups for the report For each indicator that was tested
validate_setup_environment
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
Generates a textual summary of the indicator setup report.
Private Methods
_init
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
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
Flags: private
Calculates the number of tiles that have an indicator over them. There should only be one indicator per tile!