Struct ScyllaTriGrid<TCell>.Enumerator
Value-type enumerator for ScyllaTriGrid<TCell> that yields all cells in row-major order (downward triangle then upward triangle per rectangular position) without heap allocation.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public struct ScyllaTriGrid<TCell>.Enumerator
Remarks
Each call to MoveNext() checks the grid's internal version against the version captured at enumerator construction. Any mutation of the grid between calls causes MoveNext() to throw InvalidOperationException.
Constructors
Enumerator(ScyllaTriGrid<TCell>)
Initializes a new ScyllaTriGrid<TCell>.Enumerator for the specified grid, capturing its current version to enable modification detection.
Declaration
public Enumerator(ScyllaTriGrid<TCell> grid)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaTriGrid<TCell> | grid | The ScyllaTriGrid<TCell> to enumerate. Must not be
|
Properties
Current
Gets the cell at the current position of the enumerator.
Declaration
public readonly (TriCoord Coord, TCell Value) Current { get; }
Property Value
| Type | Description |
|---|---|
| (TriCoord Coord, TCell Value) | A tuple of the TriCoord lane coordinate and the associated
|
Methods
MoveNext()
Advances the enumerator to the next cell in row-major order.
Declaration
public bool MoveNext()
Returns
| Type | Description |
|---|---|
| bool |
|
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when the grid was modified (its version changed) after this enumerator was created. |