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

1
get_contexts() -> GBContexts

Gets or creates the contexts container for dependency injection.

return: GBContexts - Contexts container with all system contexts


get_states

1
get_states() -> GBStates

Gets or creates the states container for all system states.

return: GBStates - States container with targeting, building, manipulation states


get_logger

1
get_logger() -> GBLogger

Gets or creates the centralized logger instance.

return: GBLogger - Logger instance for error/warning reporting


get_mode_state

1
get_mode_state() -> ModeState

Gets the mode state from the states container.


get_targeting_state

1
get_targeting_state() -> GridTargetingState

Gets the grid targeting state from the states container.


get_building_state

1
get_building_state() -> BuildingState

Gets the building state from the states container.


get_manipulation_state

1
get_manipulation_state() -> ManipulationState

Gets the manipulation state from the states container.


get_settings

1
get_settings() -> GBSettings

Gets the main settings configuration resource.


get_placement_rules

1
get_placement_rules() -> Array[PlacementRule]

Gets the placement rules array from settings.


get_visual_settings

1
get_visual_settings() -> GBVisualSettings

Gets the visual settings from the main settings.


get_systems_context

1
get_systems_context() -> GBSystemsContext

Gets the systems context from the contexts container.


get_manipulation_settings

1
get_manipulation_settings() -> ManipulationSettings

Gets the manipulation settings from the main settings.


get_runtime_checks

1
get_runtime_checks() -> GBRuntimeChecks

Gets the runtime checks configuration resource.


get_templates

1
get_templates() -> GBTemplates

Gets the templates resource from configuration.


get_indicator_context

1
get_indicator_context() -> IndicatorContext

Gets the placement context from the contexts container.


get_actions

1
get_actions() -> GBActions

Gets the input actions configuration resource.


get_debug_settings

1
get_debug_settings() -> GBDebugSettings

Gets the debug settings from the main settings configuration.


get_editor_issues

1
get_editor_issues() -> Array[String]

Gets all issues that would prevent proper operation in the editor.


get_runtime_issues

1
get_runtime_issues() -> Array[String]

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

1
log_runtime_issues() -> Array[String]

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

1
validate_editor() -> bool

Runs validation checks on editor setup to ensure required resources are set


validate_runtime

1
validate_runtime() -> bool

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:

1
2
3
4
5
6
7
8
Manual validation (rarely needed):
if not composition_container.validate_runtime():
push_error("Grid Building validation failed!")

Get detailed issues for debugging:
var issues = composition_container.get_runtime_issues()
for issue in issues:
print("Issue: ", issue)

Returns: true if all runtime checks pass, false otherwise


Private Methods

_log_placement_rules_summary

1
_log_placement_rules_summary(rules: Array) -> void

Flags: private


_get_debug_settings_for_logger

1
_get_debug_settings_for_logger() -> GBDebugSettings

Flags: private

Internal helper to get debug settings without logging (for logger initialization)