Skip to content

PreviewFactory

Creates a PreviewFactory with dependency injection from container. Container serves as single source of truth for all dependencies. Parameters: container: GBCompositionContainer - The dependency container Returns: PreviewFactory - Fully configured preview factory with validated dependencies

static func create_with_injection( container: GBCompositionContainer ) -> PreviewFactory

Creates a PreviewFactory with dependency injection from container. Container serves as single source of truth for all dependencies. Parameters: container: GBCompositionContainer - The dependency container Returns: PreviewFactory - Fully configured preview factory with validated dependencies

func resolve_gb_dependencies( p_config: GBCompositionContainer ) -> bool

Receives injected dependencies from the composition container. Assigns logger and building settings if available. Returns: bool - True if dependencies were successfully resolved, false otherwise

func get_runtime_issues( ) -> Array[String]

Validates that all required dependencies and state are properly set. Returns an empty array if valid, or a list of issues if not.

func _init( p_building_settings: BuildingSettings, p_logger: GBLogger )
func instance_preview( p_placeable: Placeable, p_positioner: Node2D ) -> Node2D

Places an instance of the p_placeable scene onto the positioner, and strips it of any script types not declared in preview_kept_script_types

The root node of the scene will be assigned the preview_root_script if any is in the settings

addons/grid_building/systems/building/components/preview_factory.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.