Interface IListDataLayer<TItem>
Interface for all the data layers that have length and allows to get/set value.
Namespace: Fwt.Core.DataLayers
Assembly: fwt.core.dll
Syntax
public interface IListDataLayer<TItem>
Type Parameters
| Name | Description |
|---|---|
| TItem |
Properties
Length
The length of the data layer.
Declaration
int Length { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
GetData(int)
Returns the data at the specified index.
Declaration
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 |
SetData(int, TItem)
Sets the data at the specified index. Marks affected chunk as dirty.
Declaration
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
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
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 |