Random sector sizes / Cleanup
This commit is contained in:
@@ -13,7 +13,6 @@ import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.meta.BlockFlag;
|
||||
import io.anuke.ucore.core.Events;
|
||||
import io.anuke.ucore.entities.trait.Entity;
|
||||
import io.anuke.ucore.function.Predicate;
|
||||
import io.anuke.ucore.util.EnumSet;
|
||||
import io.anuke.ucore.util.Geometry;
|
||||
@@ -26,6 +25,7 @@ import static io.anuke.mindustry.Vars.*;
|
||||
//TODO maybe use Arrays instead of ObjectSets?
|
||||
|
||||
/**Class used for indexing special target blocks for AI.*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class BlockIndexer{
|
||||
/**Size of one ore quadrant.*/
|
||||
private final static int oreQuadrantSize = 20;
|
||||
@@ -116,7 +116,7 @@ public class BlockIndexer{
|
||||
}
|
||||
|
||||
public TileEntity findTile(Team team, float x, float y, float range, Predicate<Tile> pred){
|
||||
Entity closest = null;
|
||||
TileEntity closest = null;
|
||||
float dst = 0;
|
||||
|
||||
for(int rx = Math.max((int) ((x - range) / tilesize / structQuadrantSize), 0); rx <= (int) ((x + range) / tilesize / structQuadrantSize) && rx < quadWidth(); rx++){
|
||||
@@ -142,7 +142,7 @@ public class BlockIndexer{
|
||||
}
|
||||
}
|
||||
|
||||
return (TileEntity) closest;
|
||||
return closest;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user