Table of Contents

Class GridExtensions

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

Provides extension methods for grids.

public static class GridExtensions
Inheritance
GridExtensions
Inherited Members

Methods

Apply<TPoint, TCell>(IGrid<TPoint, TCell>, Action<TPoint>)

Applies an action for each cell in the grid.

Apply<TPoint, TCell>(IGrid<TPoint, TCell>, Action<TCell>)

Applies an action for each cell in the grid.

CloneStructure<TPoint, TNewCell>(IGrid<TPoint>, Func<TPoint, TNewCell>)

Creates a grid with a new cell type, and set the value of each cell to the value return by a given function.

CloneStructure<TPoint, TNewCell>(IGrid<TPoint>, Func<TNewCell>)

Creates a grid with a new cell type, and set the value of each cell to the value return by a given function.

CloneStructure<TPoint, TNewCell>(IGrid<TPoint>, TNewCell)

Creates a grid with a new cell type, and set the value of each cell to the given initial value.

Clone<TPoint, TCell>(IGrid<TPoint, TCell>)

Returns a shallow copy of the given grid.

Fill<TPoint, TCell>(IGrid<TPoint, TCell>, Func<TPoint, TCell>)

Sets each cell in the grid to the value returned by a given function.

Fill<TPoint, TCell>(IGrid<TPoint, TCell>, Func<TCell>)

Sets each cell in the grid to the value returned by a given function.

Fill<TPoint, TCell>(IGrid<TPoint, TCell>, TCell)

Sets each cell in the grid to the given value.

GetPoints<TPoint>(IGrid<TPoint>, Func<TPoint, IEnumerable<TPoint>>, TPoint)
GetValue<TPoint, TCell>(IGrid<TPoint, TCell>, TPoint)

Gets the value at the specified point.

In<TPoint>(IEnumerable<TPoint>, IImplicitShape<TPoint>)

Selects all the points in the list also in the given shape.

SetValue<TPoint, TCell>(IGrid<TPoint, TCell>, TPoint, TCell)

Sets the value of a grid at a specified point.

ToGrid<TCell>(IExplicitShape<GridPoint2>)

Creates a new grid in the given shape.

ToGrid<TCell>(IExplicitShape<GridPoint3>)

Creates a new grid in the given shape.

ToGrid<TCell>(IExplicitShape<int>)

Creates a new grid in the given shape.

Transform<TPoint, TCell>(IGrid<TPoint, TCell>, Func<TPoint, TCell, TCell>)

Transforms the contents of a grid using a given transform.

Transform<TPoint, TCell>(IGrid<TPoint, TCell>, Func<TCell, TCell>)

Transforms the contents of a grid using a given transform.