Read-only component fields / Removed get/set prefix

This commit is contained in:
Anuken
2020-02-04 12:14:09 -05:00
parent 1d0cfd4435
commit 36b9451e01
93 changed files with 637 additions and 587 deletions

View File

@@ -146,7 +146,7 @@ public class BlockIndexer{
ObjectSet<Tile> set = damagedTiles[team.id];
for(Tile tile : set){
if((tile.entity == null || tile.entity.getTeam() != team || !tile.entity.damaged()) || tile.block() instanceof BuildBlock){
if((tile.entity == null || tile.entity.team() != team || !tile.entity.damaged()) || tile.block() instanceof BuildBlock){
returnArray.add(tile);
}
}
@@ -164,7 +164,7 @@ public class BlockIndexer{
}
public boolean eachBlock(Teamc team, float range, Boolf<Tile> pred, Cons<Tile> cons){
return eachBlock(team.getTeam(), team.getX(), team.getY(), range, pred, cons);
return eachBlock(team.team(), team.getX(), team.getY(), range, pred, cons);
}
public boolean eachBlock(Team team, float wx, float wy, float range, Boolf<Tile> pred, Cons<Tile> cons){
@@ -213,12 +213,12 @@ public class BlockIndexer{
}
public void notifyTileDamaged(Tilec entity){
if(damagedTiles[(int)entity.getTeam().id] == null){
damagedTiles[(int)entity.getTeam().id] = new ObjectSet<>();
if(damagedTiles[(int)entity.team().id] == null){
damagedTiles[(int)entity.team().id] = new ObjectSet<>();
}
ObjectSet<Tile> set = damagedTiles[(int)entity.getTeam().id];
set.add(entity.getTile());
ObjectSet<Tile> set = damagedTiles[(int)entity.team().id];
set.add(entity.tile());
}
public Tilec findEnemyTile(Team team, float x, float y, float range, Boolf<Tile> pred){
@@ -262,9 +262,9 @@ public class BlockIndexer{
float ndst = e.dst2(x, y);
if(ndst < range2 && (closest == null ||
//this one is closer, and it is at least of equal priority
(ndst < dst && (!usePriority || closest.getBlock().priority.ordinal() <= e.getBlock().priority.ordinal())) ||
(ndst < dst && (!usePriority || closest.block().priority.ordinal() <= e.block().priority.ordinal())) ||
//priority is used, and new block has higher priority regardless of range
(usePriority && closest.getBlock().priority.ordinal() < e.getBlock().priority.ordinal()))){
(usePriority && closest.block().priority.ordinal() < e.block().priority.ordinal()))){
dst = ndst;
closest = e;
}

View File

@@ -7,7 +7,6 @@ import arc.struct.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.entities.type.*;
import mindustry.game.EventType.*;
import mindustry.game.*;
import mindustry.world.*;
@@ -35,7 +34,7 @@ public class WaveSpawner{
/** @return true if the player is near a ground spawn point. */
public boolean playerNear(){
return groundSpawns.contains(g -> Mathf.dst(g.x * tilesize, g.y * tilesize, player.x, player.y) < state.rules.dropZoneRadius && player.getTeam() != state.rules.waveTeam);
return groundSpawns.contains(g -> Mathf.dst(g.x * tilesize, g.y * tilesize, player.x, player.y) < state.rules.dropZoneRadius && player.team() != state.rules.waveTeam);
}
public void spawnEnemies(){