Table of Contents

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

int

SequenceCount

Gets the number of sequences in the catalog.

public int SequenceCount { get; }

Property Value

int

Methods

Add(PlaceableEntry)

Adds a placeable to the catalog.

public void Add(PlaceableEntry entry)

Parameters

entry PlaceableEntry

Entry to add.

AddSequence(PlaceableSequence)

Adds a placeable sequence to the catalog.

public void AddSequence(PlaceableSequence sequence)

Parameters

sequence PlaceableSequence

Sequence 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

category string

Category 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

id string

Sequence ID.

Returns

PlaceableSequence

The sequence if found, null otherwise.

Remove(string)

Removes a placeable from the catalog.

public bool Remove(string id)

Parameters

id string

ID 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

id string

Placeable ID.

entry PlaceableEntry

The entry if found, null otherwise.

Returns

bool

True if found, false otherwise.