GBCompositionContainer
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Dependency injection root for context-specific Grid Building setup.
Source File: addons/grid_building/resources/gb_composition_container.gd
Extends: GBResource
Exported Properties
- Property:
config: [GBConfig](./gb-config/)- Main configuration resource for the grid building system.
Private Properties
- Property:
_contexts: [GBContexts](./gb-contexts/) = null(private) - Cached contexts instance for dependency resolution. - Property:
_states: [GBStates](./gb-states/) = null(private) - Cached states instance for system coordination. - Property:
_logger : [GBLogger](./gb-logger/) = null(private) - Cached logger instance for debugging and warnings.
Public Methods
get_contexts
Gets or creates the contexts container for dependency injection.
return: GBContexts - Contexts container with all system contexts
get_states
Gets or creates the states container for all system states.
return: GBStates - States container with targeting, building, manipulation states
get_logger
Gets or creates the centralized logger instance.
return: GBLogger - Logger instance for error/warning reporting
get_mode_state
Gets the mode state from the states container.
get_targeting_state
Gets the grid targeting state from the states container.
get_building_state
Gets the building state from the states container.
get_manipulation_state
Gets the manipulation state from the states container.
get_settings
Gets the main settings configuration resource.
get_placement_rules
Gets the placement rules array from settings.
get_visual_settings
Gets the visual settings from the main settings.
get_systems_context
Gets the systems context from the contexts container.
get_manipulation_settings
Gets the manipulation settings from the main settings.
get_runtime_checks
Gets the runtime checks configuration resource.
get_templates
Gets the templates resource from configuration.
get_indicator_context
Gets the placement context from the contexts container.
get_actions
Gets the input actions configuration resource.
get_debug_settings
Gets the debug settings from the main settings configuration.
get_editor_issues
Gets all issues that would prevent proper operation in the editor.
get_runtime_issues
Gets all issues that would prevent the grid building systems from operating. This should be called after your level is loaded with GBLevelContext and a GBOwner is set to the GBOwnerContext
log_runtime_issues
Convenience: Log runtime issues using the container’s logger. Useful for quick smoke-tests from host scripts or for initial boot-time diagnostics. Returns the issue array for programmatic inspection as well.
validate_editor
Runs validation checks on editor setup to ensure required resources are set
validate_runtime
Validates runtime configuration and dependencies.
Note: Validation is automatically handled by GBInjectorSystem after dependency injection. This method is primarily for manual validation in special cases or debugging.
Usage Examples:
Returns: true if all runtime checks pass, false otherwise
Private Methods
_log_placement_rules_summary
Flags: private
_get_debug_settings_for_logger
Flags: private
Internal helper to get debug settings without logging (for logger initialization)