Method GetSpiralIterator
GetSpiralIterator(IImplicitShape<GridPoint2>, GridPoint2, int)
Get's an enumerable of shape points in a square spiral outwards from a given point, assuming the points represents coordinates in a rect grid.
public static IEnumerable<GridPoint2> GetSpiralIterator(IImplicitShape<GridPoint2> shape, GridPoint2 origin, int ringCount)
Parameters
shapeIImplicitShape<GridPoint2>The shape to return points from.
originGridPoint2Where the spiral should start.
ringCountintHow many rings there should be in the spiral. The origin is the first ring, so when ringCount is 1, only the origin will be returned.
Returns
Remarks
note
Remember that IExplicitShape<TPoint>, IGrid<TPoint, TCell> and Grid2<TCell> all are also of type IImplicitShape<TPoint>, so this method can be used with explicit shapes and grids too.