Display infinity symbol for "unlimited" unit cap
This commit is contained in:
@@ -81,6 +81,12 @@ public class Units{
|
|||||||
return Math.max(0, state.rules.unitCapVariable ? state.rules.unitCap + team.data().unitCap : state.rules.unitCap);
|
return Math.max(0, state.rules.unitCapVariable ? state.rules.unitCap + team.data().unitCap : state.rules.unitCap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return unit cap as a string, substituting the infinity symbol instead of MAX_VALUE */
|
||||||
|
public static String getStringCap(Team team){
|
||||||
|
int cap = getCap(team);
|
||||||
|
return cap >= Integer.MAX_VALUE - 1 ? "∞" : cap + "";
|
||||||
|
}
|
||||||
|
|
||||||
/** @return whether this player can interact with a specific tile. if either of these are null, returns true.*/
|
/** @return whether this player can interact with a specific tile. if either of these are null, returns true.*/
|
||||||
public static boolean canInteract(Player player, Building tile){
|
public static boolean canInteract(Player player, Building tile){
|
||||||
return player == null || tile == null || tile.interactable(player.team());
|
return player == null || tile == null || tile.interactable(player.team());
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class UnitFactory extends UnitBlock{
|
|||||||
Core.bundle.format("bar.unitcap",
|
Core.bundle.format("bar.unitcap",
|
||||||
Fonts.getUnicodeStr(e.unit().name),
|
Fonts.getUnicodeStr(e.unit().name),
|
||||||
e.team.data().countType(e.unit()),
|
e.team.data().countType(e.unit()),
|
||||||
Units.getCap(e.team)
|
Units.getStringCap(e.team)
|
||||||
),
|
),
|
||||||
() -> Pal.power,
|
() -> Pal.power,
|
||||||
() -> e.unit() == null ? 0f : (float)e.team.data().countType(e.unit()) / Units.getCap(e.team)
|
() -> e.unit() == null ? 0f : (float)e.team.data().countType(e.unit()) / Units.getCap(e.team)
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ android.useAndroidX=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=f1b1c17bf6385b607dad4af3c51ad88646c9e9ca
|
archash=07d01125a25b789cc081249c469b91b5f65070dc
|
||||||
|
|||||||
Reference in New Issue
Block a user