InfiniteGrid
public struct InfiniteGrid<Filter> : GraphProtocol where Filter : GridFilter
extension InfiniteGrid: IncidenceGraph
extension InfiniteGrid: BidirectionalGraph
extension InfiniteGrid: SearchDefaultsGraph
extension InfiniteGrid: DefaultInitializable where Filter: DefaultInitializable
A graph of two dimensional coordinates and their local connections.
-
Undocumented
Declaration
Swift
public init(_ filter: Filter) -
Name of a vertex in
self.Declaration
Swift
public typealias VertexId = Point2 -
Name of an edge in
self.Declaration
Swift
public typealias EdgeId = GridEdge -
The collection of edges from a single vertex in an infinite grid.
See moreDeclaration
Swift
public struct VertexEdgeCollection : Collection -
Returns the collection of edges whose source is
vertex.Declaration
Swift
public func edges(from vertex: VertexId) -> VertexEdgeCollection -
Returns the source
VertexIdofedge. -
Returns the destnation
VertexIdofedge. -
The collection of all edges whose destination is a single vertex in an infinite grid.
See moreDeclaration
Swift
public struct VertexInEdgeCollection : Collection -
Declaration
Swift
public func edges(to vertex: VertexId) -> VertexInEdgeCollection -
The default color map to use when searching
self.Declaration
Swift
public typealias DefaultColorMap = DictionaryPropertyMap<`Self`, VertexId, VertexColor> -
Creates a vertex color map repeating
colorfor every vertex inself.Declaration
Swift
public func makeDefaultColorMap(repeating color: VertexColor) -> DefaultColorMap -
Declaration
Swift
public func makeDefaultVertexIntMap(repeating value: Int) -> DictionaryPropertyMap<`Self`, VertexId, Int> -
Declaration
Swift
public func makeDefaultVertexVertexMap(repeating vertex: VertexId) -> DictionaryPropertyMap<`Self`, VertexId, VertexId>
-
Creates an infinite grid with a default initialized filter.
Declaration
Swift
public init()
View on GitHub
InfiniteGrid Structure Reference