org.xguzm.pathfinding.Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pathfinding Show documentation
Show all versions of pathfinding Show documentation
A generic java path finding library, meant to be used in games
package org.xguzm.pathfinding;
import java.util.ArrayList;
import java.util.List;
public class Util {
private static final List path = new ArrayList();
@SuppressWarnings("unchecked")
public static List backtrace(T node){
path.clear();
path.add(node);
T node1 = node;
while (node1.getParent() != null){
node1 = (T)node1.getParent();
path.add(0, node1);
}
path.remove(0);
return (List)path;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy