Method cleanup

This commit is contained in:
Anuken
2019-12-26 20:08:53 -05:00
parent c449302d28
commit 954e26fc14
16 changed files with 49 additions and 21 deletions

View File

@@ -83,7 +83,7 @@ public class Units{
public static TileEntity findEnemyTile(Team team, float x, float y, float range, Boolf<Tile> pred){
if(team == Team.derelict) return null;
for(Team enemy : state.teams.enemiesOf(team)){
for(Team enemy : team.enemies()){
TileEntity entity = indexer.findTile(enemy, x, y, range, pred, true);
if(entity != null){
return entity;
@@ -195,13 +195,13 @@ public class Units{
/** Iterates over all units that are enemies of this team. */
public static void nearbyEnemies(Team team, float x, float y, float width, float height, Cons<Unit> cons){
unitGroup.intersect(x, y, width, height, u -> {
if(state.teams.areEnemies(team, u.getTeam())){
if(team.isEnemy(u.getTeam())){
cons.get(u);
}
});
playerGroup.intersect(x, y, width, height, player -> {
if(state.teams.areEnemies(team, player.getTeam())){
if(team.isEnemy(player.getTeam())){
cons.get(player);
}
});