PlaceableSequenceFactory
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Factory utilities for creating and normalizing PlaceableSequence collections.
Source File: addons/grid_building/placeables/placeable_sequence_factory.gd
Extends: RefCounted
Public Methods
from_placeables
Flags: static
Converts an array of individual Placeables into single-item PlaceableSequences. Each Placeable becomes a sequence containing only that one item, preserving the original display name and allowing it to work with sequence-based UI components.
placeables Array of Placeable resources to convert
[return] Array of PlaceableSequence objects, each containing one original Placeable
Usage Example:
Note: Null placeables are automatically filtered out during conversion.
ensure_sequences
Flags: static
Normalizes a mixed array of Placeables and PlaceableSequences into sequences only. This implements the “normalize_sequences” pattern suggested in the documentation, allowing flexible input while ensuring consistent sequence-based output for UI components.
mixed Array containing any combination of Placeable and PlaceableSequence objects
[return] Array containing only PlaceableSequence objects (singles wrapped, sequences preserved)
Usage Example:
Behavior:
- PlaceableSequence objects are preserved as-is
- Placeable objects are wrapped in single-item sequences
- Null items are automatically filtered out
- Maintains original display names and properties