Table of Contents

Interface IFlexalonSlottedLayout

Namespace
Flexalon
Assembly
Flexalon.dll

A layout that supports querying and placing objects at discrete locations.

public interface IFlexalonSlottedLayout

Methods

GetSlot(GameObject)

Captures the object's current resolved slot, or null if it has no placement in this layout.

FlexalonSlot? GetSlot(GameObject gameObject)

Parameters

gameObject GameObject

Returns

FlexalonSlot?

PlaceInOrder(GameObject, int)

Parents the object to this layout at the supplied sibling index and configures it for placement in hierarchy order. Cell layouts clear explicit placement while preserving the cell component's enabled state, span, and overlap settings.

void PlaceInOrder(GameObject gameObject, int siblingIndex)

Parameters

gameObject GameObject
siblingIndex int

PlaceInSlot(GameObject, in FlexalonSlot)

Parents the object to this layout and applies a slot belonging to it without searching or checking occupancy. Implementations establish the sibling order required for slot placement. Cell layouts enable explicit placement, preserve span and overlap settings, and use sibling index zero to give the object placement priority.

void PlaceInSlot(GameObject gameObject, in FlexalonSlot slot)

Parameters

gameObject GameObject
slot FlexalonSlot

PreparePlaceholder(GameObject, GameObject)

Copies the dragged object's layout-specific options to a placeholder without changing the source. May be called again when the selected placement changes.

void PreparePlaceholder(GameObject gameObject, GameObject placeholder)

Parameters

gameObject GameObject
placeholder GameObject

TryGetFirstOpenSlot(in FlexalonSlotQuery, out FlexalonSlot)

Finds the first fitting open span in layout order. Does not require overlap with the item bounds.

bool TryGetFirstOpenSlot(in FlexalonSlotQuery query, out FlexalonSlot slot)

Parameters

query FlexalonSlotQuery

The item, intended bounds center, and optional candidate filter.

slot FlexalonSlot

The selected slot, or default if no candidate is accepted.

Returns

bool

TryGetNearestOpenSlot(in FlexalonSlotQuery, SwapMode, in FlexalonSlot?, out FlexalonSlot, out FlexalonSlot)

Finds the nearest fitting open slot near the item center. Cell layouts also check immediate neighboring placements for multi-cell items.

bool TryGetNearestOpenSlot(in FlexalonSlotQuery query, SwapMode swapMode, in FlexalonSlot? swapSlot, out FlexalonSlot slot, out FlexalonSlot swapDestination)

Parameters

query FlexalonSlotQuery

The item, intended bounds center, and optional candidate filter.

swapMode SwapMode

NoSwap requires an open candidate. AllowSwap also accepts a candidate with one eligible occupant, reported in the slot's SwapNode. RequireSwap only accepts candidates with an occupant. The query does not move or exchange objects.

swapSlot FlexalonSlot?

Optional slot the occupant would move to, such as the dragged item's starting slot. When set, candidates are rejected unless TryGetSwapSlot finds a placement for the occupant there that does not overlap the candidate.

slot FlexalonSlot

The selected slot, or default if no candidate is accepted.

swapDestination FlexalonSlot

Where the selected slot's occupant would move, or default if the slot has no occupant or no swapSlot was given.

Returns

bool

TryGetNearestSlot(in FlexalonSlotQuery, out FlexalonSlot)

Finds a fitting slot near the item center, using the layout's candidate and occupancy rules.

bool TryGetNearestSlot(in FlexalonSlotQuery query, out FlexalonSlot slot)

Parameters

query FlexalonSlotQuery
slot FlexalonSlot

Returns

bool

TryGetSwapSlot(GameObject, in FlexalonSlot, out FlexalonSlot)

Finds a placement for the item that covers this slot, preferring the slot itself and otherwise the fitting placement nearest to it, so an item larger than the slot can shift to fit. Does not move the item. Cell layouts require containment within the solved layout and delegated row, ignore the item's existing placement and nonblocking overlaps, and check only top-level blockers when placing a whole row. Returns false for a slot owned by another layout or unavailable layout geometry.

bool TryGetSwapSlot(GameObject gameObject, in FlexalonSlot slot, out FlexalonSlot result)

Parameters

gameObject GameObject
slot FlexalonSlot
result FlexalonSlot

Returns

bool