BuildingState
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Source File: addons/grid_building/systems/building/building_state.gd
Extends: RefCounted
Signals
Signal:
success(build_action_data: BuildActionData)Manages communication between the building system and connected objects during gameplay. Emits signals for build actions, previews, and state changes to coordinate placement. Validates readiness when the tile map is set, requiring all properties to be assigned in the same frame. Emitted when an object is successfully placed into the game world.
Signal:
failed(build_action_data: BuildActionData)- Emitted when a build action fails.Signal:
preview_changed(preview: Node)- Emitted when the build preview instance changes.Signal:
placed_parent_changed(placed_parent: Node)- Emitted when the parent node for placed objects changes.Signal:
system_changed(system: BuildingSystem)- Emitted when the connected building system changes (currently unused).
Properties
- Property:
placed_parent: Node:- The parent node where objects are placed during build mode. - Property:
preview: Node:- The current preview object in build mode, moving with the mouse until placed.
Private Properties
- Property:
_owner_context: [GBOwnerContext](./gb-owner-context/)(private) - Shared reference to the user controlling the building system.
Public Methods
get_owner
Returns the placer node from the _owner_context, or null if unset.
get_editor_issues
Validates the state’s runtime properties, skipping checks in the editor or when build mode is off.
get_runtime_issues
Checks properties that should be set at runtime before building system operations
Private Methods
_init
Flags: private
_on_placed_parent_tree_exited
Flags: private
Resets placed_parent when it exits the scene tree.
_on_preview_tree_exited
Flags: private
Resets preview when it exits the scene tree.