Fixed drones being useless

This commit is contained in:
Anuken
2019-04-12 16:05:30 -04:00
parent 46c3b35028
commit c0e425cf46
5 changed files with 67 additions and 57 deletions
@@ -34,6 +34,8 @@ public class BlockIndexer{
private Bits[] structQuadrants;
/** Stores all damaged tile entities by team. */
private ObjectSet<Tile>[] damagedTiles = new ObjectSet[Team.all.length];
/**All ores available on this map.*/
private ObjectSet<Item> allOres = new ObjectSet<>();
/** Maps teams to a map of flagged tiles by type. */
private ObjectSet<Tile>[][] flagMap = new ObjectSet[Team.all.length][BlockFlag.all.length];
@@ -67,6 +69,7 @@ public class BlockIndexer{
}
typeMap.clear();
allOres.clear();
ores = null;
//create bitset for each team type that contains each quadrant
@@ -84,6 +87,8 @@ public class BlockIndexer{
if(tile.entity != null && tile.entity.damaged()){
notifyTileDamaged(tile.entity);
}
if(tile.drop() != null) allOres.add(tile.drop());
}
}
@@ -101,6 +106,11 @@ public class BlockIndexer{
return flagMap[team.ordinal()];
}
/** @return whether this item is present on this map.*/
public boolean hasOre(Item item){
return allOres.contains(item);
}
/** Returns all damaged tiles by team. */
public ObjectSet<Tile> getDamaged(Team team){
returnArray.clear();