Table of Contents

Class DataTable

Namespace
Ceres.DataDriven
Assembly
Ceres.dll
public class DataTable : ScriptableObject
Inheritance
DataTable

Constructors

DataTable()

public DataTable()

Methods

AddOrUpdateRow(string, IDataTableRow)

Add or update a data row from the table

public void AddOrUpdateRow(string rowId, IDataTableRow newRow)

Parameters

rowId string
newRow IDataTableRow

AddRow(string, IDataTableRow)

Add a data row to the table

public bool AddRow(string rowId, IDataTableRow row)

Parameters

rowId string
row IDataTableRow

Returns

bool

GetAllRows()

Get data rows from table

public IDataTableRow[] GetAllRows()

Returns

IDataTableRow[]

GetAllRows<T>()

Get data rows from table

public T[] GetAllRows<T>() where T : class, IDataTableRow

Returns

T[]

Type Parameters

T

GetRow(int)

Get data row from table by index

public IDataTableRow GetRow(int index)

Parameters

index int

Returns

IDataTableRow

GetRow(string)

Get data row from table by RowId

public IDataTableRow GetRow(string rowId)

Parameters

rowId string

Returns

IDataTableRow

GetRowMap()

Get all data rows as map with RowId as key

public Dictionary<string, IDataTableRow> GetRowMap()

Returns

Dictionary<string, IDataTableRow>

GetRowStruct()

Get default row struct

public IDataTableRow GetRowStruct()

Returns

IDataTableRow

GetRowStructType()

Get row struct type

public Type GetRowStructType()

Returns

Type

GetRow<T>(int)

Get data row from table

public T GetRow<T>(int index) where T : class, IDataTableRow

Parameters

index int

Returns

T

Type Parameters

T

GetRow<T>(Predicate<T>)

Get data row from table by predicate

public T GetRow<T>(Predicate<T> predicate) where T : class, IDataTableRow

Parameters

predicate Predicate<T>

Returns

T

Type Parameters

T

GetRow<T>(string)

Get data row from table by RowId

public T GetRow<T>(string rowId) where T : class, IDataTableRow

Parameters

rowId string

Returns

T

Type Parameters

T

GetRows<T>(Predicate<T>)

Get data rows from table by predicate

public T[] GetRows<T>(Predicate<T> predicate) where T : class, IDataTableRow

Parameters

predicate Predicate<T>

Returns

T[]

Type Parameters

T

InsertRow(int, string, IDataTableRow)

Insert a row to dataTable

public bool InsertRow(int index, string rowId, IDataTableRow row)

Parameters

index int
rowId string
row IDataTableRow

Returns

bool

RemoveAllRows()

Remove all data rows from the table

public void RemoveAllRows()

RemoveRow(List<int>)

Remove data rows from the table

public void RemoveRow(List<int> rowIndex)

Parameters

rowIndex List<int>

ReorderRow(int, int)

Reorder a row

public void ReorderRow(int fromIndex, int toIndex)

Parameters

fromIndex int
toIndex int

UpdateRow(string, IDataTableRow)

Update a data row from the table

public bool UpdateRow(string rowId, IDataTableRow newRow)

Parameters

rowId string
newRow IDataTableRow

Returns

bool