Click or drag to resize

GridExtensions Class

Defines extension methods for the IGrid interface. This is implemented as an extension so that implementers need not extend from a common base class, but provide it to their clients.
Inheritance Hierarchy
SystemObject
  Gamelogic.GridsGridExtensions

Namespace:  Gamelogic.Grids
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[VersionAttribute(1, 0, 0)]
public static class GridExtensions

The GridExtensions type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCode exampleApplyTCell, TPoint
Applies the given action to all cells in the grid.
Public methodStatic memberCastValuesTNewCell, TPoint
Returns a new grid in the same shape as the given grid, with the same contents casted to the new type.
Public methodStatic memberCloneTCell, TPoint
Returns a shallow copy of the given grid.
Public methodStatic memberCloneStructureTNewCell, TPoint(IGridTPoint, FuncTNewCell)
Clones the given grid, and fills all cells of the cloned grid with the value returned by createValue.
Public methodStatic memberCloneStructureTNewCell, TPoint(IGridTPoint, FuncTPoint, TNewCell)
Clones the given grid, and fills the cell at each point of the cloned grid with the value returned by createValue when the point is passed as a parameter.
Public methodStatic memberCloneStructureTNewCell, TPoint(IGridTPoint, TNewCell)
Clones the given grid, and fills all cells of the cloned grid with the given value.
Public methodStatic memberFillTCell, TPoint(IGridTCell, TPoint, FuncTCell)
Fills all cells of a grid with the value returned by createValue.
Public methodStatic memberFillTCell, TPoint(IGridTCell, TPoint, FuncTPoint, TCell)
Fills the cell of each point of a grid with the value returned by createValue when passed the point as a parameter.
Public methodStatic memberFillTCell, TPoint(IGridTCell, TPoint, TCell)
Fills all cells of a grid with the given value.
Public methodStatic memberGetAllNeighborsTCell, TPoint
Returns all neighbors of this point that satisfies the condition, regardless of whether they are in the grid or not.
Public methodStatic memberGetCellTCell, TPoint
The same as `grid[point]`. This method is included to make it easier to construct certain LINQ expressions, for example grid.Select(grid.GetCell) grid.Where(p => p.GetColor4_2() == 0).Select(grid.GetCell)
Public methodStatic memberGetNeighborHoodT
Returns the points in a grid neighborhood around the given center.
Public methodStatic memberGetNeighborsTCell, TPoint(IGridTCell, TPoint, TPoint)
Only return neighbors of the point that are inside the grid, as defined by Contains.
Public methodStatic memberGetNeighborsTCell, TPoint(IGridTCell, TPoint, TPoint, FuncTCell, Boolean)
Only return neighbors of the point that are inside the grid, as defined by IsInside, whose associated cells also satisfy the predicate includeCell. It is equivalent to GetNeighbors(point).Where(p => includeCell(grid[p])
Public methodStatic memberGetNeighborsTCell, TPoint(IGridTCell, TPoint, TPoint, FuncTPoint, Boolean)
Only return neighbors of the point that are inside the grid, as defined by IsInside, that also satisfies the predicate includePoint. It is equivalent to GetNeighbors(point).Where(includePoint).
Public methodStatic memberIsOutsideTCell, TPoint
Returns whether the point is outside the grid.
Public methodStatic memberSelectValuesAtTCell, TPoint
Returns a list of cells that correspond to the list of points.
Public methodStatic memberSetCellTCell, TPoint
The same as `grid[point] = value`. This method is provided to be consistent with GetCell.
Public methodStatic memberShuffleTCell, TPoint
Shuffles the contents of a grid.
Public methodStatic memberCode exampleTransformValuesTCell, TPoint
Transforms all values in this grid using the given transformation.
Public methodStatic memberWhereCellTCell, TPoint
Returns a list of all points whose associated cells also satisfy the predicate include. It is equivalent to GetNeighbors(point).Where(p => includeCell(grid[p])
Top
See Also