Nestable set iteration

This commit is contained in:
Anuken 2019-10-13 12:11:28 -04:00
parent a09320cb4a
commit 6743bd144f
4 changed files with 5 additions and 7 deletions

View file

@ -2,7 +2,6 @@ package io.anuke.mindustry.core;
import io.anuke.annotations.Annotations.*;
import io.anuke.arc.*;
import io.anuke.arc.collection.ObjectSet.*;
import io.anuke.arc.util.*;
import io.anuke.mindustry.content.*;
import io.anuke.mindustry.core.GameState.*;
@ -175,7 +174,7 @@ public class Logic implements ApplicationListener{
ui.hudfrag.showLaunch();
}
for(Tile tile : new ObjectSetIterator<>(state.teams.get(defaultTeam).cores)){
for(Tile tile : state.teams.get(defaultTeam).cores){
Effects.effect(Fx.launch, tile);
}
@ -184,7 +183,7 @@ public class Logic implements ApplicationListener{
}
Time.runTask(30f, () -> {
for(Tile tile : new ObjectSetIterator<>(state.teams.get(defaultTeam).cores)){
for(Tile tile : state.teams.get(defaultTeam).cores){
for(Item item : content.items()){
if(tile == null || tile.entity == null || tile.entity.items == null) continue;
data.addItem(item, tile.entity.items.get(item));

View file

@ -153,7 +153,7 @@ public class DeployDialog extends FloatingDialog{
for(ZoneNode node : nodes){
node.allChildren.clear();
node.allChildren.addAll(node.children);
for(ZoneNode other : new ObjectSetIterator<>(nodes)){
for(ZoneNode other : nodes){
if(other.zone.requirements.contains(req -> req.zone() == node.zone)){
node.allChildren.add(other);
}

View file

@ -3,7 +3,6 @@ package io.anuke.mindustry.world.blocks.storage;
import io.anuke.annotations.Annotations.*;
import io.anuke.arc.*;
import io.anuke.arc.collection.*;
import io.anuke.arc.collection.ObjectSet.*;
import io.anuke.arc.function.*;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.math.*;
@ -157,7 +156,7 @@ public class CoreBlock extends StorageBlock{
tile.entity.items.set(item, Math.min(tile.entity.items.get(item), max));
}
for(Tile other : new ObjectSetIterator<>(state.teams.get(tile.getTeam()).cores)){
for(Tile other : state.teams.get(tile.getTeam()).cores){
other.block().onProximityUpdate(other);
}
}

View file

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=80e74b71aefc288d02c0098ccd57de810107367c
archash=9ed2c7bd64741309e2ece3fdc15f169862922ef3