HexPath class

This is a path from one hex to another. It contains the total cost of the path, and the list of hexes that make up the path. See Hex.cheapestPathTo for more details.

Constructors

HexPath(Hex from, Hex to, Iterable<Hex> path, double totalCost)

Properties

from Hex
final
hashCode int
The hash code for this object.
no setterinherited
path UnmodifiableListView<Hex>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
to Hex
final
totalCost double
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
segments({int segmentSize = 2}) Iterable<Iterable<Hex>>
Returns moving window of segments of defined size. With path a,b,c,d,e and segmentSize 3, this method returns: [a,b,c, b,c,d, c,d,e]. If the segments size is bigger then the path length, the method returns the whole path as a one segment.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited