PreviewBuilder
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
PreviewBuilder
Source File: addons/grid_building/systems/building/components/preview_builder.gd
Extends: GBInjectable
Private Properties
- Property:
_preview_factory: [PreviewFactory](./preview-factory/)(private) - Property:
_current_preview: Node2D = null(private) - Property:
_building_state : [BuildingState](./building-state/)(private) - Property:
_targeting_state : [GridTargetingState](./grid-targeting-state/)(private) - Property:
_logger: [GBLogger](./gb-logger/)(private) - Property:
_building_settings: [BuildingSettings](./building-settings/)(private)
Public Methods
from_container
Flags: static
Factory: Create a PreviewBuilder from a composition container.
This provides a DRY creation path used by systems/tests that have a
GBCompositionContainer holding the required runtime objects.
Args: p_building_settings: BuildingSettings - required settings (not always in container) container: GBCompositionContainer - used to resolve targeting_state, building_state, logger
Returns: PreviewBuilder - constructed and wired, or null on failure
resolve_gb_dependencies
Refresh/resolve dependencies from the composition container. Returns: bool - True if dependencies were found, false otherwise.
get_runtime_issues
Validates that all required dependencies are properly set. Returns: Array[String] - List of validation issues (empty if valid)
initialize
create_preview
Spawns a new preview for the given placeable. Clears the previous one if active.
get_preview
Get the object current previewed for placement
clear_preview
Frees the active preview node.
align_to_grid
update_position
Repositions the preview in world space.
has_active_preview
Optional: Check if a preview is currently being shown.
Private Methods
_init
Flags: private