Added mining

This commit is contained in:
Anuken
2018-06-02 11:13:07 -04:00
parent 3fe7e4e8da
commit ae6b4211b9
12 changed files with 486 additions and 398 deletions
@@ -21,6 +21,8 @@ public class BlockIndexer {
private ObjectMap<BlockFlag, ObjectSet<Tile>> enemyMap = new ObjectMap<>();
/**Maps teams to a map of flagged tiles by type.*/
private ObjectMap<BlockFlag, ObjectSet<Tile>> allyMap = new ObjectMap<>();
/**Empty map for invalid teams.*/
private ObjectMap<BlockFlag, ObjectSet<Tile>> emptyMap = new ObjectMap<>();
/**Maps tile positions to their last known tile index data.*/
private IntMap<TileIndex> typeMap = new IntMap<>();
/**Empty array used for returning.*/
@@ -79,6 +81,7 @@ public class BlockIndexer {
}
private ObjectMap<BlockFlag, ObjectSet<Tile>> getMap(Team team){
if(!state.teams.has(team)) return emptyMap;
return state.teams.get(team).ally ? allyMap : enemyMap;
}