Class DynamicGrid<T>
public class DynamicGrid<T>
Type Parameters
T
- Inheritance
-
DynamicGrid<T>
- Derived
- Inherited Members
- Extension Methods
Fields
grid
protected Dictionary<(int, int), T> grid
Field Value
- Dictionary<(int, int), T>
Properties
Children
public IEnumerable<T> Children { get; }
Property Value
- IEnumerable<T>
this[int]
Gets child at the specified index with O(1) performance
public T this[int index] { get; }
Parameters
indexint
Property Value
- T
Length
Gets the number of children in the grid (same as GetCount but more intuitive)
public int Length { get; }
Property Value
MaxColumns
public int MaxColumns { get; }
Property Value
MaxRows
public int MaxRows { get; }
Property Value
Methods
Add(T, int, int)
public void Add(T item, int column, int row)
Parameters
Clear()
public void Clear()
FindChildAtIndex(int)
public T FindChildAtIndex(int index)
Parameters
indexint
Returns
- T
Get(int, int)
public T Get(int column, int row)
Parameters
Returns
- T
GetChildren()
public IEnumerable<T> GetChildren()
Returns
- IEnumerable<T>
GetChildrenAsSpans()
public Span<T> GetChildrenAsSpans()
Returns
- Span<T>
GetColumn(int)
public IEnumerable<T> GetColumn(int column)
Parameters
columnint
Returns
- IEnumerable<T>
GetColumnCountForRow(int)
Returns the column count for the specified row. This value is cached and updated each time an item is added.
public int GetColumnCountForRow(int row)
Parameters
rowintRow number to get the column count for.
Returns
- int
Number of columns in the specified row.
GetCount()
public int GetCount()
Returns
GetRow(int)
public IEnumerable<T> GetRow(int row)
Parameters
rowint
Returns
- IEnumerable<T>