Class NativeListChunkedDataLayer<TItem>
Base class for all data layers that are based on NativeList{T}.
Inheritance
NativeListChunkedDataLayer<TItem>
Assembly: fwt.core.dll
Syntax
public abstract class NativeListChunkedDataLayer<TItem> : ChunkedDataLayer, IDisposable, ICommitChanges, IListDataLayer<TItem> where TItem : unmanaged
Type Parameters
| Name |
Description |
| TItem |
type of item stored in the layer
|
Fields
DefaultValue
When the data layer is resized, new cells will be filled with this value.
Declaration
public TItem DefaultValue
Field Value
_data
Declaration
protected NativeList<TItem> _data
Field Value
| Type |
Description |
| NativeList<TItem> |
|
Properties
Data
Container for data in the layer.
Declaration
public NativeList<TItem> Data { get; }
Property Value
| Type |
Description |
| NativeList<TItem> |
|
Length
Number of items in the layer.
Declaration
public override int Length { get; }
Property Value
Overrides
Methods
CopyFrom(in NativeArrayChunkedDataLayer<TItem>)
Declaration
public bool CopyFrom(in NativeArrayChunkedDataLayer<TItem> copyFrom)
Parameters
Returns
CopyFrom(in NativeArrayDataLayer<TItem>)
Declaration
public bool CopyFrom(in NativeArrayDataLayer<TItem> copyFrom)
Parameters
Returns
CopyFrom(in NativeListChunkedDataLayer<TItem>)
Declaration
public bool CopyFrom(in NativeListChunkedDataLayer<TItem> copyFrom)
Parameters
Returns
CopyFrom(in NativeListDataLayer<TItem>)
Declaration
public bool CopyFrom(in NativeListDataLayer<TItem> copyFrom)
Parameters
Returns
CopyFrom(in NativeArray<TItem>)
Declaration
public bool CopyFrom(in NativeArray<TItem> copyFrom)
Parameters
| Type |
Name |
Description |
| NativeArray<TItem> |
copyFrom |
|
Returns
CopyFromAsync(in NativeArrayChunkedDataLayer<TItem>, JobHandle)
Declaration
public JobHandle CopyFromAsync(in NativeArrayChunkedDataLayer<TItem> copyFrom, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CopyFromAsync(in NativeArrayDataLayer<TItem>, JobHandle)
Declaration
public JobHandle CopyFromAsync(in NativeArrayDataLayer<TItem> copyFrom, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CopyFromAsync(in NativeListChunkedDataLayer<TItem>, JobHandle)
Declaration
public JobHandle CopyFromAsync(in NativeListChunkedDataLayer<TItem> copyFrom, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CopyFromAsync(in NativeListDataLayer<TItem>, JobHandle)
Declaration
public JobHandle CopyFromAsync(in NativeListDataLayer<TItem> copyFrom, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CopyFromAsync(in NativeArray<TItem>, JobHandle)
Declaration
public JobHandle CopyFromAsync(in NativeArray<TItem> copyFrom, JobHandle dependency)
Parameters
| Type |
Name |
Description |
| NativeArray<TItem> |
copyFrom |
|
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
Deserialize(BinaryReader)
Deserializes data from the specified binary reader into the current instance.
Declaration
public virtual bool Deserialize(BinaryReader reader)
Parameters
| Type |
Name |
Description |
| BinaryReader |
reader |
The binary reader from which to read the serialized data. Cannot be null.
|
Returns
| Type |
Description |
| bool |
true if the data was successfully deserialized; otherwise, false.
|
Dispose()
Declaration
public override void Dispose()
Overrides
DisposeAllItems()
Declaration
public override void DisposeAllItems()
Overrides
DisposeDataItem(TItem)
Disposes the item in the layer if it is IDisposable.
Declaration
protected virtual void DisposeDataItem(TItem item)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
DisposeExcessItems(int)
Disposes items in layer that are in cells of index greater than layerSize.
Declaration
public virtual void DisposeExcessItems(int layerSize)
Parameters
| Type |
Name |
Description |
| int |
layerSize |
items in cells at index greater than this value will be disposed
|
FillData(TItem)
Fills every cell of layer with provided data.
Declaration
public virtual bool FillData(TItem data)
Parameters
| Type |
Name |
Description |
| TItem |
data |
data to fill the layer with
|
Returns
| Type |
Description |
| bool |
true if successfull
|
FillData(TItem, FillNativeArrayJob<TItem>)
Fills every cell of layer with provided data.
Declaration
public virtual bool FillData(TItem data, FillNativeArrayJob<TItem> job)
Parameters
| Type |
Name |
Description |
| TItem |
data |
data to fill the layer with
|
| FillNativeArrayJob<TItem> |
job |
|
Returns
| Type |
Description |
| bool |
true if successfull
|
FillDataAsync(TItem, FillNativeArrayJob<TItem>, JobHandle)
Fills every cell of layer with provided data asynchronously.
Declaration
public virtual JobHandle FillDataAsync(TItem item, FillNativeArrayJob<TItem> job, JobHandle dependency = default)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
FillDataAsync(TItem, JobHandle)
Fills every cell of layer with provided data asynchronously.
Declaration
public virtual JobHandle FillDataAsync(TItem item, JobHandle dependency = default)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
GetData(int)
Gets the data at the specified index.
Declaration
public virtual TItem GetData(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
cell index to get data from
|
Returns
| Type |
Description |
| TItem |
item from the cell at provided index
|
Init(int)
Initializes/Reinitializes the data layer with the specified size.
Declaration
public override void Init(int layerSize)
Parameters
| Type |
Name |
Description |
| int |
layerSize |
amount of cells in the data layer
|
Overrides
Serialize(BinaryWriter)
Serializes the current data to the specified binary writer.
Declaration
public virtual bool Serialize(BinaryWriter writer)
Parameters
| Type |
Name |
Description |
| BinaryWriter |
writer |
The binary writer to which the data will be written. Cannot be null.
|
Returns
| Type |
Description |
| bool |
true if the data was successfully serialized; otherwise, false.
|
SetData(int, TItem)
Sets the data at the specified index.
Declaration
public virtual bool SetData(int index, TItem data)
Parameters
| Type |
Name |
Description |
| int |
index |
cell index to put data into
|
| TItem |
data |
data to put into the cell at provided index
|
Returns
SetData(TItem[])
Sets data for all cells in the layer.
If the provided array is bigger than the layer size, the layer will be resized.
Declaration
public virtual bool SetData(TItem[] source)
Parameters
| Type |
Name |
Description |
| TItem[] |
source |
source collection to copy data from
|
Returns
TryGetData(int, out TItem)
Tries to get the data at the specified index.
Declaration
public virtual bool TryGetData(int index, out TItem data)
Parameters
| Type |
Name |
Description |
| int |
index |
cell index to get data from
|
| TItem |
data |
data from cell at provided index
|
Returns
| Type |
Description |
| bool |
true if data was found
|
TrySetData(int, TItem)
Tries to set the data at the specified index.
Declaration
public bool TrySetData(int index, TItem data)
Parameters
| Type |
Name |
Description |
| int |
index |
cell index to put data into
|
| TItem |
data |
data to put into the cell at provided index
|
Returns
| Type |
Description |
| bool |
true if data was set
|
Implements
Extension Methods