Class FlatRhombGrid<TCell>
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
-
IGrid<TCell, FlatRhombPoint>
- 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
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
intheight
intisInside
Func<FlatRhombPoint, bool>
FlatRhombGrid(int, int, Func<FlatRhombPoint, bool>, FlatHexPoint)
public FlatRhombGrid(int width, int height, Func<FlatRhombPoint, bool> isInside, FlatHexPoint offset)
Parameters
width
intheight
intisInside
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
intheight
intisInside
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
intheight
intisInside
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
intheight
intisInside
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
Methods
ArrayPointFromGridPoint(FlatHexPoint)
public static ArrayPoint ArrayPointFromGridPoint(FlatHexPoint point)
Parameters
point
FlatHexPoint
Returns
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
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
Returns
- FlatRhombGrid<TCell>
DefaultContains(FlatRhombPoint, int, int)
public static bool DefaultContains(FlatRhombPoint point, int width, int height)
Parameters
point
FlatRhombPointwidth
intheight
int
Returns
FatRectangle(int, int)
public static FlatRhombGrid<TCell> FatRectangle(int width, int height)
Parameters
Returns
- FlatRhombGrid<TCell>
GridPointFromArrayPoint(ArrayPoint)
public static FlatHexPoint GridPointFromArrayPoint(ArrayPoint point)
Parameters
point
ArrayPoint
Returns
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
FlatHexPointindex
int
Returns
MakeUnderlyingGrid(int, int)
protected override IGrid<TCell[], FlatHexPoint> MakeUnderlyingGrid(int width, int height)
Parameters
Returns
- IGrid<TCell[], FlatHexPoint>
Parallelogram(int, int)
public static FlatRhombGrid<TCell> Parallelogram(int width, int height)
Parameters
Returns
- FlatRhombGrid<TCell>
Rectangle(int, int)
public static FlatRhombGrid<TCell> Rectangle(int width, int height)
Parameters
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
Returns
- FlatRhombGrid<TCell>
ToString()
public override string ToString()