Basic unitsorts for hjson (#6280)

* Create some basic unitSorts

* Set as defaults

* add to ContentParser
This commit is contained in:
Matthew Peng
2021-10-31 18:30:35 -07:00
committed by GitHub
parent e1bf1a1b92
commit 223fb8d6f5
4 changed files with 22 additions and 5 deletions

View File

@@ -0,0 +1,14 @@
package mindustry.entities;
import arc.math.*;
import mindustry.entities.Units.*;
import mindustry.gen.*;
public class UnitSorts{
public static Sortf
closest = Unit::dst2,
farthest = (u, x, y) -> -u.dst2(x, y),
strongest = (u, x, y) -> -u.maxHealth + Mathf.dst2(u.x, u.y, x, y) / 6400f,
weakest = (u, x, y) -> u.maxHealth + Mathf.dst2(u.x, u.y, x, y) / 6400f;
}