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
rowIdstringnewRowIDataTableRow
AddRow(string, IDataTableRow)
Add a data row to the table
public bool AddRow(string rowId, IDataTableRow row)
Parameters
rowIdstringrowIDataTableRow
Returns
GetAllRows()
Get data rows from table
public IDataTableRow[] GetAllRows()
Returns
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
indexint
Returns
GetRow(string)
Get data row from table by RowId
public IDataTableRow GetRow(string rowId)
Parameters
rowIdstring
Returns
GetRowMap()
Get all data rows as map with RowId as key
public Dictionary<string, IDataTableRow> GetRowMap()
Returns
GetRowStruct()
Get default row struct
public IDataTableRow GetRowStruct()
Returns
GetRowStructType()
Get row struct type
public Type GetRowStructType()
Returns
GetRow<T>(int)
Get data row from table
public T GetRow<T>(int index) where T : class, IDataTableRow
Parameters
indexint
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
predicatePredicate<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
rowIdstring
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
predicatePredicate<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
indexintrowIdstringrowIDataTableRow
Returns
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
ReorderRow(int, int)
Reorder a row
public void ReorderRow(int fromIndex, int toIndex)
Parameters
UpdateRow(string, IDataTableRow)
Update a data row from the table
public bool UpdateRow(string rowId, IDataTableRow newRow)
Parameters
rowIdstringnewRowIDataTableRow