Table of Contents

Interface IGrid<TPoint>

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

A grid interface that is not generic in the cell type. This is useful if you do not care about the cell type, and for implementing casting of grid contents.

[Version(1, 8, 0)]
public interface IGrid<TPoint> : IGridSpace<TPoint>, IEnumerable<TPoint>, IEnumerable where TPoint : IGridPoint<TPoint>

Type Parameters

TPoint
Inherited Members
Extension Methods

Properties

this[TPoint]

Accesses a cell in the given point.

object this[TPoint point] { get; set; }

Parameters

point TPoint

Property Value

object

Values

A enumerable containing all the values of this grid.

IEnumerable Values { get; }

Property Value

IEnumerable

Examples

For example, the following two pieces of code do the same:

foreach(var point in grid)
{
	Debug.Log(grid[point]);
}

foreach(var value in grid.Values)
{
	Debug.Log(value);
}

Methods

CloneStructure<TNewCell>()

Returns a grid with exactly the same structure, but potentially holding elements of a different type.

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

Returns

IGrid<TNewCell, TPoint>

Type Parameters

TNewCell

GetAllNeighbors(TPoint)

Returns the neighbors of this point, regardless of whether they are in the grid or not.

IEnumerable<TPoint> GetAllNeighbors(TPoint point)

Parameters

point TPoint

Returns

IEnumerable<TPoint>

GetLargeSet(int)

This functions returns a large number of points around the origin.

This is useful(when used with big enough n) to determine whether a grid that is missing points is doing so because of an incorrect test function, or an incorrect storage rectangle.

Use for debugging.

[Version(1, 1, 0)]
IEnumerable<TPoint> GetLargeSet(int n)

Parameters

n int

Returns

IEnumerable<TPoint>

GetStoragePoints()

This method returns all points that can be contained by the storage rectangle for this grid.

This is useful for debugging shape functions.

[Version(1, 1, 0)]
IEnumerable<TPoint> GetStoragePoints()

Returns

IEnumerable<TPoint>