Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static class: RT.Coordinates.GridUtils

Summary

Contains some extension methods.

Static methods

bool
CanMove<TCell, TDirection>(this Structure<TCell> structure, TCell cell, TDirection direction, int amount = 1)
Determines whether it is possible within structure to move the specified amount of steps in the specified direction.
Square.Direction
Clockwise(this Square.Direction dir, int amount = 1)
Returns a new Square.Direction which is the specified multiple of 45° clockwise from the current direction.
Hex.Direction
Clockwise(this Hex.Direction dir, int amount = 1)
Returns a new Hex.Direction which is the specified multiple of 60° clockwise from the current direction.
Structure<CombinedCell<TCell>>
CombineCells<TCell>(this Structure<CombinedCell<TCell>> structure, params TCell[] cells)
Returns a new structure in which the specified set of cells is combined (merged) into a single cell. (see also remarks)
Structure<CombinedCell<TCell>>
CombineCells<TCell>(this Structure<CombinedCell<TCell>> structure, IEnumerable<TCell> cells)
IEnumerable<TCell>
GetPathTo<TCell>(this Dictionary<TCell, CellWithDistance<TCell>> paths, TCell destination)
Given the output from Structure<TCell>.FindPath(TCell, TCell), reconstructs a path from the origin cell to the specified destination cell.
IEnumerable<Link<Vertex>>
MakeEdges(this IEnumerable<Vertex> vertices)
Generates a set of edges from a collection of vertices in which the vertices are in the correct order (either clockwise or counter-clockwise).
int
MaxMoves<TCell, TDirection>(this Structure<TCell> structure, TCell cell, TDirection direction, out TCell lastCell)
Returns the maximum number of steps it is possible to move in the specified direction within structure.
TCell
Move<TCell, TDirection>(this Structure<TCell> structure, TCell cell, TDirection direction, int amount = 1)
Moves the specified amount of steps in the specified direction within structure and returns the cell landed on.
object
Parse(string str)
Converts a string representation of a cell into the original cell.
string
SvgEdgesPath(IEnumerable<Link<Vertex>> edges, Func<Vertex, PointD> getVertexPoint = null, Func<double, string> r = null)
Returns an SVG path string (usable in the d attribute of a <path> element) that draws all of the specified edges.
bool
TryMove<TCell, TDirection>(this Structure<TCell> structure, TCell cell, TDirection direction, out TCell newCell, int amount = 1)
Determines whether it is possible within structure to move the specified amount of steps in the specified direction and sets newCell to the cell landed on.