Block display bar cleanup
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package io.anuke.mindustry.ai;
|
||||
|
||||
import com.badlogic.gdx.ai.pfa.indexed.IndexedGraph;
|
||||
|
||||
/**An interface for an indexed graph that doesn't use allocations for connections.*/
|
||||
public interface OptimizedGraph<N> extends IndexedGraph<N> {
|
||||
public interface OptimizedGraph<N>{
|
||||
/**This is used in the same way as getConnections(), but does not use Connection objects.*/
|
||||
N[] connectionsOf(N node);
|
||||
|
||||
/** Returns the unique index of the given node.
|
||||
* @param node the node whose index will be returned
|
||||
* @return the unique index of the given node. */
|
||||
int getIndex (N node);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
package io.anuke.mindustry.ai;
|
||||
|
||||
import com.badlogic.gdx.ai.pfa.Connection;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
/**Tilegraph that ignores player-made tiles.*/
|
||||
public class TileGraph implements OptimizedGraph<Tile> {
|
||||
|
||||
/**return nothing, as this isn't used*/
|
||||
@Override
|
||||
public Array<Connection<Tile>> getConnections(Tile fromNode){ return null; }
|
||||
|
||||
/**Used for the OptimizedPathFinder implementation.*/
|
||||
@Override
|
||||
public Tile[] connectionsOf(Tile node){
|
||||
@@ -28,9 +21,4 @@ public class TileGraph implements OptimizedGraph<Tile> {
|
||||
public int getIndex(Tile node){
|
||||
return node.packedPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNodeCount(){
|
||||
return world.width() * world.height();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user