BuildingState
Summary
Section titled “Summary”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.
Signals
Section titled “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
Section titled “Properties”placed_parent: Node:
Shared reference to the user controlling the building system.
The parent node where objects are placed during build mode.
preview: Node:
The current preview object in build mode, moving with the mouse until placed.
Methods
Section titled “Methods”func _init( p_owner_context: GBOwnerContext ) -> void
func get_owner( ) -> GBOwner
Returns the placer node from the _owner_context, or null if unset.
func get_editor_issues( ) -> Array[String]
Validates the state’s runtime properties, skipping checks in the editor or when build mode is off.
func get_runtime_issues( ) -> Array[String]
Checks properties that should be set at runtime before building system operations
func _on_placed_parent_tree_exited( ) -> void
Resets placed_parent when it exits the scene tree.
func _on_preview_tree_exited( ) -> void
Resets preview when it exits the scene tree.
Source
Section titled “Source”addons/grid_building/systems/building/building_state.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.