Table of Contents

Class NestedGrid

Namespace
Gamelogic.Grids2.Examples
Assembly
Assembly-CSharp.dll
public class NestedGrid : IGrid<GridPoint2, TileCell>, IGrid<GridPoint2>, IExplicitShape<GridPoint2>, IImplicitShape<GridPoint2>, IEnumerable<PointCellPair<GridPoint2, TileCell>>, IEnumerable
Inheritance
NestedGrid
Implements
Inherited Members
Extension Methods

Constructors

NestedGrid(IGrid<GridPoint2, IGrid<GridPoint2, TileCell>>)

public NestedGrid(IGrid<GridPoint2, IGrid<GridPoint2, TileCell>> grid)

Parameters

grid IGrid<GridPoint2, IGrid<GridPoint2, TileCell>>

Properties

Bounds

Returns a bounding shape that contains this explicit shape.

public AbstractBounds<GridPoint2> Bounds { get; }

Property Value

AbstractBounds<GridPoint2>

Remarks

The bounding box is not guarenteed to be tight, that is, there may be a smaller bounding box that also contains the shape.

Cells

Returns all the cells of this grid, that is, the values associated with all points in the grid.

public IEnumerable<TileCell> Cells { get; }

Property Value

IEnumerable<TileCell>

The cells.

this[GridPoint2]

Gets or sets the cell at the specified point.

public TileCell this[GridPoint2 point] { get; set; }

Parameters

point GridPoint2

The point.

Property Value

TileCell

TCell.

Points

Gets all the points this shape contains.

public IEnumerable<GridPoint2> Points { get; }

Property Value

IEnumerable<GridPoint2>

The points.

Methods

CloneStructure<TNewCell>()

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

public IGrid<GridPoint2, TNewCell> CloneStructure<TNewCell>()

Returns

IGrid<GridPoint2, TNewCell>

Cloned Grid.

Type Parameters

TNewCell

Contains(GridPoint2)

Determines whether this implicit shape contains the specified point.

public bool Contains(GridPoint2 point)

Parameters

point GridPoint2

The point.

Returns

bool

true if this shape contains the specified point; otherwise, false.

GetEnumerator()

public IEnumerator<PointCellPair<GridPoint2, TileCell>> GetEnumerator()

Returns

IEnumerator<PointCellPair<GridPoint2, TileCell>>

GetGridPoint(GridPoint2, GridPoint2)

public GridPoint2 GetGridPoint(GridPoint2 bigGridCoordinate, GridPoint2 smallGridCoordinate)

Parameters

bigGridCoordinate GridPoint2
smallGridCoordinate GridPoint2

Returns

GridPoint2