Cleanup
This commit is contained in:
@@ -9,6 +9,8 @@ import mindustry.gen.*;
|
||||
import mindustry.io.legacy.*;
|
||||
import mindustry.type.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
/**
|
||||
@@ -138,4 +140,20 @@ public class SpawnGroup implements Serializable{
|
||||
", items=" + items +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o){
|
||||
if(this == o) return true;
|
||||
if(o == null || getClass() != o.getClass()) return false;
|
||||
SpawnGroup group = (SpawnGroup)o;
|
||||
return end == group.end && begin == group.begin && spacing == group.spacing && max == group.max
|
||||
&& Float.compare(group.unitScaling, unitScaling) == 0 && Float.compare(group.shields, shields) == 0
|
||||
&& Float.compare(group.shieldScaling, shieldScaling) == 0 && unitAmount == group.unitAmount &&
|
||||
type == group.type && effect == group.effect && Structs.eq(items, group.items);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode(){
|
||||
return Arrays.hashCode(new Object[]{type, end, begin, spacing, max, unitScaling, shields, shieldScaling, unitAmount, effect, items});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public class Teams{
|
||||
}
|
||||
|
||||
private void count(Unit unit){
|
||||
unit.team.data().updateCount(unit.type(), 1);
|
||||
unit.team.data().updateCount(unit.type, 1);
|
||||
|
||||
if(unit instanceof Payloadc){
|
||||
((Payloadc)unit).payloads().each(p -> {
|
||||
@@ -178,15 +178,15 @@ public class Teams{
|
||||
data.units.add(unit);
|
||||
data.presentFlag = true;
|
||||
|
||||
if(data.unitsByType == null || data.unitsByType.length <= unit.type().id){
|
||||
if(data.unitsByType == null || data.unitsByType.length <= unit.type.id){
|
||||
data.unitsByType = new Seq[content.units().size];
|
||||
}
|
||||
|
||||
if(data.unitsByType[unit.type().id] == null){
|
||||
data.unitsByType[unit.type().id] = new Seq<>();
|
||||
if(data.unitsByType[unit.type.id] == null){
|
||||
data.unitsByType[unit.type.id] = new Seq<>();
|
||||
}
|
||||
|
||||
data.unitsByType[unit.type().id].add(unit);
|
||||
data.unitsByType[unit.type.id].add(unit);
|
||||
|
||||
count(unit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user