Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class NativeArrayChunkedDataLayer<TItem>

    Base class for data layers that use NativeArray{T} as a data storage and track changes per chunk.

    Inheritance
    object
    DataLayer
    ChunkedDataLayer
    NativeArrayChunkedDataLayer<TItem>
    Implements
    IDisposable
    ICommitChanges
    IListDataLayer<TItem>
    Inherited Members
    ChunkedDataLayer.CellsGridSize
    ChunkedDataLayer.ChunkGridSize
    ChunkedDataLayer.ChunkSize
    ChunkedDataLayer.IsConnectedHorizontally
    ChunkedDataLayer.IsConnectedVertically
    ChunkedDataLayer.ChunksCount
    ChunkedDataLayer.ChunkDirtyGrid
    ChunkedDataLayer.DirtyChunks
    ChunkedDataLayer.SetCellDirty(int)
    ChunkedDataLayer.SetCellDirty(int, bool)
    ChunkedDataLayer.GetIsChunkDirty(int)
    ChunkedDataLayer.SetChunkDirty(int, bool)
    ChunkedDataLayer.SetAllChunksDirty(bool)
    ChunkedDataLayer.SetAllChunksDirtyAsync(bool, JobHandle)
    ChunkedDataLayer.SetAllChunksDirty()
    ChunkedDataLayer.ClearAllChunksDirty()
    ChunkedDataLayer.MergeChunkDirtyGrids(ChunkedDataLayer, JobHandle)
    ChunkedDataLayer.MergeChunkDirtyGrids(ChunkedDataLayer, ChunkedDataLayer, JobHandle)
    ChunkedDataLayer.MergeChunkDirtyGrids(ChunkedDataLayer, ChunkedDataLayer, ChunkedDataLayer, JobHandle)
    ChunkedDataLayer.MergeChunkDirtyGrids(ChunkedDataLayer, ChunkedDataLayer, ChunkedDataLayer, ChunkedDataLayer, JobHandle)
    ChunkedDataLayer.GetChunkIndexByCellIndex(int)
    ChunkedDataLayer.GetChunkCoord(int2)
    ChunkedDataLayer.GetChunkCoord(int)
    ChunkedDataLayer.GetChunkIndex(int2)
    ChunkedDataLayer.GetCellCoord(int)
    ChunkedDataLayer.GetCellIndex(int2)
    ChunkedDataLayer.ResolveCellCoord(int2)
    ChunkedDataLayer.ResolveChunkCoord(int2)
    DataLayer.IsDisposableItems
    DataLayer._readJobsDependency
    DataLayer.ReadDependency
    DataLayer._writeJobsDependency
    DataLayer.WriteDependency
    DataLayer.CombinedDependency
    DataLayer._isDirty
    DataLayer.IsDirty
    DataLayer._version
    DataLayer.Version
    DataLayer.AddReadDependency(JobHandle)
    DataLayer.AddWriteDependency(JobHandle)
    DataLayer.SetReadDependency(JobHandle)
    DataLayer.SetWriteDependency(JobHandle)
    DataLayer.PrepareToWrite()
    DataLayer.PrepareToRead()
    DataLayer.OpenToRead()
    DataLayer.OpenToWrite()
    DataLayer.CompleteReadJobs()
    DataLayer.CompleteWriteJobs()
    DataLayer.CompleteAllJobs()
    DataLayer.CommitChanges()
    DataLayer.SetDirty(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.Core.DataLayers
    Assembly: fwt.core.dll
    Syntax
    public abstract class NativeArrayChunkedDataLayer<TItem> : ChunkedDataLayer, IDisposable, ICommitChanges, IListDataLayer<TItem> where TItem : unmanaged
    Type Parameters
    Name Description
    TItem

    type of item in data layer

    Fields

    _data

    Declaration
    protected NativeArray<TItem> _data
    Field Value
    Type Description
    NativeArray<TItem>

    Properties

    Data

    Declaration
    public NativeArray<TItem> Data { get; }
    Property Value
    Type Description
    NativeArray<TItem>

    Length

    Returns the number of items in the layer.

    Declaration
    public override int Length { get; }
    Property Value
    Type Description
    int
    Overrides
    DataLayer.Length

    Methods

    Dispose()

    Disposes the layer and calls DisposeAllItems() under the hood

    Declaration
    public override void Dispose()
    Overrides
    ChunkedDataLayer.Dispose()

    DisposeAllItems()

    Disposes all items in the layer. Called on Dispose() if IsDisposableItems is true.

    Declaration
    public override void DisposeAllItems()
    Overrides
    DataLayer.DisposeAllItems()

    DisposeDataItem(TItem)

    Declaration
    protected virtual void DisposeDataItem(TItem item)
    Parameters
    Type Name Description
    TItem item

    DisposeExcessItems(int)

    Declaration
    public virtual void DisposeExcessItems(int layerSize)
    Parameters
    Type Name Description
    int layerSize

    GetData(int)

    Returns the data at the specified index.

    Declaration
    public virtual TItem GetData(int index)
    Parameters
    Type Name Description
    int index

    index to get data at

    Returns
    Type Description
    TItem

    data in a cell with provided index

    Init(int)

    Initializes/Reinitializes the layer with a size of the layer (cells count) and a size of the chunks.

    Declaration
    public override void Init(int layerSize)
    Parameters
    Type Name Description
    int layerSize

    Amount of items (cells) in the data layer

    Overrides
    ChunkedDataLayer.Init(int)

    SetData(int, TItem)

    Sets the data at the specified index. Marks affected chunk as dirty.

    Declaration
    public virtual bool SetData(int index, TItem data)
    Parameters
    Type Name Description
    int index

    index of the cell to put data into

    TItem data

    data to put into the cell with provided index

    Returns
    Type Description
    bool

    true if value was set (not out of the bounds)

    TryGetData(int, out TItem)

    Tries to get the data at the specified index. if index is out of the bounds, returns false and data is set to default value.

    Declaration
    public virtual bool TryGetData(int index, out TItem data)
    Parameters
    Type Name Description
    int index

    index of cell to get data from

    TItem data

    filled with default value if index is out of bounds or contains data from cell with requested index

    Returns
    Type Description
    bool

    TrySetData(int, TItem)

    Tries to set the data at the specified index. If index is out of the bounds, returns false.

    Declaration
    public bool TrySetData(int index, TItem data)
    Parameters
    Type Name Description
    int index

    index of cell to set data into

    TItem data

    data to put into a cell with provided index

    Returns
    Type Description
    bool

    true if value was set

    Implements

    IDisposable
    ICommitChanges
    IListDataLayer<TItem>

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX