Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.
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 comprehensive 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 comprehensive 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 comprehensive reset functionality with orphaned indicator detection Key Features:
- Comprehensive 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 comprehensive 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 PlacementInjectableMembers
| Name | Kind | Summary |
|---|---|---|
indicators_changed | Event | Emitted 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. |
p | Property | |
create_with_injection | Method | |
targeting_state | Property | |
logger | Property | |
template | Property | |
manager | Property | |
issues | Property | |
resolve_placement_dependencies | Method | |
collision_mapper_injected | Property | |
force_update | Method | |
get_runtime_issues | Method | |
issues | Property | |
reset | Method | |
p | Property | |
cleanup_parents | Property | |
children | Property | |
p | Property | |
is_service_ready | Method | |
get_indicators | Method | |
get_diagnostic_info | Method | |
info | Property | |
get_collision_mapper | Method | |
set_indicators | Method | |
setup_indicators | Method | |
report | Property | |
testing_indicator | Property | |
setup_result | Property | |
testing_parent | Property | |
test_setups | Property | |
reconciled | Property | |
calculate_indicator_count | Method | |
build_collision_test_setups | Method | |
build_collision_test_setups_with_targeting_state | Method | |
gather_collision_shapes | Method | |
validate_indicator_positions | Method | |
validate_setup_preconditions | Method | |
get_or_create_testing_indicator | Method | |
get_colliding_indicators | Method | |
colliding_indicators | Property | |
use_cache | Property | |
is_col | Property | |
get_colliding_nodes | Method | |
colliding_nodes | Property | |
use_cache | Property | |
is_col | Property | |
colliders | Property | |
count | Property | |
collider | Property | |
add_indicators | Method | |
free_indicators | Method | |
indicators_to_free | Property | |
parent | Property | |
clear_indicators | Method | |
min_x | Property | |
max_x | Property | |
min_y | Property | |
max_y | Property | |
map | Property | |
indicator_tile | Property | |
is_left | Property | |
is_right | Property | |
is_top | Property | |
is_bottom | Property | |
map_layer | Property | |
final_indicators | Property | |
existing_by_pos | Property | |
pos | Property | |
reused_existing | Property | |
new_pos | Property | |
used | Property | |
p | Property | |
leftover | Property | |
p2 | Property |
Source
addons/grid_placement/placement/manager/components/indicator_service_2d.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs