GBInjectorSystem
Summary
Section titled “Summary”Dependency injection system for the Grid Building Plugin.
Injects the GBCompositionContainer into each node in the scene tree hierarchy, including dynamically added nodes at runtime.
This system simplifies node wiring and dependency resolution during grid building workflows.
Usage: Implement the method:
func resolve_gb_dependencies(p_config: GBCompositionContainer) -> void: # Use the config to assign dependencies
Nodes with this method will automatically be injected.
Signals
Section titled “Signals”signal initial_injection_completed( )
Emits when the initial scene injection is completed
signal node_injected( node: Node )
Emit whenever a node is injected
Properties
Section titled “Properties”composition_container: GBCompositionContainer
Dependency container for injection operations.
injection_roots: Array[Node] = []
Root nodes for injection. These nodes and any children node added will be injected by the GBInjectorSystem. Use this for scoping injection. If left empty, all nodes in the scene tree will be injected.
Methods
Section titled “Methods”_ready( )
get_injection_roots( ) -> Array[Node]
Gets the scoped root nodes for injection
validate_runtime( ) -> bool
Validates the runtime level setup for grid building system to catch issues that would prevent systems and other grid building objects from functioning
Issues will be logged to the GBLogger
get_editor_issues( ) -> Array[String]
get_runtime_issues( ) -> Array[String]
resolve_gb_dependencies( p_config: GBCompositionContainer ) -> void
inject_node( p_node: Node ) -> bool
Injects dependencies into a single node (not recursive). Also connects signals to monitor future children and node exiting.
inject_recursive( p_node: Node ) -> void
Injects dependencies into the node and all its children recursively. Used only on startup to cover existing tree nodes.
set_injection_meta( p_node: Node ) -> void
Sets the meta data on the object following a successful injection.
remove_injection_meta( p_node: Node ) -> void
Removes the injection meta data from the object.
Source
Section titled “Source”addons/grid_building/systems/injection/gb_injector_system.gd
This page was auto-generated from GDScript source. Edit the source file to improve documentation.
Generated on 2025-09-07