Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Nested class: RT.Coordinates.Tri.Grid

Summary

Describes a 2D grid of triangular cells.

Constructors

Grid(int width, int height)
Constructs a grid of the specified width and height in which the top-left triangle is an up-pointing one.
Grid(IEnumerable<Tri> cells, IEnumerable<Link<Tri>> links = null, Func<Tri, IEnumerable<Tri>> getNeighbors = null)
See Structure<TCell>(IEnumerable<TCell>, IEnumerable<Link<TCell>>, Func<TCell, IEnumerable<TCell>>).

Instance methods

void
AddCell(Tri cell)
Adds the specified cells to this structure.
void
AddCells(params Tri[] cells)
void
AddCells(IEnumerable<Tri> cells)
voidAdds the specified link to this structure.
void
AddLink(Tri cell1, Tri cell2)
Adds a link between the specified cells to this structure.
void
AddLinks(params Link<Tri>[] links)
Adds the specified links to this structure.
void
AddLinks(IEnumerable<Link<Tri>> links)
Structure<CombinedCell<Tri>>
CombineCells(params Tri[] cells)
Returns a new structure in which the specified set of cells is combined (merged) into a single cell. (see also remarks)
Structure<CombinedCell<Tri>>
CombineCells(IEnumerable<Tri> cells)
boolDetermines whether this structure contains the specified cell.
IEnumerable<Tri>
FindPath(Tri from, Tri to)
Finds the shortest path from the specified from cell to the specified to cell.
Dictionary<Tri, CellWithDistance<Tri>>
FindPaths(Tri origin)
Finds the shortest path from the specified origin cell to every other cell in the structure.
Structure<Tri>
GenerateMaze(Random rnd = null, MazeBias bias = MazeBias.Default)
Generates a maze on this structure.
Structure<Tri>
GenerateMaze(Func<int, int, int> rndNext, MazeBias bias = MazeBias.Default)
bool
IsLink(Link<Tri> link)
Determines whether the specified link is traversible.
bool
IsLink(Tri cell1, Tri cell2)
Determines whether a direct link between the specified cells exists in this structure and is traversible.
voidRemoves the specified cell from this structure.
void
RemoveCells(params Tri[] cells)
Removes the specified cells from this structure.
void
RemoveCells(IEnumerable<Tri> cells)
void
RemoveCells(Predicate<Tri> predicate)
Removes all cells from this structure that match the specified predicate.
voidRemoves the specified link from this structure.
void
RemoveLinks(params Link<Tri>[] links)
Removes the specified links from this structure.
void
RemoveLinks(IEnumerable<Link<Tri>> links)
void
RemoveLinks(Predicate<Link<Tri>> predicate)
string
Svg(SvgInstructions inf = null)
Returns an SVG file that visualizes this structure.

Instance properties

IEnumerable<Tri>Returns this structure’s full set of cells.
IEnumerable<Link<Tri>>Returns the full set of links between the cells in this structure.