Merge pull request #2725 from LeoDog896/master

More sort and target options
This commit is contained in:
Anuken
2020-09-26 22:27:05 -04:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ import mindustry.gen.*;
public enum RadarSort{
distance((pos, other) -> -pos.dst2(other)),
health((pos, other) -> other.health()),
shield((pos, other) -> other.shield()),
armor((pos, other) -> other.armor()),
maxHealth((pos, other) -> other.maxHealth());
public final RadarSortFunc func;
@@ -17,6 +19,6 @@ public enum RadarSort{
}
public interface RadarSortFunc{
float get(Position pos, Healthc other);
float get(Position pos, Unit other);
}
}

View File

@@ -8,6 +8,7 @@ public enum RadarTarget{
enemy((team, other) -> team != other.team),
ally((team, other) -> team == other.team),
player((team, other) -> other.isPlayer()),
attacker((pos, other) -> other.canShoot()),
flying((team, other) -> other.isFlying()),
boss((team, other) -> other.isBoss()),
ground((team, other) -> other.isGrounded());