Table of Contents

Class FlatRhombGrid<TCell>

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

A rhombille grid in the flat orientation, that is, there are rhombusses with horizontal edges.

[Version(1, 0, 0)]
[Serializable]
public class FlatRhombGrid<TCell> : AbstractSplicedGrid<TCell, FlatRhombPoint, FlatHexPoint>, IGrid<TCell, FlatRhombPoint>, IGrid<FlatRhombPoint>, IGridSpace<FlatRhombPoint>, IEnumerable<FlatRhombPoint>, IEnumerable

Type Parameters

TCell
Inheritance
FlatRhombGrid<TCell>
Implements
Inherited Members
Extension Methods

Constructors

FlatRhombGrid(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 FlatRhombGrid(int width, int height)

Parameters

width int
height int

FlatRhombGrid(int, int, Func<FlatRhombPoint, 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 FlatRhombGrid(int width, int height, Func<FlatRhombPoint, bool> isInside)

Parameters

width int
height int
isInside Func<FlatRhombPoint, bool>

FlatRhombGrid(int, int, Func<FlatRhombPoint, bool>, FlatHexPoint)

public FlatRhombGrid(int width, int height, Func<FlatRhombPoint, bool> isInside, FlatHexPoint offset)

Parameters

width int
height int
isInside Func<FlatRhombPoint, bool>
offset FlatHexPoint

FlatRhombGrid(int, int, Func<FlatRhombPoint, bool>, FlatRhombPoint)

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 FlatRhombGrid(int width, int height, Func<FlatRhombPoint, bool> isInside, FlatRhombPoint offset)

Parameters

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

FlatRhombGrid(int, int, Func<FlatRhombPoint, bool>, Func<FlatRhombPoint, FlatRhombPoint>, Func<FlatRhombPoint, FlatRhombPoint>)

public FlatRhombGrid(int width, int height, Func<FlatRhombPoint, bool> isInside, Func<FlatRhombPoint, FlatRhombPoint> gridPointTransform, Func<FlatRhombPoint, FlatRhombPoint> inverseGridPointTransform)

Parameters

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

FlatRhombGrid(int, int, Func<FlatRhombPoint, bool>, Func<FlatRhombPoint, FlatRhombPoint>, Func<FlatRhombPoint, FlatRhombPoint>, IEnumerable<FlatRhombPoint>[])

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

Parameters

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

Properties

GridOrigin

Gives the Zero point as transform by this grids transforms.

protected override FlatRhombPoint GridOrigin { get; }

Property Value

FlatRhombPoint

Methods

ArrayPointFromGridPoint(FlatHexPoint)

public static ArrayPoint ArrayPointFromGridPoint(FlatHexPoint point)

Parameters

point FlatHexPoint

Returns

ArrayPoint

BeginShape()

Use this method to begin a shape building sequence.

public static FlatRhombOp<TCell> BeginShape()

Returns

FlatRhombOp<TCell>

CalculateStorage(IEnumerable<FlatRhombPoint>)

public static IntRect CalculateStorage(IEnumerable<FlatRhombPoint> points)

Parameters

points IEnumerable<FlatRhombPoint>

Returns

IntRect

CloneStructure<TNewCellType>()

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

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

Returns

IGrid<TNewCellType, FlatRhombPoint>

Type Parameters

TNewCellType

Default(int, int)

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

Parameters

width int
height int

Returns

FlatRhombGrid<TCell>

DefaultContains(FlatRhombPoint, int, int)

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

Parameters

point FlatRhombPoint
width int
height int

Returns

bool

FatRectangle(int, int)

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

Parameters

width int
height int

Returns

FlatRhombGrid<TCell>

GridPointFromArrayPoint(ArrayPoint)

public static FlatHexPoint GridPointFromArrayPoint(ArrayPoint point)

Parameters

point ArrayPoint

Returns

FlatHexPoint

Hexagon(int)

public static FlatRhombGrid<TCell> Hexagon(int side)

Parameters

side int

Returns

FlatRhombGrid<TCell>

MakePoint(FlatHexPoint, int)

protected override FlatRhombPoint MakePoint(FlatHexPoint basePoint, int index)

Parameters

basePoint FlatHexPoint
index int

Returns

FlatRhombPoint

MakeUnderlyingGrid(int, int)

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

Parameters

width int
height int

Returns

IGrid<TCell[], FlatHexPoint>

Parallelogram(int, int)

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

Parameters

width int
height int

Returns

FlatRhombGrid<TCell>

Rectangle(int, int)

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

Parameters

width int
height int

Returns

FlatRhombGrid<TCell>

Single()

public static FlatRhombGrid<TCell> Single()

Returns

FlatRhombGrid<TCell>

SingleGroup()

public static FlatRhombGrid<TCell> SingleGroup()

Returns

FlatRhombGrid<TCell>

ThinRectangle(int, int)

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

Parameters

width int
height int

Returns

FlatRhombGrid<TCell>

ToString()

public override string ToString()

Returns

string