Distances

class in FinixMakesGames.MazeGenerator.Core

Description

Class that represents a data collection of Cells in a Maze that forms a path or a set of paths relative to a root Cell and it's distance values.

Constructor

TypeResult
DistancesCreates a new Distances class with a the provided root Cell component with the distance value set to 0, every other Cell distance value will be relative to this root Cell.

Public Methods

MethodDescription
this[Cell cell]An override of the [] accessor. When given a Cell it will return it's integer distance to the root cell. If there is no path between these two Cells the value will be null.
CellsReturns a IEnumerable Collection of all cells present in the collection.
PathToReturns a new Distances Class with ONLY the path between the root Cell and the provided goal Cell.
MaxReturns the Cell furthest away from the root Cell.