copy method
Implementation
@override
GridDijkstraState copy() {
var newState = GridDijkstraState(
start: start,
target: target,
grid: List.generate(grid.length, (i) => List.from(grid[i])),
parents: HashMap.from(parents),
dirs: List.from(dirs),
gCost: HashMap.from(gCost),
open: PriorityQueue<GridPoint>((a, b) => gCost[a]!.compareTo(gCost[b]!)),
status: status,
);
newState.open = PriorityQueue<GridPoint>(
(a, b) => newState.gCost[a]!.compareTo(newState.gCost[b]!));
newState.open.addAll(
open.toList(),
);
return newState;
}