GBLevelContext

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Organizes object requirements for building onto a game level for GBCompositeContainers

Source File: addons/grid_building/components/gb_level_context.gd

Extends: GBGameNode

Exported Properties

  • Property: target_map : TileMapLayer - The TileMapLayer to use as the tile selection target for the grid targeting_state

  • Property: maps : Array[TileMapLayer]

    All maps in the game level.

    Sets this data on the targeting_state.maps during gameplay.

    Auto-include behavior: If target_map is assigned but this array is empty, the target_map will automatically be included in this array. Similarly, if target_map is assigned but not present in this array, it will be automatically added. This ensures the target map is always available for targeting operations.

  • Property: objects_parent: Node2D - Where objects should be placed into the scene under in the scene hierarchy

Private Properties

  • Property: _targeting_state : [GridTargetingState](./grid-targeting-state/) (private)
  • Property: _building_state : [BuildingState](./building-state/) (private)
  • Property: _logger : [GBLogger](./gb-logger/) (private)

Public Methods

resolve_gb_dependencies

1
resolve_gb_dependencies(p_container : GBCompositionContainer) -> void

apply_to

1
2
3
4
apply_to(
    p_targeting: GridTargetingState,
    p_building : BuildingState
) -> void

Applies level configuration to targeting and building states. Assigns target map, maps array, and objects parent to the appropriate states.

p_targeting: GridTargetingState - Targeting state to configure with level maps

p_building: BuildingState - Building state to configure with placement parent


get_editor_issues

1
get_editor_issues() -> Array[String]

Validate setup and return a list of issues with the current object


get_runtime_issues

1
get_runtime_issues() -> Array[String]