Class HexTerrainNativeListChunkedDataLayer<TItem>
Inheritance
HexTerrainNativeListChunkedDataLayer<TItem>
Assembly: fwt.hexterrains.dll
Syntax
public abstract class HexTerrainNativeListChunkedDataLayer<TItem> : NativeListChunkedDataLayer<TItem>, IDisposable, ICommitChanges, IListDataLayer<TItem> where TItem : unmanaged
Type Parameters
Fields
_settings
Declaration
protected HexTerrainSettings _settings
Field Value
Properties
CellsGridSize
Width and Height of the grid of cells.
Declaration
public override int2 CellsGridSize { get; }
Property Value
Overrides
ChunkGridSize
Width and Height of the grid of chunks.
Declaration
public override int2 ChunkGridSize { get; }
Property Value
Overrides
ChunkSize
Width and Height of the chunk in cells.
Declaration
public override int2 ChunkSize { get; }
Property Value
Overrides
IsConnectedHorizontally
True if left and right edges of the chunk are connected (like in civilization games).
Needed for wrapping the grid.
If SetCellDirty(cellIndex, checkEdges) is called with checkEdges == true, the chunk of the cell is marked dirty
and also all adjacent chunks are also marked dirty. So if the left edge is dirty, the right edge is also dirty.
Declaration
public override bool IsConnectedHorizontally { get; }
Property Value
Overrides
IsConnectedVertically
True if top and bottom edges of the chunk are connected (like in civilization games).
Needed for wrapping the grid.
If SetCellDirty(cellIndex, checkEdges) is called with checkEdges == true, the chunk of the cell is marked dirty
and also all adjacent chunks are also marked dirty. So if the top edge is dirty, the bottom edge is also dirty.
Declaration
public override bool IsConnectedVertically { get; }
Property Value
Overrides
Settings
Declaration
public HexTerrainSettings Settings { get; }
Property Value
Methods
Cleanup()
Declaration
public abstract void Cleanup()
CleanupAsync(JobHandle)
Declaration
public abstract JobHandle CleanupAsync(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
Init(int, HexTerrainSettings)
Declaration
public virtual void Init(int layerSize, HexTerrainSettings settings)
Parameters
ScheduleMarkDirtyChunksDirtyJob(JobHandle)
If DirtyChunks native parallel hash set contains chunk indexes that are not marked as dirty in ChunkDirtyGrid, call this function.
It schedules a job that marks all chunks in DirtyChunks as dirty in ChunkDirtyGrid.
Some jobs that update data simply add dirty chunk index to the DirtyChunks native parallel hash set,
but they don't mark those chunks as dirty in the ChunkDirtyGrid,
because the IJobParallelFor does not allow to write in any index except the one the Execute(index) function is called with.
This function is responsible for marking those chunks as dirty in the ChunkDirtyGrid.
Declaration
public virtual JobHandle ScheduleMarkDirtyChunksDirtyJob(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
job handle to schedule a job with as a dependency
|
Returns
| Type |
Description |
| JobHandle |
job handle of scheduled job
|
Implements
Extension Methods