Skip to content

GBInjectableFactory

Factory for creating and injecting RefCounted objects with dependencies.

Provides centralized creation of RefCounted objects that need dependency injection since they cannot be automatically discovered by the GBInjectorSystem.

static func create_collision_mapper( container: GBCompositionContainer ) -> CollisionMapper

Creates and injects a CollisionMapper with dependencies.

static func create_indicator_service( container: GBCompositionContainer, parent: Node2D ) -> IndicatorService

Creates and injects an IndicatorManager with dependencies.

parent: Node2D - The parent node for indicators (required - cannot be resolved from container)

static func create_placement_validator( container: GBCompositionContainer ) -> PlacementValidator

Creates and injects a PlacementValidator with dependencies.

static func create_test_setup_factory( container: GBCompositionContainer ) -> TestSetupFactory

Creates and injects a TestSetupFactory with dependencies.

static func create_and_inject( container: GBCompositionContainer, object_class: Script, constructor_args: Array ) -> RefCounted

Creates and injects any RefCounted object that implements resolve_gb_dependencies. Generic factory method for objects that follow the injection pattern.

constructor_args: Array - Arguments to pass to the constructor (optional)

addons/grid_building/factories/gb_injectable_factory.gd


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