Implemented map run-length encoding, updated KO lang

This commit is contained in:
Anuken
2018-01-26 00:08:12 -05:00
parent 5f131723c4
commit 6abbc3eca7
5 changed files with 95 additions and 88 deletions

View File

@@ -8,7 +8,6 @@ import com.badlogic.gdx.utils.TimeUtils;
/**An IndexedAStarPathfinder that uses an OptimizedGraph, and therefore has less allocations.*/
public class OptimizedPathFinder<N> implements PathFinder<N> {
OptimizedGraph<N> graph;
//NodeRecord<N>[] nodeRecords; //TODO remove.
IntMap<NodeRecord<N>> records = new IntMap<>();
BinaryHeap<NodeRecord<N>> openList;
NodeRecord<N> current;
@@ -25,7 +24,6 @@ public class OptimizedPathFinder<N> implements PathFinder<N> {
@SuppressWarnings("unchecked")
public OptimizedPathFinder(OptimizedGraph<N> graph) {
this.graph = graph;
//this.nodeRecords = (NodeRecord<N>[]) new NodeRecord[graph.getNodeCount()];
this.openList = new BinaryHeap<>();
}
@@ -218,20 +216,6 @@ public class OptimizedPathFinder<N> implements PathFinder<N> {
}else{
return records.get(graph.getIndex(node));
}
/*
int index = graph.getIndex(node);
NodeRecord<N> nr = nodeRecords[index];
if (nr != null) {
if (nr.searchId != searchId) {
nr.category = UNVISITED;
nr.searchId = searchId;
}
return nr;
}
nr = nodeRecords[index] = new NodeRecord<>();
nr.node = node;
nr.searchId = searchId;
return nr;*/
}
/**