Per-unit cap (still broken)

This commit is contained in:
Anuken
2020-07-21 15:43:02 -04:00
parent 4ef0143928
commit 5c9e005397
20 changed files with 3758 additions and 1996 deletions

View File

@@ -6,6 +6,7 @@ import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.world.*;
import static mindustry.Vars.*;
@@ -29,8 +30,8 @@ public class Units{
}
/** @return whether a new instance of a unit of this team can be created. */
public static boolean canCreate(Team team){
return teamIndex.count(team) < getCap(team);
public static boolean canCreate(Team team, UnitType type){
return teamIndex.countType(team, type) < getCap(team);
}
public static int getCap(Team team){