PointyHexGridTCell Class |
Namespace: Gamelogic.Grids
[SerializableAttribute] [VersionAttribute(1, 0, 0)] public class PointyHexGrid<TCell> : AbstractUniformGrid<TCell, PointyHexPoint>, IEvenGrid<TCell, PointyHexPoint, PointyHexPoint>, IVectorGrid<TCell, PointyHexPoint, PointyHexPoint>, IGrid<TCell, PointyHexPoint>, IGrid<PointyHexPoint>, IGridSpace<PointyHexPoint>, IEnumerable<PointyHexPoint>, IEnumerable, ISupportsVertexGrid<FlatTriPoint>, ISupportsEdgeGrid<PointyRhombPoint>
The PointyHexGridTCell type exposes the following members.
| Name | Description | |
|---|---|---|
| PointyHexGridTCell(Int32, Int32) |
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.
| |
| PointyHexGridTCell(Int32, Int32, FuncPointyHexPoint, Boolean) |
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.
| |
| PointyHexGridTCell(Int32, Int32, FuncPointyHexPoint, Boolean, PointyHexPoint) |
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.
| |
| PointyHexGridTCell(Int32, Int32, FuncPointyHexPoint, Boolean, FuncPointyHexPoint, PointyHexPoint, FuncPointyHexPoint, PointyHexPoint) | ||
| PointyHexGridTCell(Int32, Int32, FuncPointyHexPoint, Boolean, FuncPointyHexPoint, PointyHexPoint, FuncPointyHexPoint, PointyHexPoint, IEnumerablePointyHexPoint) |
| Name | Description | |
|---|---|---|
| GridOrigin | (Overrides AbstractUniformGridTCell, TPointGridOrigin.) | |
| InversePointTransform | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| Item |
Gets the cell at the specified point.
(Inherited from AbstractUniformGridTCell, TPoint.) | |
| NeighborDirections | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| PointTransform | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| Values | (Inherited from AbstractUniformGridTCell, TPoint.) |
| Name | Description | |
|---|---|---|
| ArrayPointFromGridPoint | ||
| ArrayPointFromPoint(PointyHexPoint) | (Overrides AbstractUniformGridTCell, TPointArrayPointFromPoint(TPoint).) | |
| ArrayPointFromPoint(Int32, Int32) | (Overrides AbstractUniformGridTCell, TPointArrayPointFromPoint(Int32, Int32).) | |
| BeginShape |
Use this method to begin a shape building sequence.
| |
| CalculateStorage | ||
| CloneStructureTNewCellType |
Returns a grid in the same shape, but with contents in the new type.
(Overrides AbstractUniformGridTCell, TPointCloneStructureTNewCell.) | |
| Contains |
Checks whether the given point is inside the grid, or not.
This function must be consistent with the enumerator that is returned
with GetEnumerator(all points returned by the enumerator must be Inside,
and all points that are inside must be returned by the enumerator).
(Inherited from AbstractUniformGridTCell, TPoint.) | |
| Default | ||
| DefaultContains | ||
| Diamond | ||
| DownTriangle | ||
| Equals | (Inherited from Object.) | |
| FatRectangle | ||
| Finalize | (Inherited from Object.) | |
| GetAllNeighbors | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| GetEnumerator | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| GetHashCode | (Inherited from Object.) | |
| GetLargeSet |
This functions returns a large number of points around the origin.
This is useful(when used with big enough n) to determine
whether a grid that is missing points is doing so becuase of
an incorrect test function, or an incorrect storage rectangle.
Use for debugging.
(Inherited from AbstractUniformGridTCell, TPoint.) | |
| GetNeighborDirections |
The only legal cellIndex to pass to this methid is 0
(Inherited from AbstractUniformGridTCell, TPoint.) | |
| GetPrincipleNeighborDirections | ||
| GetSpiralIterator(Int32) |
An iterator that spirals anti-clockwise around the grid origin (0, 0).
| |
| GetSpiralIterator(PointyHexPoint, Int32) |
An iterator that spirals anti-clockwise around the given origin.
| |
| GetStoragePoints |
This method returns all points that can be contined by
the storage rectangle for this grid.
This is useful for debuggong shape functions.
(Inherited from AbstractUniformGridTCell, TPoint.) | |
| GetType | (Inherited from Object.) | |
| GridPointFromArrayPoint | ||
| Hexagon(Int32) | ||
| Hexagon(PointyHexPoint, Int32) | ||
| HorizontallyWrappedParallelogram |
Returns a grid wrapped horizontally along a parallelogram.
Since version 1.7
| |
| HorizontallyWrappedRectangle |
Returns a grid wrapped horizontally along a parallelogram.
| |
| MakeEdgeGridTNewCell |
Makes an edge grid for this grid.
| |
| MakeVertexGridTNewCell | ||
| MemberwiseClone | (Inherited from Object.) | |
| Parallelogram | ||
| PointFromArrayPoint | (Overrides AbstractUniformGridTCell, TPointPointFromArrayPoint(Int32, Int32).) | |
| Rectangle | ||
| SetGridPointTransforms |
Set the GridPointTransform and InverseGridPointTransform.
(Inherited from AbstractUniformGridTCell, TPoint.) | |
| Single | ||
| ThinRectangle | ||
| ToString | (Overrides ObjectToString.) | |
| UpTriangle | ||
| VerticallyWrappedParallelogram |
Returns a grid wrapped vertically along a parallelogram.
Since version 1.7
| |
| WrappedHexagon |
Returns a new grid, wrapped along a Hexagon with the given side length.
| |
| WrappedParallelogram |
Returns a grid wrapped along a parallelogram.
Since version 1.7
|
| Name | Description | |
|---|---|---|
| contains | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| height | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| width | (Inherited from AbstractUniformGridTCell, TPoint.) |
| Name | Description | |
|---|---|---|
| ButFirstPointyHexPoint |
Returns an enumerable of all elements of the given list but the first,
keeping them in order.
(Defined by CollectionExtensions.) | |
| ButLastPointyHexPoint |
Returns an enumerable of all elements in the given
list but the last, keeping them in order.
(Defined by CollectionExtensions.) | |
| CombinationsPointyHexPoint |
Generates all combinations of m elements selected from the list.
(Defined by Combinatorial.) | |
| ListToStringPointyHexPoint |
Returns a pretty string representation of the given list. The resulting string looks something like
[a, b, c].
(Defined by CollectionExtensions.) | |
| MaxByPointyHexPoint(FuncPointyHexPoint, IComparable) | Overloaded.
Finds the maximum element in the source as scored by the given function.
(Defined by CollectionExtensions.) | |
| MaxByPointyHexPoint, TKey(FuncPointyHexPoint, TKey) | Overloaded.
Finds the minimum element in the source as scored by its projection.
(Defined by CollectionExtensions.) | |
| MaxByPointyHexPoint, TKey(FuncPointyHexPoint, TKey, IComparerTKey) | Overloaded.
Finds the minimum element in the source as scored by the given function applied to a projection on the elements.
(Defined by CollectionExtensions.) | |
| MinByPointyHexPoint, TKey(FuncPointyHexPoint, TKey) | Overloaded.
Finds the minimum element in the source as scored by its projection.
(Defined by CollectionExtensions.) | |
| MinByPointyHexPoint, TKey(FuncPointyHexPoint, TKey, IComparerTKey) | Overloaded.
Finds the minimum element in the source as scored by the given function applied to a projection on the elements.
(Defined by CollectionExtensions.) | |
| PartitionsPointyHexPoint |
Returns a list of all the partitions of a list.
(Defined by Combinatorial.) | |
| PermutationsPointyHexPoint |
Generates all permutations of the list of elements.
(Defined by Combinatorial.) | |
| PowerSetPointyHexPoint |
Returns the power set of the input, that is, the set of all subsets of the input.
(Defined by Combinatorial.) | |
| RandomItemPointyHexPoint | Overloaded.
Returns a random element from a source.
(Defined by CollectionExtensions.) | |
| RandomItemPointyHexPoint(IRandom) | Overloaded.
Returns a random element from a source.
(Defined by CollectionExtensions.) | |
| RotateLeftPointyHexPoint |
Returns a enumerable with elements in order, but the first element is moved to the end.
(Defined by CollectionExtensions.) | |
| RotateRightPointyHexPoint |
Returns a enumerable with elements in order, but the last element is moved to the front.
(Defined by CollectionExtensions.) | |
| SampleRandomPointyHexPoint(Int32) | Overloaded.
Returns a random sample from a source.
(Defined by CollectionExtensions.) | |
| SampleRandomPointyHexPoint(Int32, IRandom) | Overloaded.
Returns a random sample from a source.
(Defined by CollectionExtensions.) | |
| TakeHalfPointyHexPoint |
Returns the first half of elements from a source.
(Defined by CollectionExtensions.) | |
| TakeLastPointyHexPoint |
Returns the last n elements from a source.
(Defined by CollectionExtensions.) | |
| ThrowIfNull |
Throws a NullReferenceException if the object is null.
(Defined by ObjectExtensions.) | |
| ToPeriodicGeneratorPointyHexPoint | (Defined by GeneratorExtensions.) | |
| ToRandomElementGeneratorPointyHexPoint | (Defined by GeneratorExtensions.) | |
| TuplesPointyHexPoint | (Defined by Combinatorial.) |
| Name | Description | |
|---|---|---|
| IEnumerableGetEnumerator | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| IGridTPointItem | (Inherited from AbstractUniformGridTCell, TPoint.) | |
| IGridTPointValues | (Inherited from AbstractUniformGridTCell, TPoint.) |