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
Methods
Add(Placeable)
Adds a placeable to the catalog.
public void Add(Placeable placeable)
Parameters
placeablePlaceablePlaceable 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
otherCatalogIPlaceableRuntimeCatalogThe catalog to merge from.
strategyCatalogMergeStrategyThe 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
placeablesIEnumerable<Placeable>The placeables to merge.
strategyCatalogMergeStrategyThe 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
idstringID 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
Returns
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)