Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: RT.Coordinates.Structure<TCell>

Summary

Describes a structure of connected cells, such as a grid.

Generic type parameters

TCell The type of cells in the structure; for example, Square or Hex.

Constructors

Structure<TCell>(IEnumerable<TCell> cells, IEnumerable<Link<TCell>> links = null, Func<TCell, IEnumerable<TCell>> getNeighbors = null)
Constructs a structure with the specified cells and links between them. (see also remarks)

Instance methods

void
AddCell(TCell cell)
Adds the specified cells to this structure.
void
AddCells(params TCell[] cells)
void
AddCells(IEnumerable<TCell> cells)
void
AddLink(Link<TCell> link)
Adds the specified link to this structure.
void
AddLink(TCell cell1, TCell cell2)
Adds a link between the specified cells to this structure.
void
AddLinks(params Link<TCell>[] links)
Adds the specified links to this structure.
void
AddLinks(IEnumerable<Link<TCell>> links)
Structure<CombinedCell<TCell>>
CombineCells(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(IEnumerable<TCell> cells)
bool
Contains(TCell cell)
Determines whether this structure contains the specified cell.
IEnumerable<TCell>
FindPath(TCell from, TCell to)
Finds the shortest path from the specified from cell to the specified to cell.
Dictionary<TCell, CellWithDistance<TCell>>
FindPaths(TCell origin)
Finds the shortest path from the specified origin cell to every other cell in the structure.
Structure<TCell>
GenerateMaze(Random rnd = null, MazeBias bias = MazeBias.Default)
Generates a maze on this structure.
Structure<TCell>
GenerateMaze(Func<int, int, int> rndNext, MazeBias bias = MazeBias.Default)
bool
IsLink(Link<TCell> link)
Determines whether the specified link is traversible.
bool
IsLink(TCell cell1, TCell cell2)
Determines whether a direct link between the specified cells exists in this structure and is traversible.
void
RemoveCell(TCell cell)
Removes the specified cell from this structure.
void
RemoveCells(params TCell[] cells)
Removes the specified cells from this structure.
void
RemoveCells(IEnumerable<TCell> cells)
void
RemoveCells(Predicate<TCell> predicate)
Removes all cells from this structure that match the specified predicate.
void
RemoveLink(Link<TCell> link)
Removes the specified link from this structure.
void
RemoveLinks(params Link<TCell>[] links)
Removes the specified links from this structure.
void
RemoveLinks(IEnumerable<Link<TCell>> links)
void
RemoveLinks(Predicate<Link<TCell>> predicate)
string
Svg(SvgInstructions inf = null)
Returns an SVG file that visualizes this structure.

Instance properties

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