Table of Contents

Class PlaceableSequence

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

Represents an ordered sequence of placeables, typically used as an upgrade path where each tier is a distinct PlaceableEntry.

public class PlaceableSequence
Inheritance
PlaceableSequence
Inherited Members

Constructors

PlaceableSequence(string, string, IEnumerable<PlaceableEntry>)

Creates a new placeable sequence.

public PlaceableSequence(string id, string category, IEnumerable<PlaceableEntry> tiers)

Parameters

id string

Unique identifier for this sequence.

category string

Category for filtering.

tiers IEnumerable<PlaceableEntry>

Ordered list of placeable tiers (must have at least one).

Exceptions

ArgumentNullException

If tiers is null.

ArgumentException

If tiers is empty.

Properties

Category

Category used when grouping or filtering this sequence alongside other placeables in a catalog (for example, "buildings").

public string Category { get; }

Property Value

string

FirstTier

Gets the first tier (base level).

public PlaceableEntry FirstTier { get; }

Property Value

PlaceableEntry

Id

Unique identifier for this sequence.

public string Id { get; }

Property Value

string

LastTier

Gets the last tier (max upgrade).

public PlaceableEntry LastTier { get; }

Property Value

PlaceableEntry

TierCount

Number of tiers in this sequence.

public int TierCount { get; }

Property Value

int

Tiers

Ordered list of placeable tiers, from base to highest tier. The collection is read-only.

public IReadOnlyList<PlaceableEntry> Tiers { get; }

Property Value

IReadOnlyList<PlaceableEntry>

Methods

GetTier(int)

Gets the tier at the specified index.

public PlaceableEntry GetTier(int index)

Parameters

index int

Zero-based tier index.

Returns

PlaceableEntry

The placeable entry at that tier.

Exceptions

ArgumentOutOfRangeException

If index is out of range.

TryGetTier(int, out PlaceableEntry?)

Tries to get the tier at the specified index.

public bool TryGetTier(int index, out PlaceableEntry? tier)

Parameters

index int

Zero-based tier index.

tier PlaceableEntry

The tier if found, null otherwise.

Returns

bool

True if the tier exists, false otherwise.