private static void BatchAdjacencyMissResolve(List <Point> locations) { for (int i = 0; i < locations.Count; i++) { Point current = locations[i]; MapNode currentNode = instance.nodes[current]; List <Point> neighbours = instance.GetNeighbors(current); List <MapNode> neighbourNodes = Pools.ListMapNodes; for (int j = 0; j < neighbours.Count; j++) { Point neighbourPoint = neighbours[j]; MapNode neighbourNode = instance.nodes[neighbourPoint]; neighbourNodes.Add(neighbourNode); } currentNode.CalculateAdjancencyData(neighbourNodes); Pools.ListMapNodes = neighbourNodes; Pools.ListPoints = neighbours; } }
private static void AdjacencyMissResolve(Point location) { List <Point> neighbors = instance.GetNeighbors(location); List <Point> unInitializedNeighbours = Pools.ListPoints; for (int i = 0; i < neighbors.Count; i++) { Point current = neighbors[i]; if (instance.nodes[current] == null) { unInitializedNeighbours.Add(current); } } BatchAddNodes(unInitializedNeighbours); MapNode node = instance.nodes[location]; neighbors = instance.GetNeighbors(location); List <MapNode> adjacentMapNodes = Pools.ListMapNodes; for (int i = 0; i < neighbors.Count; i++) { adjacentMapNodes.Add(instance.nodes[neighbors[i]]); } node.CalculateAdjancencyData( adjacentMapNodes ); Pools.FreeListPoints(neighbors); //Pools.FreeListPoints(unInitializedNeighbours); Pools.ListMapNodes = adjacentMapNodes; Pools.ListPoints = neighbors; Pools.ListPoints = unInitializedNeighbours; }