Class ScyllaSparseTriGrid<TCell>.Builder
Fluent builder for constructing ScyllaSparseTriGrid<TCell> instances with complex or optional configuration.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaSparseTriGrid<TCell>.Builder
Remarks
WithLayout(TriGridLayout) must be called before Build() or BuildConcrete(); omitting it throws InvalidOperationException.
Unlike the dense-grid builder, there is no WithDefaultValue option
because a sparse grid only stores explicitly set cells and has no pre-allocated
storage.
Call Synchronized(object) to receive a ScyllaSparseTriGrid<TCell>.SynchronizedScyllaSparseTriGrid from Build(); BuildConcrete() throws when synchronized mode is active.
Methods
Build()
Builds and returns the configured sparse grid or synchronized wrapper.
Declaration
public IScyllaGrid<TriCoord, TCell> Build()
Returns
| Type | Description |
|---|---|
| IScyllaGrid<TriCoord, TCell> | An IScyllaGrid<TCoord, TCell> instance. |
BuildConcrete()
Builds and returns the concrete unsynchronized sparse grid.
Declaration
public ScyllaSparseTriGrid<TCell> BuildConcrete()
Returns
| Type | Description |
|---|---|
| ScyllaSparseTriGrid<TCell> | The configured ScyllaSparseTriGrid instance. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when Synchronized() was called. |
Synchronized(object)
Configures the builder to return a synchronized (thread-safe) wrapper.
Declaration
public ScyllaSparseTriGrid<TCell>.Builder Synchronized(object syncRoot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| object | syncRoot | Optional external lock object. |
Returns
| Type | Description |
|---|---|
| ScyllaSparseTriGrid<TCell>.Builder | This builder instance for method chaining. |
WithBounds(int, int, int, int)
Sets inclusive bounds for the sparse grid on A and B lanes.
Declaration
public ScyllaSparseTriGrid<TCell>.Builder WithBounds(int aMin, int bMin, int aMax, int bMax)
Parameters
| Type | Name | Description |
|---|---|---|
| int | aMin | The minimum A lane value (inclusive). |
| int | bMin | The minimum B lane value (inclusive). |
| int | aMax | The maximum A lane value (inclusive). |
| int | bMax | The maximum B lane value (inclusive). |
Returns
| Type | Description |
|---|---|
| ScyllaSparseTriGrid<TCell>.Builder | This builder instance for method chaining. |
WithLayout(TriGridLayout)
Sets the spatial layout for world-space conversions.
Declaration
public ScyllaSparseTriGrid<TCell>.Builder WithLayout(TriGridLayout layout)
Parameters
| Type | Name | Description |
|---|---|---|
| TriGridLayout | layout | The layout to use. |
Returns
| Type | Description |
|---|---|
| ScyllaSparseTriGrid<TCell>.Builder | This builder instance for method chaining. |