IndicatorFactory
Summary
Section titled “Summary”IndicatorFactory - Creates, positions and manages lifecycle of rule-check indicators.
This class provides both static factory methods for creating indicators and instance methods for managing indicator lifecycle. It serves as the unified interface for all indicator operations in the grid building system.
ARCHITECTURE NOTE: IndicatorFactory instances are typically used within IndicatorManager, which serves as the scene tree parent for rule check indicators. Objects being manipulated should be parented to ManipulationParent instead.
For detailed usage guide and examples, see: docs_website/docs/systems/indicator_manager_guide.md
Static Factory Methods - generate_indicators()
- Creates multiple indicators from position-rules mapping - create_indicator()
- Creates a single indicator at specified position
Section titled “Static Factory Methods - generate_indicators() - Creates multiple indicators from position-rules mapping - create_indicator() - Creates a single indicator at specified position”Instance Methods - setup_indicators()
- Full indicator setup with collision mapping and reporting - reset()
- Comprehensive cleanup with diagnostic capabilities - get_runtime_issues()
- Validation of dependencies and state
Section titled “Instance Methods - setup_indicators() - Full indicator setup with collision mapping and reporting - reset() - Comprehensive cleanup with diagnostic capabilities - get_runtime_issues() - Validation of dependencies and state”Responsibilities: - Create and position RuleCheckIndicator instances for placement validation - Transform absolute collision positions into relative positioning around test objects - Integrate with CollisionMapper to map collision positions to rules - Produce IndicatorSetupReport with diagnostic metadata for tests and logging - Provide dependency-injection friendly constructors and validation helpers - Manage indicator lifecycle with enhanced cleanup and reset functionality - Offer diagnostic capabilities for debugging indicator state and orphaned indicators
Positioning Architecture: The factory implements a normalized relative positioning system where collision detection provides absolute tile coordinates, but indicators are positioned relative to test objects. This ensures indicators maintain consistent spatial relationships when test objects move, while collision results provide meaningful spatial validation patterns.
Key Features: - Comprehensive reset() function with critical cleanup logging and orphaned indicator detection - Diagnostic information reporting for debugging indicator cleanup issues - Guarded indicator setup with detailed error reporting - Collision mapper integration with test setup management - Grid alignment utilities for stable geometry calculations
Source
Section titled “Source”addons/grid_building/placement/manager/components/indicator_factory.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.