Class PlaceableCatalog
- Namespace
- MoonBark.GridPlacement.Core.Catalog
- Assembly
- MoonBark.GridPlacement.Core.dll
Default implementation of IPlaceableCatalog. Manages a collection of placeables and sequences. Pure C# with no Godot dependencies.
public class PlaceableCatalog : IPlaceableCatalog
- Inheritance
-
PlaceableCatalog
- Implements
- Inherited Members
Properties
Count
Gets the number of entries in the catalog.
public int Count { get; }
Property Value
SequenceCount
Gets the number of sequences in the catalog.
public int SequenceCount { get; }
Property Value
Methods
Add(PlaceableEntry)
Adds a placeable to the catalog.
public void Add(PlaceableEntry entry)
Parameters
entryPlaceableEntryEntry to add.
AddSequence(PlaceableSequence)
Adds a placeable sequence to the catalog.
public void AddSequence(PlaceableSequence sequence)
Parameters
sequencePlaceableSequenceSequence to add.
Clear()
Clears all entries and sequences.
public void Clear()
GetAll()
Gets all available placeables.
public IReadOnlyList<PlaceableEntry> GetAll()
Returns
- IReadOnlyList<PlaceableEntry>
Read-only list of all placeable entries.
GetByCategory(string)
Gets placeables filtered by category.
public IReadOnlyList<PlaceableEntry> GetByCategory(string category)
Parameters
categorystringCategory to filter by (case-insensitive).
Returns
- IReadOnlyList<PlaceableEntry>
Read-only list of matching entries.
GetSequence(string)
Gets a placeable sequence by ID.
public PlaceableSequence? GetSequence(string id)
Parameters
idstringSequence ID.
Returns
- PlaceableSequence
The sequence if found, null otherwise.
Remove(string)
Removes a placeable from the catalog.
public bool Remove(string id)
Parameters
idstringID of the entry to remove.
Returns
- bool
True if removed, false if not found.
TryGet(string, out PlaceableEntry?)
Tries to get a placeable by ID.
public bool TryGet(string id, out PlaceableEntry? entry)
Parameters
idstringPlaceable ID.
entryPlaceableEntryThe entry if found, null otherwise.
Returns
- bool
True if found, false otherwise.