Table of Contents

Class PlaceableRuntimeCatalog

Namespace
MoonBark.GridPlacement.Core.Catalog
Assembly
MoonBark.GridPlacement.Core.dll

Default implementation of IPlaceableRuntimeCatalog. Manages a collection of runtime placeable data. Pure C# with no Godot dependencies.

public class PlaceableRuntimeCatalog : IPlaceableRuntimeCatalog
Inheritance
PlaceableRuntimeCatalog
Implements
Inherited Members

Properties

Count

Gets the number of placeables in the catalog.

public int Count { get; }

Property Value

int

Methods

Add(Placeable)

Adds a placeable to the catalog.

public void Add(Placeable placeable)

Parameters

placeable Placeable

Placeable to add.

Clear()

Clears all placeables from the catalog.

public void Clear()

GetAll()

Gets all available placeables.

public IReadOnlyList<Placeable> GetAll()

Returns

IReadOnlyList<Placeable>

Read-only list of all placeables.

Merge(IPlaceableRuntimeCatalog, CatalogMergeStrategy)

Merges placeables from another catalog into this one.

public CatalogMergeResult Merge(IPlaceableRuntimeCatalog otherCatalog, CatalogMergeStrategy strategy)

Parameters

otherCatalog IPlaceableRuntimeCatalog

The catalog to merge from.

strategy CatalogMergeStrategy

The merge strategy to use.

Returns

CatalogMergeResult

Result of the merge operation.

Merge(IEnumerable<Placeable>, CatalogMergeStrategy)

Merges a collection of placeables into this catalog.

public CatalogMergeResult Merge(IEnumerable<Placeable> placeables, CatalogMergeStrategy strategy)

Parameters

placeables IEnumerable<Placeable>

The placeables to merge.

strategy CatalogMergeStrategy

The merge strategy to use.

Returns

CatalogMergeResult

Result of the merge operation.

Remove(string)

Removes a placeable from the catalog.

public bool Remove(string id)

Parameters

id string

ID of the placeable to remove.

Returns

bool

True if removed, false if not found.

TryGet(int, out Placeable?)

Tries to get a placeable by its deterministic integer ID hash. Specifically used by ECS hotpath systems to avoid string mapping delays.

public bool TryGet(int idHash, out Placeable? placeable)

Parameters

idHash int
placeable Placeable

Returns

bool

TryGet(string, out Placeable?)

Tries to get a placeable by its human-readable ID. Used by bridge layers and UI components.

public bool TryGet(string id, out Placeable? placeable)

Parameters

id string
placeable Placeable

Returns

bool