Table of Contents

Class PointyRhombGrid<TCell>

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

A rhombille grid in the pointy orientation, that is, there are rhombusses with vertical edges.

[Version(1, 0, 0)]
[Serializable]
public class PointyRhombGrid<TCell> : AbstractSplicedGrid<TCell, PointyRhombPoint, PointyHexPoint>, IGrid<TCell, PointyRhombPoint>, IGrid<PointyRhombPoint>, IGridSpace<PointyRhombPoint>, IEnumerable<PointyRhombPoint>, IEnumerable

Type Parameters

TCell
Inheritance
PointyRhombGrid<TCell>
Implements
Inherited Members
Extension Methods

Constructors

PointyRhombGrid(int, int)

Construct a new grid in the default shape with the given width and height. No transformations are applied to the grid.

Normally, the static factory methods or shape building methods should be used to create grids. These constructors are provided for advanced usage.

public PointyRhombGrid(int width, int height)

Parameters

width int
height int

PointyRhombGrid(int, int, Func<PointyRhombPoint, bool>)

Construct a new grid whose cells are determined by the given test function.

The test function should only return true for points within the bounds of the default shape.

No transformations are applied to the grid.

Normally, the static factory methods or shape building methods should be used to create grids. These constructors are provided for advanced usage.

public PointyRhombGrid(int width, int height, Func<PointyRhombPoint, bool> isInside)

Parameters

width int
height int
isInside Func<PointyRhombPoint, bool>

PointyRhombGrid(int, int, Func<PointyRhombPoint, bool>, PointyHexPoint)

public PointyRhombGrid(int width, int height, Func<PointyRhombPoint, bool> isInside, PointyHexPoint offset)

Parameters

width int
height int
isInside Func<PointyRhombPoint, bool>
offset PointyHexPoint

PointyRhombGrid(int, int, Func<PointyRhombPoint, bool>, PointyRhombPoint)

Construct a new grid whose cells are determined by the given test function.

The function should only return true for points within the bounds of the rectangle when the given transforms are applied to them.

Normally, the static factory methods or shape building methods should be used to create grids. These constructors are provided for advanced usage.

public PointyRhombGrid(int width, int height, Func<PointyRhombPoint, bool> isInside, PointyRhombPoint offset)

Parameters

width int
height int
isInside Func<PointyRhombPoint, bool>
offset PointyRhombPoint

PointyRhombGrid(int, int, Func<PointyRhombPoint, bool>, Func<PointyRhombPoint, PointyRhombPoint>, Func<PointyRhombPoint, PointyRhombPoint>)

public PointyRhombGrid(int width, int height, Func<PointyRhombPoint, bool> isInside, Func<PointyRhombPoint, PointyRhombPoint> gridPointTransform, Func<PointyRhombPoint, PointyRhombPoint> inverseGridPointTransform)

Parameters

width int
height int
isInside Func<PointyRhombPoint, bool>
gridPointTransform Func<PointyRhombPoint, PointyRhombPoint>
inverseGridPointTransform Func<PointyRhombPoint, PointyRhombPoint>

PointyRhombGrid(int, int, Func<PointyRhombPoint, bool>, Func<PointyRhombPoint, PointyRhombPoint>, Func<PointyRhombPoint, PointyRhombPoint>, IEnumerable<PointyRhombPoint>[])

public PointyRhombGrid(int width, int height, Func<PointyRhombPoint, bool> isInside, Func<PointyRhombPoint, PointyRhombPoint> gridPointTransform, Func<PointyRhombPoint, PointyRhombPoint> inverseGridPointTransform, IEnumerable<PointyRhombPoint>[] neighborDirections)

Parameters

width int
height int
isInside Func<PointyRhombPoint, bool>
gridPointTransform Func<PointyRhombPoint, PointyRhombPoint>
inverseGridPointTransform Func<PointyRhombPoint, PointyRhombPoint>
neighborDirections IEnumerable<PointyRhombPoint>[]

Properties

GridOrigin

Gives the Zero point as transform by this grids transforms.

protected override PointyRhombPoint GridOrigin { get; }

Property Value

PointyRhombPoint

Methods

ArrayPointFromGridPoint(PointyHexPoint)

public static ArrayPoint ArrayPointFromGridPoint(PointyHexPoint point)

Parameters

point PointyHexPoint

Returns

ArrayPoint

BeginShape()

Use this method to begin a shape building sequence.

public static PointyRhombOp<TCell> BeginShape()

Returns

PointyRhombOp<TCell>

CalculateStorage(IEnumerable<PointyRhombPoint>)

public static IntRect CalculateStorage(IEnumerable<PointyRhombPoint> points)

Parameters

points IEnumerable<PointyRhombPoint>

Returns

IntRect

CloneStructure<TNewCellType>()

Returns a grid in the same shape, but with contents in the new type.

public override IGrid<TNewCellType, PointyRhombPoint> CloneStructure<TNewCellType>()

Returns

IGrid<TNewCellType, PointyRhombPoint>

Type Parameters

TNewCellType

Default(int, int)

public static PointyRhombGrid<TCell> Default(int width, int height)

Parameters

width int
height int

Returns

PointyRhombGrid<TCell>

DefaultContains(PointyRhombPoint, int, int)

public static bool DefaultContains(PointyRhombPoint point, int width, int height)

Parameters

point PointyRhombPoint
width int
height int

Returns

bool

Diamond(int)

public static PointyRhombGrid<TCell> Diamond(int side)

Parameters

side int

Returns

PointyRhombGrid<TCell>

DownTriangle(int)

public static PointyRhombGrid<TCell> DownTriangle(int side)

Parameters

side int

Returns

PointyRhombGrid<TCell>

FatRectangle(int, int)

public static PointyRhombGrid<TCell> FatRectangle(int width, int height)

Parameters

width int
height int

Returns

PointyRhombGrid<TCell>

GridPointFromArrayPoint(ArrayPoint)

public static PointyHexPoint GridPointFromArrayPoint(ArrayPoint point)

Parameters

point ArrayPoint

Returns

PointyHexPoint

Hexagon(int)

public static PointyRhombGrid<TCell> Hexagon(int side)

Parameters

side int

Returns

PointyRhombGrid<TCell>

MakePoint(PointyHexPoint, int)

protected override PointyRhombPoint MakePoint(PointyHexPoint basePoint, int index)

Parameters

basePoint PointyHexPoint
index int

Returns

PointyRhombPoint

MakeUnderlyingGrid(int, int)

protected override IGrid<TCell[], PointyHexPoint> MakeUnderlyingGrid(int width, int height)

Parameters

width int
height int

Returns

IGrid<TCell[], PointyHexPoint>

Parallelogram(int, int)

public static PointyRhombGrid<TCell> Parallelogram(int width, int height)

Parameters

width int
height int

Returns

PointyRhombGrid<TCell>

Rectangle(int, int)

public static PointyRhombGrid<TCell> Rectangle(int width, int height)

Parameters

width int
height int

Returns

PointyRhombGrid<TCell>

Single()

public static PointyRhombGrid<TCell> Single()

Returns

PointyRhombGrid<TCell>

SingleGroup()

public static PointyRhombGrid<TCell> SingleGroup()

Returns

PointyRhombGrid<TCell>

ThinRectangle(int, int)

public static PointyRhombGrid<TCell> ThinRectangle(int width, int height)

Parameters

width int
height int

Returns

PointyRhombGrid<TCell>

ToString()

public override string ToString()

Returns

string

UpTriangle(int)

public static PointyRhombGrid<TCell> UpTriangle(int side)

Parameters

side int

Returns

PointyRhombGrid<TCell>