AUTO-GENERATED FILE — DO NOT EDIT MANUALLY
Source: systems/injection/gb_injector_system.gd
Version: 5.0
class_name: GBInjectorSystem
extends: GBSystem
Signals
initial_injection_completed- Emit whenever a node is injected
- Container services as the single source of truth for settings
- within it’s scope for systems and other nodes concerned with grid building
- operations. [br][br]
- [b]Dependencies are injected out of this container by the GBInjectorSystem[/b]
- Debug settings for logging and warnings.
- Note: runtime validation is intentionally NOT auto-run on
_ready()because - other game-level dependencies (GB level context, GBOwner, etc.) may not be
- fully settled. Call
run_validation()from your world/initializer script - after those dependencies are created and injected.
- 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.
- Debug settings for logging and warnings.
node_injected(node: Node)- Container services as the single source of truth for settings
- within it’s scope for systems and other nodes concerned with grid building
- operations. [br][br]
- [b]Dependencies are injected out of this container by the GBInjectorSystem[/b]
- Debug settings for logging and warnings.
- Note: runtime validation is intentionally NOT auto-run on
_ready()because - other game-level dependencies (GB level context, GBOwner, etc.) may not be
- fully settled. Call
run_validation()from your world/initializer script - after those dependencies are created and injected.
- 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.
- Debug settings for logging and warnings.
connectionsifififif
Exports
composition_container- _logger = p_config.get_logger()
No validation call needed - injector handles it automatically
- [i]Nodes that implement
resolve_gb_dependencies(p_config: GBCompositionContainer) - will be injected automatically by this system.[/i]
injection_roots- container — it holds a reference to one and performs injection and validation.
- Setup Requirements:
- Assign a
GBCompositionContainerresource to this injector
- Assign a
- Ensure
GBLevelContextandGBOwnerare properly configured before
- Ensure
- the injector runs (usually in
_ready()methods) - The injector will automatically validate after injection and log any issues
- Usage Example:
In your scene node:
- func resolve_gb_dependencies(p_config: GBCompositionContainer) -> void:
- _composition_container = p_config
- _logger = p_config.get_logger()
No validation call needed - injector handles it automatically
- [i]Nodes that implement
resolve_gb_dependencies(p_config: GBCompositionContainer) - will be injected automatically by this system.[/i]
Methods
resolve_gb_dependencies(p_config: GBCompositionContainer) -> void- _composition_container = p_config
- _logger = p_config.get_logger()
No validation call needed - injector handles it automatically
- [i]Nodes that implement
resolve_gb_dependencies(p_config: GBCompositionContainer) - will be injected automatically by this system.[/i]
_init(p_composition_container: GBCompositionContainer = null)_ready_initializeget_injection_roots -> Array- Return the list of root nodes for injection
validate_runtime -> bool- Prefer the container’s runtime issues first (authoritative)
run_validation -> boolget_editor_issues -> Arrayget_runtime_issues -> Array_inject_existing(p_node: Node) -> void_on_node_added_to_scope(p_scope: Node, p_node: Node) -> voidcreate_with_injection(p_parent: Node, container: GBCompositionContainer) -> GBInjectorSystemresolve_gb_dependencies(p_config: GBCompositionContainer) -> void- _composition_container = p_config
- _logger = p_config.get_logger()
No validation call needed - injector handles it automatically
- [i]Nodes that implement
resolve_gb_dependencies(p_config: GBCompositionContainer) - will be injected automatically by this system.[/i]
inject_node(p_node: Node) -> boolinject_recursive(p_node: Node) -> voidset_injection_meta(p_node: Node) -> voidremove_injection_meta(p_node: Node) -> void_on_child_entered_tree(p_node: Node) -> void- Kept for backward compatibility if something still connects; prefer _on_node_added now
_on_node_exiting_tree(p_node: Node) -> void_connect_child_entered_tree(p_node: Node) -> void_disconnect_child_entered_tree(p_node: Node) -> void_connect_tree_exiting(p_node: Node) -> void_disconnect_tree_exiting(p_node: Node) -> void_connect_scene_tree_node_added -> void_on_scene_tree_node_added(p_node: Node) -> void_validate_after_injection -> void_report_warning(message: String) -> void