Class PointyRhombGrid<TCell>
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
-
IGrid<TCell, PointyRhombPoint>
- 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
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
widthintheightintisInsideFunc<PointyRhombPoint, bool>
PointyRhombGrid(int, int, Func<PointyRhombPoint, bool>, PointyHexPoint)
public PointyRhombGrid(int width, int height, Func<PointyRhombPoint, bool> isInside, PointyHexPoint offset)
Parameters
widthintheightintisInsideFunc<PointyRhombPoint, bool>offsetPointyHexPoint
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
widthintheightintisInsideFunc<PointyRhombPoint, bool>offsetPointyRhombPoint
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
widthintheightintisInsideFunc<PointyRhombPoint, bool>gridPointTransformFunc<PointyRhombPoint, PointyRhombPoint>inverseGridPointTransformFunc<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
widthintheightintisInsideFunc<PointyRhombPoint, bool>gridPointTransformFunc<PointyRhombPoint, PointyRhombPoint>inverseGridPointTransformFunc<PointyRhombPoint, PointyRhombPoint>neighborDirectionsIEnumerable<PointyRhombPoint>[]
Properties
GridOrigin
Gives the Zero point as transform by this grids transforms.
protected override PointyRhombPoint GridOrigin { get; }
Property Value
Methods
ArrayPointFromGridPoint(PointyHexPoint)
public static ArrayPoint ArrayPointFromGridPoint(PointyHexPoint point)
Parameters
pointPointyHexPoint
Returns
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
pointsIEnumerable<PointyRhombPoint>
Returns
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
Returns
- PointyRhombGrid<TCell>
DefaultContains(PointyRhombPoint, int, int)
public static bool DefaultContains(PointyRhombPoint point, int width, int height)
Parameters
pointPointyRhombPointwidthintheightint
Returns
Diamond(int)
public static PointyRhombGrid<TCell> Diamond(int side)
Parameters
sideint
Returns
- PointyRhombGrid<TCell>
DownTriangle(int)
public static PointyRhombGrid<TCell> DownTriangle(int side)
Parameters
sideint
Returns
- PointyRhombGrid<TCell>
FatRectangle(int, int)
public static PointyRhombGrid<TCell> FatRectangle(int width, int height)
Parameters
Returns
- PointyRhombGrid<TCell>
GridPointFromArrayPoint(ArrayPoint)
public static PointyHexPoint GridPointFromArrayPoint(ArrayPoint point)
Parameters
pointArrayPoint
Returns
Hexagon(int)
public static PointyRhombGrid<TCell> Hexagon(int side)
Parameters
sideint
Returns
- PointyRhombGrid<TCell>
MakePoint(PointyHexPoint, int)
protected override PointyRhombPoint MakePoint(PointyHexPoint basePoint, int index)
Parameters
basePointPointyHexPointindexint
Returns
MakeUnderlyingGrid(int, int)
protected override IGrid<TCell[], PointyHexPoint> MakeUnderlyingGrid(int width, int height)
Parameters
Returns
- IGrid<TCell[], PointyHexPoint>
Parallelogram(int, int)
public static PointyRhombGrid<TCell> Parallelogram(int width, int height)
Parameters
Returns
- PointyRhombGrid<TCell>
Rectangle(int, int)
public static PointyRhombGrid<TCell> Rectangle(int width, int height)
Parameters
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
Returns
- PointyRhombGrid<TCell>
ToString()
public override string ToString()
Returns
UpTriangle(int)
public static PointyRhombGrid<TCell> UpTriangle(int side)
Parameters
sideint
Returns
- PointyRhombGrid<TCell>