Skip to content
ct

Class

IndicatorService2D

Generated GDScript class reference for GridPlacement.IndicatorService2D.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

IndicatorService2D

  • Service component for managing rule-check indicators within IndicatorManager. This class is a service component that IndicatorManager uses to handle the creation, placement, and lifecycle management of RuleCheckIndicator2D instances. It encapsulates the complex logic for indicator setup, collision mapping, and diagnostic reporting while providing a clean interface for IndicatorManager to delegate indicator-related operations. ## Architecture Role IndicatorService2D acts as a specialized component within the IndicatorManager architecture:
  • IndicatorManager: Main coordinator that owns and orchestrates indicator operations
  • IndicatorService2D: Service component that handles the detailed implementation
  • IndicatorFactory2D: Pure logic class for indicator creation and validation ## Key Responsibilities
  • Execute indicator setup workflows with collision mapping and validation
  • Manage indicator lifecycle including creation, positioning, and cleanup
  • Provide diagnostic capabilities and full error reporting
  • Handle collision detection integration with CollisionMapper
  • Generate detailed setup reports for testing and debugging ## Usage Pattern var service = IndicatorService2D.create_with_injection(container, parent_node) var report = service.setup_indicators(test_object, rules, parent_node) var indicators = service.get_indicators() service.reset() For detailed usage guide and examples, see: docs_website/docs/systems/indicator_manager_guide.md Responsibilities:
  • Execute indicator setup workflows with collision mapping and validation
  • Manage indicator lifecycle including creation, positioning, and cleanup
  • Provide diagnostic capabilities and full error reporting
  • Handle collision detection integration with CollisionMapper
  • Generate detailed setup reports for testing and debugging
  • Maintain indicator state and provide access to managed indicators
  • Support full reset functionality with orphaned indicator detection Key Features:
  • Full reset() function with critical cleanup logging and orphaned indicator detection
  • Guarded indicator setup with detailed error reporting and diagnostic metadata
  • Collision mapper integration with test setup management and validation
  • Grid alignment utilities for stable geometry calculations
  • Diagnostic information reporting for debugging indicator state and issues
  • Dependency injection support with full validation
  • Signal emission for indicator state changes to support reactive programming

Source: addons/grid_placement/placement/manager/components/indicator_service_2d.gd

Syntax

class IndicatorService2D extends PlacementInjectable

Members

NameKindSummary
indicators_changedSignalEmitted when the active RuleCheckIndicators change. Usually in response to a placement or move action that needs rule evaluation for TileCheckRules. Also emitted during reset operations when indicators are cleared.
create_with_injectionMethod
resolve_placement_dependenciesMethod
force_updateMethod
get_runtime_issuesMethod
resetMethod
get_indicatorsMethod
get_collision_mapperMethod
set_indicatorsMethod
setup_indicatorsMethod
calculate_indicator_countMethod
get_or_create_testing_indicatorMethod
get_colliding_indicatorsMethod
get_colliding_nodesMethod
free_indicatorsMethod
clear_indicatorsMethod