From 8ea28e1cedc38096bbccce7e94baaf2b744fb963 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 8 Jun 2020 17:19:47 -0400 Subject: [PATCH] Seq. --- core/assets-raw/sprites/units/delta-base.png | Bin 176 -> 0 bytes core/assets-raw/sprites/units/delta-leg.png | Bin 170 -> 0 bytes .../assets-raw/sprites/units/javelin-cell.png | Bin 333 -> 0 bytes .../sprites/units/javelin-shield.png | Bin 270 -> 0 bytes core/assets-raw/sprites/units/javelin.png | Bin 528 -> 0 bytes core/src/mindustry/Vars.java | 4 +- core/src/mindustry/ai/Astar.java | 8 ++-- core/src/mindustry/ai/BaseAI.java | 2 +- core/src/mindustry/ai/BaseRegistry.java | 12 ++--- core/src/mindustry/ai/BlockIndexer.java | 8 ++-- core/src/mindustry/ai/Pathfinder.java | 26 +++++------ core/src/mindustry/ai/WaveSpawner.java | 4 +- .../BoundedSlotAssignmentStrategy.java | 8 ++-- .../DistanceAssignmentStrategy.java | 8 ++-- .../mindustry/ai/formations/Formation.java | 4 +- .../formations/FormationMotionModerator.java | 2 +- .../FreeSlotAssignmentStrategy.java | 6 +-- .../ai/formations/SlotAssignmentStrategy.java | 6 +-- .../SoftRoleSlotAssignmentStrategy.java | 12 ++--- core/src/mindustry/async/AsyncCore.java | 4 +- core/src/mindustry/async/PhysicsProcess.java | 2 +- core/src/mindustry/audio/MusicControl.java | 8 ++-- core/src/mindustry/content/Fx.java | 4 +- core/src/mindustry/content/SectorPresets.java | 2 +- core/src/mindustry/content/TechTree.java | 6 +-- core/src/mindustry/core/ContentLoader.java | 30 ++++++------ core/src/mindustry/core/Control.java | 2 +- core/src/mindustry/core/NetClient.java | 8 ++-- core/src/mindustry/core/NetServer.java | 14 +++--- core/src/mindustry/core/Platform.java | 4 +- core/src/mindustry/core/UI.java | 6 +-- core/src/mindustry/core/World.java | 2 +- core/src/mindustry/editor/DrawOperation.java | 4 +- core/src/mindustry/editor/EditorTool.java | 4 +- .../src/mindustry/editor/MapEditorDialog.java | 2 +- .../mindustry/editor/MapGenerateDialog.java | 12 ++--- core/src/mindustry/editor/OperationStack.java | 4 +- core/src/mindustry/editor/WaveInfoDialog.java | 4 +- .../mindustry/entities/EntityCollisions.java | 2 +- core/src/mindustry/entities/EntityGroup.java | 10 ++-- core/src/mindustry/entities/Lightning.java | 4 +- .../mindustry/entities/comp/BulletComp.java | 2 +- .../entities/comp/CommanderComp.java | 6 +-- .../mindustry/entities/comp/PayloadComp.java | 2 +- .../mindustry/entities/comp/StatusComp.java | 2 +- .../src/mindustry/entities/comp/TileComp.java | 16 +++---- core/src/mindustry/game/DefaultWaves.java | 10 ++-- core/src/mindustry/game/GlobalData.java | 6 +-- core/src/mindustry/game/Rules.java | 6 +-- core/src/mindustry/game/Saves.java | 6 +-- core/src/mindustry/game/Schematic.java | 8 ++-- core/src/mindustry/game/Schematics.java | 20 ++++---- core/src/mindustry/game/Stats.java | 2 +- core/src/mindustry/game/Team.java | 4 +- core/src/mindustry/game/Teams.java | 14 +++--- core/src/mindustry/game/Tutorial.java | 4 +- .../src/mindustry/graphics/BlockRenderer.java | 6 +-- .../src/mindustry/graphics/FloorRenderer.java | 2 +- .../src/mindustry/graphics/LightRenderer.java | 2 +- core/src/mindustry/graphics/LoadRenderer.java | 2 +- core/src/mindustry/graphics/MenuRenderer.java | 2 +- .../mindustry/graphics/MinimapRenderer.java | 2 +- core/src/mindustry/graphics/Trail.java | 2 +- .../graphics/g3d/PlanetRenderer.java | 2 +- core/src/mindustry/input/InputHandler.java | 18 +++---- core/src/mindustry/input/MobileInput.java | 2 +- core/src/mindustry/input/Placement.java | 6 +-- core/src/mindustry/io/SaveIO.java | 2 +- core/src/mindustry/io/SaveVersion.java | 8 ++-- core/src/mindustry/io/TypeIO.java | 6 +-- core/src/mindustry/io/legacy/LegacyIO.java | 4 +- core/src/mindustry/maps/Map.java | 8 ++-- core/src/mindustry/maps/MapPreviewLoader.java | 4 +- core/src/mindustry/maps/Maps.java | 30 ++++++------ .../maps/filters/CoreSpawnFilter.java | 2 +- .../maps/filters/EnemySpawnFilter.java | 2 +- .../mindustry/maps/filters/MedianFilter.java | 2 +- .../maps/filters/OreMedianFilter.java | 2 +- .../maps/filters/RandomItemFilter.java | 2 +- .../maps/generators/BaseGenerator.java | 10 ++-- .../maps/generators/BasicGenerator.java | 10 ++-- .../maps/planet/TODOPlanetGenerator.java | 8 ++-- core/src/mindustry/mod/ContentParser.java | 10 ++-- core/src/mindustry/mod/Mods.java | 44 +++++++++--------- core/src/mindustry/mod/Scripts.java | 6 +-- core/src/mindustry/net/Administration.java | 38 +++++++-------- core/src/mindustry/net/ArcNetProvider.java | 2 +- core/src/mindustry/net/Net.java | 2 +- core/src/mindustry/net/NetConnection.java | 2 +- core/src/mindustry/net/Packets.java | 4 +- core/src/mindustry/type/Item.java | 2 +- core/src/mindustry/type/ItemStack.java | 6 +-- core/src/mindustry/type/Planet.java | 10 ++-- core/src/mindustry/type/Publishable.java | 4 +- core/src/mindustry/type/SectorPreset.java | 18 +++---- core/src/mindustry/type/UnitType.java | 2 +- core/src/mindustry/ui/ContentDisplay.java | 4 +- core/src/mindustry/ui/Fonts.java | 4 +- core/src/mindustry/ui/MultiReqImage.java | 4 +- .../src/mindustry/ui/dialogs/AboutDialog.java | 4 +- .../ui/dialogs/CustomRulesDialog.java | 2 +- .../mindustry/ui/dialogs/DatabaseDialog.java | 4 +- .../src/mindustry/ui/dialogs/FileChooser.java | 2 +- core/src/mindustry/ui/dialogs/JoinDialog.java | 4 +- core/src/mindustry/ui/dialogs/LoadDialog.java | 2 +- .../mindustry/ui/dialogs/LoadoutDialog.java | 6 +-- .../ui/dialogs/SchematicsDialog.java | 2 +- .../mindustry/ui/dialogs/TechTreeDialog.java | 2 +- .../mindustry/ui/fragments/ChatFragment.java | 4 +- .../mindustry/ui/fragments/HudFragment.java | 4 +- .../ui/fragments/PlacementFragment.java | 16 +++---- .../ui/fragments/ScriptConsoleFragment.java | 4 +- .../mindustry/ui/layout/BranchTreeLayout.java | 2 +- .../mindustry/ui/layout/RowTreeLayout.java | 4 +- core/src/mindustry/world/Block.java | 10 ++-- core/src/mindustry/world/Tile.java | 4 +- .../mindustry/world/blocks/ItemSelection.java | 2 +- .../world/blocks/campaign/LaunchPad.java | 2 +- .../world/blocks/defense/turrets/Turret.java | 2 +- .../world/blocks/distribution/Conveyor.java | 2 +- .../world/blocks/environment/Floor.java | 2 +- .../world/blocks/experimental/BlockForge.java | 2 +- .../blocks/experimental/ProcessorBlock.java | 2 +- .../world/blocks/liquid/Conduit.java | 2 +- .../world/blocks/power/PowerGraph.java | 4 +- .../world/blocks/production/Drill.java | 4 +- .../world/blocks/units/UnitFactory.java | 2 +- .../world/consumers/ConsumeLiquidFilter.java | 2 +- core/src/mindustry/world/meta/BlockStats.java | 8 ++-- core/src/mindustry/world/meta/Producers.java | 2 +- .../world/meta/values/ItemFilterValue.java | 4 +- .../world/meta/values/LiquidFilterValue.java | 4 +- .../mindustry/world/modules/PowerModule.java | 4 +- .../mindustry/desktop/DesktopLauncher.java | 4 +- desktop/src/mindustry/desktop/steam/SNet.java | 2 +- .../mindustry/desktop/steam/SWorkshop.java | 20 ++++---- gradle.properties | 2 +- .../src/mindustry/server/ServerControl.java | 14 +++--- tests/src/test/java/ApplicationTests.java | 10 ++-- tests/src/test/java/SectorTests.java | 4 +- tools/build.gradle | 2 +- tools/src/mindustry/tools/BundleLauncher.java | 4 +- tools/src/mindustry/tools/Edgifier.java | 2 +- tools/src/mindustry/tools/Generators.java | 2 +- tools/src/mindustry/tools/ImagePacker.java | 2 +- .../mindustry/tools/ScriptStubGenerator.java | 12 ++--- .../mindustry/tools/SectorDataGenerator.java | 5 +- 147 files changed, 438 insertions(+), 437 deletions(-) delete mode 100644 core/assets-raw/sprites/units/delta-base.png delete mode 100644 core/assets-raw/sprites/units/delta-leg.png delete mode 100644 core/assets-raw/sprites/units/javelin-cell.png delete mode 100644 core/assets-raw/sprites/units/javelin-shield.png delete mode 100644 core/assets-raw/sprites/units/javelin.png diff --git a/core/assets-raw/sprites/units/delta-base.png b/core/assets-raw/sprites/units/delta-base.png deleted file mode 100644 index 1e954dfd87b14d82f79cbc3b14bb1d5ed4089e60..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 176 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4mJh`hH$2z?FW4IHf07eq;-tT5;x&-%f_o zAOELxM#!#fi;-T>7w*In!Fxm2zFVOoeL+>j-|Q_%+t2*dy7GTXIi{_1TAe3=9kmp00i_>zopr0ApiAXaE2J diff --git a/core/assets-raw/sprites/units/delta-leg.png b/core/assets-raw/sprites/units/delta-leg.png deleted file mode 100644 index 39a650e4b08a207287c43615f37ef988fcb12bdf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 170 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4mJh`hH$2z?F{6`1cSzG$#xlPD-+_-Ec_;nibigTe~DWM4f{0TXh diff --git a/core/assets-raw/sprites/units/javelin-cell.png b/core/assets-raw/sprites/units/javelin-cell.png deleted file mode 100644 index 3066db226280313ea73804847cfcbb603d4dc4f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 333 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4mJh`hH$2z?FU|>mi z^mSxl*x1kgCy|wbfq}EYBeIx*f$uN~Gak=hk;1^h@W|7}F(kwJ?W{n)CIbQ1?(mNy zcm6jAS4=xKYm$gg_l4Sh6ZUv^cr?%Syq>Yh`JCn5neLT)bh#21Gnio~n0YIFgSRcV zX%!H~)of*i*Y{=pA z{onL$0UA>_`7VCkvGMah;itNuCO2OfCCSGq-251GQi3U@b1~~1?%2oYgf_6wO+GKM zLB6D)U-d)JLXI13FOKy*o1vdDdx5votn_USmMeq`JY{qf{IpoNsf0~l#d2tFmP+C_ zhAVmU+6^LFUp!p6Vt0tYRQfPy^3@ft{=!=xHvjr~U4r|QoN{bK;1`L?6-+a?>rH2P z9oaG|dk#ZUc|vcz*uG2KJr5~2v#4BfTyR!x-4Dl!KMy|RNLhQjOSR;>50_$#fYTps aep`jB+us^*p2NVvz~JfX=d#Wzp$PzQG;T8h diff --git a/core/assets-raw/sprites/units/javelin.png b/core/assets-raw/sprites/units/javelin.png deleted file mode 100644 index ed8ac66ec3d21ff7375244bea3263f82e9340270..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 528 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4mJh`hH$2z?F~)opm<%umO+T z*3@kpR!;qL3k@Dbi@i+IDk;!9t@QJw`=;(|4EZOIf0ya@Q(C^n=H5MfzNfZ}K2J#7 zxvt^Nohvp!9GN}}iTrVBwBY2c+u+dCazWv~?f-nPkmQf0ngP=ft1``h{Wtv#<|2+2sRDBRVw{BdvAB9#?VdI|@t zRRbDDD!=VC75$+(XIa3dL*H3ijMIc(c>L+P_|1X&`_Xm>?_j^n!Fz diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 31a9e191bd..02c052ec67 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -62,7 +62,7 @@ public class Vars implements Loadable{ /** URL of the github issue report template.*/ public static final String reportIssueURL = "https://github.com/Anuken/Mindustry/issues/new?template=bug_report.md"; /** list of built-in servers.*/ - public static final Array defaultServers = Array.with(); + public static final Seq defaultServers = Seq.with(); /** maximum distance between mine and core that supports automatic transferring */ public static final float mineTransferRange = 220f; /** max chat message length */ @@ -272,7 +272,7 @@ public class Vars implements Loadable{ String[] tags = {"[green][D][]", "[royal][I][]", "[yellow][W][]", "[scarlet][E][]", ""}; String[] stags = {"&lc&fb[D]", "&lg&fb[I]", "&ly&fb[W]", "&lr&fb[E]", ""}; - Array logBuffer = new Array<>(); + Seq logBuffer = new Seq<>(); Log.setLogger((level, text) -> { String result = text; String rawText = Log.format(stags[level.ordinal()] + "&fr " + text); diff --git a/core/src/mindustry/ai/Astar.java b/core/src/mindustry/ai/Astar.java index 1499be5ce5..c6f33e70f6 100644 --- a/core/src/mindustry/ai/Astar.java +++ b/core/src/mindustry/ai/Astar.java @@ -11,20 +11,20 @@ import static mindustry.Vars.world; public class Astar{ public static final DistanceHeuristic manhattan = (x1, y1, x2, y2) -> Math.abs(x1 - x2) + Math.abs(y1 - y2); - private static final Array out = new Array<>(); + private static final Seq out = new Seq<>(); private static final PQueue queue = new PQueue<>(200 * 200 / 4, (a, b) -> 0); private static final IntFloatMap costs = new IntFloatMap(); private static byte[][] rotations; - public static Array pathfind(Tile from, Tile to, TileHueristic th, Boolf passable){ + public static Seq pathfind(Tile from, Tile to, TileHueristic th, Boolf passable){ return pathfind(from.x, from.y, to.x, to.y, th, manhattan, passable); } - public static Array pathfind(int startX, int startY, int endX, int endY, TileHueristic th, Boolf passable){ + public static Seq pathfind(int startX, int startY, int endX, int endY, TileHueristic th, Boolf passable){ return pathfind(startX, startY, endX, endY, th, manhattan, passable); } - public static Array pathfind(int startX, int startY, int endX, int endY, TileHueristic th, DistanceHeuristic dh, Boolf passable){ + public static Seq pathfind(int startX, int startY, int endX, int endY, TileHueristic th, DistanceHeuristic dh, Boolf passable){ Tiles tiles = world.tiles; Tile start = tiles.getn(startX, startY); diff --git a/core/src/mindustry/ai/BaseAI.java b/core/src/mindustry/ai/BaseAI.java index 466a3fad95..0700bd7d73 100644 --- a/core/src/mindustry/ai/BaseAI.java +++ b/core/src/mindustry/ai/BaseAI.java @@ -54,7 +54,7 @@ public class BaseAI{ int wx = (int)(core.tileX() + Tmp.v1.x), wy = (int)(core.tileY() + Tmp.v1.y); Tile tile = world.tiles.getc(wx, wy); - Array parts = null; + Seq parts = null; //pick a completely random base part, and place it a random location //((yes, very intelligent)) diff --git a/core/src/mindustry/ai/BaseRegistry.java b/core/src/mindustry/ai/BaseRegistry.java index 88ceb86635..da6a11a562 100644 --- a/core/src/mindustry/ai/BaseRegistry.java +++ b/core/src/mindustry/ai/BaseRegistry.java @@ -19,12 +19,12 @@ import java.io.*; import static mindustry.Vars.tilesize; public class BaseRegistry{ - public Array cores = new Array<>(); - public Array parts = new Array<>(); - public ObjectMap> reqParts = new ObjectMap<>(); + public Seq cores = new Seq<>(); + public Seq parts = new Seq<>(); + public ObjectMap> reqParts = new ObjectMap<>(); - public Array forResource(Content item){ - return reqParts.get(item, Array::new); + public Seq forResource(Content item){ + return reqParts.get(item, Seq::new); } public void load(){ @@ -85,7 +85,7 @@ public class BaseRegistry{ part.centerY = part.schematic.height/2; } - if(part.required != null) reqParts.get(part.required, Array::new).add(part); + if(part.required != null) reqParts.get(part.required, Seq::new).add(part); }catch(IOException e){ throw new RuntimeException(e); diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 1560263ee8..637bed1bbb 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -38,7 +38,7 @@ public class BlockIndexer{ /** All ores available on this map. */ private ObjectSet allOres = new ObjectSet<>(); /** Stores teams that are present here as tiles. */ - private Array activeTeams = new Array<>(); + private Seq activeTeams = new Seq<>(); /** Maps teams to a map of flagged tiles by flag. */ private TileArray[][] flagMap = new TileArray[Team.all.length][BlockFlag.all.length]; /** Max units by team. */ @@ -48,7 +48,7 @@ public class BlockIndexer{ /** Empty set used for returning. */ private TileArray emptySet = new TileArray(); /** Array used for returning and reusing. */ - private Array returnArray = new Array<>(); + private Seq returnArray = new Seq<>(); public BlockIndexer(){ Events.on(TileChangeEvent.class, event -> { @@ -196,7 +196,7 @@ public class BlockIndexer{ } /** Get all enemy blocks with a flag. */ - public Array getEnemy(Team team, BlockFlag type){ + public Seq getEnemy(Team team, BlockFlag type){ returnArray.clear(); for(Team enemy : team.enemies()){ if(state.teams.isActive(enemy)){ @@ -446,7 +446,7 @@ public class BlockIndexer{ } public static class TileArray implements Iterable{ - private Array tiles = new Array<>(false, 16); + private Seq tiles = new Seq<>(false, 16); private IntSet contained = new IntSet(); public void add(Tile tile){ diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index 06550d602c..d5ced3fe18 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -26,7 +26,7 @@ public class Pathfinder implements Runnable{ /** tile data, see PathTileStruct */ private int[][] tiles; /** unordered array of path data for iteration only. DO NOT iterate or access this in the main thread. */ - private Array threadList = new Array<>(), mainList = new Array<>(); + private Seq threadList = new Seq<>(), mainList = new Seq<>(); /** Maps team ID and target to to a flowfield.*/ private ObjectMap[] fieldMap = new ObjectMap[Team.all.length]; /** Used field maps. */ @@ -37,7 +37,7 @@ public class Pathfinder implements Runnable{ private ObjectMap targetCache = new ObjectMap<>(); /** Current pathfinding thread */ private @Nullable Thread thread; - private IntArray tmpArray = new IntArray(); + private IntSeq tmpArray = new IntSeq(); public Pathfinder(){ Events.on(WorldLoadEvent.class, event -> { @@ -48,8 +48,8 @@ public class Pathfinder implements Runnable{ fieldMap = new ObjectMap[Team.all.length]; fieldMapUsed = new ObjectSet[Team.all.length]; targetCache = new ObjectMap<>(); - threadList = new Array<>(); - mainList = new Array<>(); + threadList = new Seq<>(); + mainList = new Seq<>(); for(Tile tile : world.tiles){ tiles[tile.x][tile.y] = packTile(tile); @@ -189,7 +189,7 @@ public class Pathfinder implements Runnable{ //if this combination is not found, create it on request if(fieldMapUsed[team.uid].add(target)){ //grab targets since this is run on main thread - IntArray targets = target.getPositions(team, new IntArray()); + IntSeq targets = target.getPositions(team, new IntSeq()); queue.post(() -> createPath(team, target, targets)); } return tile; @@ -293,14 +293,14 @@ public class Pathfinder implements Runnable{ } private void preloadPath(Team team, PathTarget target){ - updateFrontier(createPath(team, target, target.getPositions(team, new IntArray())), -1); + updateFrontier(createPath(team, target, target.getPositions(team, new IntSeq())), -1); } /** * Created a new flowfield that aims to get to a certain target for a certain team. * Pathfinding thread only. */ - private Flowfield createPath(Team team, PathTarget target, IntArray targets){ + private Flowfield createPath(Team team, PathTarget target, IntSeq targets){ Flowfield path = new Flowfield(team, target, world.width(), world.height()); path.lastUpdateTime = Time.millis(); @@ -391,14 +391,14 @@ public class Pathfinder implements Runnable{ public static final FlagTarget[] all = values(); - private final Cons2 targeter; + private final Cons2 targeter; - FlagTarget(Cons2 targeter){ + FlagTarget(Cons2 targeter){ this.targeter = targeter; } @Override - public IntArray getPositions(Team team, IntArray out){ + public IntSeq getPositions(Team team, IntSeq out){ targeter.get(team, out); return out; } @@ -417,7 +417,7 @@ public class Pathfinder implements Runnable{ } @Override - public IntArray getPositions(Team team, IntArray out){ + public IntSeq getPositions(Team team, IntSeq out){ out.add(Point2.pack(world.toTile(position.getX()), world.toTile(position.getY()))); return out; } @@ -430,7 +430,7 @@ public class Pathfinder implements Runnable{ public interface PathTarget{ /** Gets targets to pathfind towards. This must run on the main thread. */ - IntArray getPositions(Team team, IntArray out); + IntSeq getPositions(Team team, IntSeq out); /** Refresh rate in milliseconds. Return any number <= 0 to disable. */ int refreshRate(); } @@ -448,7 +448,7 @@ public class Pathfinder implements Runnable{ /** search frontier, these are Pos objects */ final IntQueue frontier = new IntQueue(); /** all target positions; these positions have a cost of 0, and must be synchronized on! */ - final IntArray targets = new IntArray(); + final IntSeq targets = new IntSeq(); /** current search ID */ int search = 1; /** last updated time */ diff --git a/core/src/mindustry/ai/WaveSpawner.java b/core/src/mindustry/ai/WaveSpawner.java index f7f78882eb..61b02e6113 100644 --- a/core/src/mindustry/ai/WaveSpawner.java +++ b/core/src/mindustry/ai/WaveSpawner.java @@ -17,7 +17,7 @@ import static mindustry.Vars.*; public class WaveSpawner{ private static final float margin = 40f, coreMargin = tilesize * 3; //how far away from the edge flying units spawn - private Array spawns = new Array<>(); + private Seq spawns = new Seq<>(); private boolean spawning = false; public WaveSpawner(){ @@ -28,7 +28,7 @@ public class WaveSpawner{ return spawns.size; } - public Array getSpawns(){ + public Seq getSpawns(){ return spawns; } diff --git a/core/src/mindustry/ai/formations/BoundedSlotAssignmentStrategy.java b/core/src/mindustry/ai/formations/BoundedSlotAssignmentStrategy.java index dcd96108f6..62461bde31 100644 --- a/core/src/mindustry/ai/formations/BoundedSlotAssignmentStrategy.java +++ b/core/src/mindustry/ai/formations/BoundedSlotAssignmentStrategy.java @@ -7,7 +7,7 @@ import arc.struct.*; * {@code BoundedSlotAssignmentStrategy} is an abstract implementation of {@link SlotAssignmentStrategy} that supports roles. * Generally speaking, there are hard and soft roles. Hard roles cannot be broken, soft roles can. *

- * This abstract class provides an implementation of the {@link #calculateNumberOfSlots(Array) calculateNumberOfSlots} method that + * This abstract class provides an implementation of the {@link #calculateNumberOfSlots(Seq) calculateNumberOfSlots} method that * is more general (and costly) than the simplified implementation in {@link FreeSlotAssignmentStrategy}. It scans the assignment * list to find the number of filled slots, which is the highest slot number in the assignments. * @author davebaol @@ -15,10 +15,10 @@ import arc.struct.*; public abstract class BoundedSlotAssignmentStrategy implements SlotAssignmentStrategy{ @Override - public abstract void updateSlotAssignments(Array assignments); + public abstract void updateSlotAssignments(Seq assignments); @Override - public int calculateNumberOfSlots(Array assignments){ + public int calculateNumberOfSlots(Seq assignments){ // Find the number of filled slots: it will be the // highest slot number in the assignments int filledSlots = -1; @@ -32,7 +32,7 @@ public abstract class BoundedSlotAssignmentStrategy implements SlotAssignmentStr } @Override - public void removeSlotAssignment(Array assignments, int index){ + public void removeSlotAssignment(Seq assignments, int index){ int sn = assignments.get(index).slotNumber; for(int i = 0; i < assignments.size; i++){ SlotAssignment sa = assignments.get(i); diff --git a/core/src/mindustry/ai/formations/DistanceAssignmentStrategy.java b/core/src/mindustry/ai/formations/DistanceAssignmentStrategy.java index 3a68efc915..9713e66862 100644 --- a/core/src/mindustry/ai/formations/DistanceAssignmentStrategy.java +++ b/core/src/mindustry/ai/formations/DistanceAssignmentStrategy.java @@ -13,8 +13,8 @@ public class DistanceAssignmentStrategy implements SlotAssignmentStrategy{ } @Override - public void updateSlotAssignments(Array assignments){ - IntArray slots = IntArray.range(0, assignments.size); + public void updateSlotAssignments(Seq assignments){ + IntSeq slots = IntSeq.range(0, assignments.size); for(SlotAssignment slot : assignments){ int mindex = 0; @@ -35,12 +35,12 @@ public class DistanceAssignmentStrategy implements SlotAssignmentStrategy{ } @Override - public int calculateNumberOfSlots(Array assignments){ + public int calculateNumberOfSlots(Seq assignments){ return assignments.size; } @Override - public void removeSlotAssignment(Array assignments, int index){ + public void removeSlotAssignment(Seq assignments, int index){ assignments.remove(index); } diff --git a/core/src/mindustry/ai/formations/Formation.java b/core/src/mindustry/ai/formations/Formation.java index 8ef03e509b..16db811b2f 100644 --- a/core/src/mindustry/ai/formations/Formation.java +++ b/core/src/mindustry/ai/formations/Formation.java @@ -19,7 +19,7 @@ import arc.struct.*; public class Formation{ /** A list of slots assignments. */ - public Array slotAssignments; + public Seq slotAssignments; /** The anchor point of this formation. */ public Vec3 anchor; @@ -74,7 +74,7 @@ public class Formation{ this.slotAssignmentStrategy = slotAssignmentStrategy; this.motionModerator = motionModerator; - this.slotAssignments = new Array<>(); + this.slotAssignments = new Seq<>(); this.driftOffset = new Vec3(); this.positionOffset = new Vec2(anchor.x, anchor.y).cpy(); } diff --git a/core/src/mindustry/ai/formations/FormationMotionModerator.java b/core/src/mindustry/ai/formations/FormationMotionModerator.java index 9326dd4966..65e55951c9 100644 --- a/core/src/mindustry/ai/formations/FormationMotionModerator.java +++ b/core/src/mindustry/ai/formations/FormationMotionModerator.java @@ -25,7 +25,7 @@ public abstract class FormationMotionModerator{ * @param pattern the pattern * @return the given location for chaining. */ - public Vec3 calculateDriftOffset(Vec3 centerOfMass, Array slotAssignments, FormationPattern pattern){ + public Vec3 calculateDriftOffset(Vec3 centerOfMass, Seq slotAssignments, FormationPattern pattern){ // Clear the center of mass centerOfMass.x = centerOfMass.y = 0; float centerOfMassOrientation = 0; diff --git a/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java b/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java index 58c25fa07e..35fd74f789 100644 --- a/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java +++ b/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java @@ -13,7 +13,7 @@ import arc.struct.*; public class FreeSlotAssignmentStrategy implements SlotAssignmentStrategy{ @Override - public void updateSlotAssignments(Array assignments){ + public void updateSlotAssignments(Seq assignments){ // A very simple assignment algorithm: we simply go through // each assignment in the list and assign sequential slot numbers for(int i = 0; i < assignments.size; i++) @@ -21,12 +21,12 @@ public class FreeSlotAssignmentStrategy implements SlotAssignmentStrategy{ } @Override - public int calculateNumberOfSlots(Array assignments){ + public int calculateNumberOfSlots(Seq assignments){ return assignments.size; } @Override - public void removeSlotAssignment(Array assignments, int index){ + public void removeSlotAssignment(Seq assignments, int index){ assignments.remove(index); } diff --git a/core/src/mindustry/ai/formations/SlotAssignmentStrategy.java b/core/src/mindustry/ai/formations/SlotAssignmentStrategy.java index 698bca1c15..2ccea7aa15 100644 --- a/core/src/mindustry/ai/formations/SlotAssignmentStrategy.java +++ b/core/src/mindustry/ai/formations/SlotAssignmentStrategy.java @@ -9,12 +9,12 @@ import arc.struct.*; public interface SlotAssignmentStrategy{ /** Updates the assignment of members to slots */ - void updateSlotAssignments(Array assignments); + void updateSlotAssignments(Seq assignments); /** Calculates the number of slots from the assignment data. */ - int calculateNumberOfSlots(Array assignments); + int calculateNumberOfSlots(Seq assignments); /** Removes the slot assignment at the specified index. */ - void removeSlotAssignment(Array assignments, int index); + void removeSlotAssignment(Seq assignments, int index); } diff --git a/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java b/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java index 2d61c8566e..f3f3c09bed 100644 --- a/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java +++ b/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java @@ -27,7 +27,7 @@ import arc.util.*; public class SoftRoleSlotAssignmentStrategy extends BoundedSlotAssignmentStrategy{ protected SlotCostProvider slotCostProvider; protected float costThreshold; - private BooleanArray filledSlots; + private BoolSeq filledSlots; /** * Creates a {@code SoftRoleSlotAssignmentStrategy} with the given slot cost provider and no cost threshold. @@ -46,14 +46,14 @@ public class SoftRoleSlotAssignmentStrategy extends BoundedSlotAssignmentStrateg this.slotCostProvider = slotCostProvider; this.costThreshold = costThreshold; - this.filledSlots = new BooleanArray(); + this.filledSlots = new BoolSeq(); } @Override - public void updateSlotAssignments(Array assignments){ + public void updateSlotAssignments(Seq assignments){ // Holds a list of member and slot data for each member. - Array memberData = new Array<>(); + Seq memberData = new Seq<>(); // Compile the member data int numberOfAssignments = assignments.size; @@ -146,12 +146,12 @@ public class SoftRoleSlotAssignmentStrategy extends BoundedSlotAssignmentStrateg static class MemberAndSlots implements Comparable{ FormationMember member; float assignmentEase; - Array costAndSlots; + Seq costAndSlots; public MemberAndSlots(FormationMember member){ this.member = member; this.assignmentEase = 0f; - this.costAndSlots = new Array<>(); + this.costAndSlots = new Seq<>(); } @Override diff --git a/core/src/mindustry/async/AsyncCore.java b/core/src/mindustry/async/AsyncCore.java index 923c46bfb0..a023afafcc 100644 --- a/core/src/mindustry/async/AsyncCore.java +++ b/core/src/mindustry/async/AsyncCore.java @@ -11,13 +11,13 @@ import static mindustry.Vars.state; public class AsyncCore{ //all processes to be executed each frame - private final Array processes = Array.with( + private final Seq processes = Seq.with( new PhysicsProcess(), Vars.teamIndex = new TeamIndexProcess() ); //futures to be awaited - private final Array> futures = new Array<>(); + private final Seq> futures = new Seq<>(); private final ExecutorService executor = Executors.newFixedThreadPool(processes.size, r -> { Thread thread = new Thread(r, "AsyncLogic-Thread"); diff --git a/core/src/mindustry/async/PhysicsProcess.java b/core/src/mindustry/async/PhysicsProcess.java index 165b2a0505..20dcbcc0f6 100644 --- a/core/src/mindustry/async/PhysicsProcess.java +++ b/core/src/mindustry/async/PhysicsProcess.java @@ -10,7 +10,7 @@ import mindustry.gen.*; public class PhysicsProcess implements AsyncProcess{ private Physics physics; - private Array refs = new Array<>(false); + private Seq refs = new Seq<>(false); private BodyDef def; private EntityGroup group; diff --git a/core/src/mindustry/audio/MusicControl.java b/core/src/mindustry/audio/MusicControl.java index cf49975931..c1bd7d0866 100644 --- a/core/src/mindustry/audio/MusicControl.java +++ b/core/src/mindustry/audio/MusicControl.java @@ -16,9 +16,9 @@ public class MusicControl{ protected static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.6f, musicWaveChance = 0.5f; /** normal, ambient music, plays at any time */ - public Array ambientMusic = Array.with(); + public Seq ambientMusic = Seq.with(); /** darker music, used in times of conflict */ - public Array darkMusic = Array.with(); + public Seq darkMusic = Seq.with(); protected Music lastRandomPlayed; protected Interval timer = new Interval(); protected @Nullable Music current; @@ -39,8 +39,8 @@ public class MusicControl{ protected void reload(){ current = null; fade = 0f; - ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6); - darkMusic = Array.with(Musics.game2, Musics.game5, Musics.game7); + ambientMusic = Seq.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6); + darkMusic = Seq.with(Musics.game2, Musics.game5, Musics.game7); } public void stop(){ diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 5b3da08336..da98b5e99a 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -120,8 +120,8 @@ public class Fx{ }), lightning = new Effect(10f, 500f, e -> { - if(!(e.data instanceof Array)) return; - Array lines = e.data(); + if(!(e.data instanceof Seq)) return; + Seq lines = e.data(); stroke(3f * e.fout()); color(e.color, Color.white, e.fin()); diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index 050a5b0bc9..9b0355ada9 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -4,7 +4,7 @@ import mindustry.ctype.*; import mindustry.game.Objectives.*; import mindustry.type.*; -import static arc.struct.Array.with; +import static arc.struct.Seq.with; import static mindustry.content.Items.*; import static mindustry.content.Planets.starter; import static mindustry.type.ItemStack.list; diff --git a/core/src/mindustry/content/TechTree.java b/core/src/mindustry/content/TechTree.java index 0cb848f6c8..45645a5b44 100644 --- a/core/src/mindustry/content/TechTree.java +++ b/core/src/mindustry/content/TechTree.java @@ -11,13 +11,13 @@ import mindustry.world.*; import static mindustry.content.Blocks.*; public class TechTree implements ContentList{ - public static Array all; + public static Seq all; public static TechNode root; @Override public void load(){ TechNode.context = null; - all = new Array<>(); + all = new Seq<>(); root = node(coreShard, () -> { @@ -328,7 +328,7 @@ public class TechTree implements ContentList{ /** Research turns required to research this content. */ public int turns = 3; //TODO keep track of turns that have been used so far /** Nodes that depend on this node. */ - public final Array children = new Array<>(); + public final Seq children = new Seq<>(); TechNode(TechNode ccontext, UnlockableContent content, ItemStack[] requirements, Runnable children){ if(ccontext != null){ diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index e0adf6f89a..91286834e2 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -23,7 +23,7 @@ import static mindustry.Vars.mods; @SuppressWarnings("unchecked") public class ContentLoader{ private ObjectMap[] contentNameMap = new ObjectMap[ContentType.values().length]; - private Array[] contentMap = new Array[ContentType.values().length]; + private Seq[] contentMap = new Seq[ContentType.values().length]; private MappableContent[][] temporaryMapper; private @Nullable LoadedMod currentMod; private @Nullable Content lastAdded; @@ -49,11 +49,11 @@ public class ContentLoader{ /** Clears all initialized content.*/ public void clear(){ contentNameMap = new ObjectMap[ContentType.values().length]; - contentMap = new Array[ContentType.values().length]; + contentMap = new Seq[ContentType.values().length]; initialization = new ObjectSet<>(); for(ContentType type : ContentType.values()){ - contentMap[type.ordinal()] = new Array<>(); + contentMap[type.ordinal()] = new Seq<>(); contentNameMap[type.ordinal()] = new ObjectMap<>(); } } @@ -76,7 +76,7 @@ public class ContentLoader{ /** Logs content statistics.*/ public void logContent(){ //check up ID mapping, make sure it's linear (debug only) - for(Array arr : contentMap){ + for(Seq arr : contentMap){ for(int i = 0; i < arr.size; i++){ int id = arr.get(i).id; if(id != i){ @@ -89,7 +89,7 @@ public class ContentLoader{ for(int k = 0; k < contentMap.length; k++){ Log.debug("[@]: loaded @", ContentType.values()[k].name(), contentMap[k].size); } - Log.debug("Total content loaded: @", Array.with(ContentType.values()).mapInt(c -> contentMap[c.ordinal()].size).sum()); + Log.debug("Total content loaded: @", Seq.with(ContentType.values()).mapInt(c -> contentMap[c.ordinal()].size).sum()); Log.debug("-------------------"); } @@ -196,7 +196,7 @@ public class ContentLoader{ this.temporaryMapper = temporaryMapper; } - public Array[] getContentMap(){ + public Seq[] getContentMap(){ return contentMap; } @@ -226,13 +226,13 @@ public class ContentLoader{ return (T)contentMap[type.ordinal()].get(id); } - public Array getBy(ContentType type){ - return (Array)contentMap[type.ordinal()]; + public Seq getBy(ContentType type){ + return (Seq)contentMap[type.ordinal()]; } //utility methods, just makes things a bit shorter - public Array blocks(){ + public Seq blocks(){ return getBy(ContentType.block); } @@ -244,7 +244,7 @@ public class ContentLoader{ return (Block)getByName(ContentType.block, name); } - public Array items(){ + public Seq items(){ return getBy(ContentType.item); } @@ -252,7 +252,7 @@ public class ContentLoader{ return (Item)getByID(ContentType.item, id); } - public Array liquids(){ + public Seq liquids(){ return getBy(ContentType.liquid); } @@ -260,7 +260,7 @@ public class ContentLoader{ return (Liquid)getByID(ContentType.liquid, id); } - public Array bullets(){ + public Seq bullets(){ return getBy(ContentType.bullet); } @@ -268,15 +268,15 @@ public class ContentLoader{ return (BulletType)getByID(ContentType.bullet, id); } - public Array sectors(){ + public Seq sectors(){ return getBy(ContentType.sector); } - public Array units(){ + public Seq units(){ return getBy(ContentType.unit); } - public Array planets(){ + public Seq planets(){ return getBy(ContentType.planet); } } diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index f744a16b4f..9b3e8e2af7 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -57,7 +57,7 @@ public class Control implements ApplicationListener, Loadable{ Events.on(StateChangeEvent.class, event -> { if((event.from == State.playing && event.to == State.menu) || (event.from == State.menu && event.to != State.menu)){ Time.runTask(5f, platform::updateRPC); - for(Sound sound : assets.getAll(Sound.class, new Array<>())){ + for(Sound sound : assets.getAll(Sound.class, new Seq<>())){ sound.stop(); } } diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 8117bedd62..4b1ffb2452 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -51,7 +51,7 @@ public class NetClient implements ApplicationListener{ private ReusableByteInStream byteStream = new ReusableByteInStream(); private DataInputStream dataStream = new DataInputStream(byteStream); /** Packet handlers for custom types of messages. */ - private ObjectMap>> customPacketHandlers = new ObjectMap<>(); + private ObjectMap>> customPacketHandlers = new ObjectMap<>(); public NetClient(){ @@ -130,11 +130,11 @@ public class NetClient implements ApplicationListener{ } public void addPacketHandler(String type, Cons handler){ - customPacketHandlers.get(type, Array::new).add(handler); + customPacketHandlers.get(type, Seq::new).add(handler); } - public Array> getPacketHandlers(String type){ - return customPacketHandlers.get(type, Array::new); + public Seq> getPacketHandlers(String type){ + return customPacketHandlers.get(type, Seq::new); } @Remote(targets = Loc.server, variants = Variant.both) diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 6c3f51e803..0c475b459f 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -75,7 +75,7 @@ public class NetServer implements ApplicationListener{ /** Data stream for writing player sync data to. */ private DataOutputStream dataStream = new DataOutputStream(syncStream); /** Packet handlers for custom types of messages. */ - private ObjectMap>> customPacketHandlers = new ObjectMap<>(); + private ObjectMap>> customPacketHandlers = new ObjectMap<>(); public NetServer(){ @@ -140,8 +140,8 @@ public class NetServer implements ApplicationListener{ return; } - Array extraMods = packet.mods.copy(); - Array missingMods = mods.getIncompatibility(extraMods); + Seq extraMods = packet.mods.copy(); + Seq missingMods = mods.getIncompatibility(extraMods); if(!extraMods.isEmpty() || !missingMods.isEmpty()){ //can't easily be localized since kick reasons can't have formatted text with them @@ -481,11 +481,11 @@ public class NetServer implements ApplicationListener{ } public void addPacketHandler(String type, Cons2 handler){ - customPacketHandlers.get(type, Array::new).add(handler); + customPacketHandlers.get(type, Seq::new).add(handler); } - public Array> getPacketHandlers(String type){ - return customPacketHandlers.get(type, Array::new); + public Seq> getPacketHandlers(String type){ + return customPacketHandlers.get(type, Seq::new); } public static void onDisconnect(Playerc player, String reason){ @@ -797,7 +797,7 @@ public class NetServer implements ApplicationListener{ public void writeEntitySnapshot(Playerc player) throws IOException{ syncStream.reset(); - Array cores = state.teams.cores(player.team()); + Seq cores = state.teams.cores(player.team()); dataStream.writeByte(cores.size); diff --git a/core/src/mindustry/core/Platform.java b/core/src/mindustry/core/Platform.java index 234f0bea0d..1ba3a6aabc 100644 --- a/core/src/mindustry/core/Platform.java +++ b/core/src/mindustry/core/Platform.java @@ -36,8 +36,8 @@ public interface Platform{ default void viewListingID(String mapid){} /** Steam: Return external workshop maps to be loaded.*/ - default Array getWorkshopContent(Class type){ - return new Array<>(0); + default Seq getWorkshopContent(Class type){ + return new Seq<>(0); } /** Steam: Open workshop for maps.*/ diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index db7439faa0..7832d52652 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -86,7 +86,7 @@ public class UI implements ApplicationListener, Loadable{ Fonts.def.getData().markupEnabled = true; Fonts.def.setOwnsTexture(false); - Core.assets.getAll(BitmapFont.class, new Array<>()).each(font -> font.setUseIntegerPositions(true)); + Core.assets.getAll(BitmapFont.class, new Seq<>()).each(font -> font.setUseIntegerPositions(true)); Core.scene = new Scene(); Core.input.addProcessor(Core.scene); @@ -118,8 +118,8 @@ public class UI implements ApplicationListener, Loadable{ } @Override - public Array getDependencies(){ - return Array.with(new AssetDescriptor<>(Control.class), new AssetDescriptor<>("outline", BitmapFont.class), new AssetDescriptor<>("default", BitmapFont.class), new AssetDescriptor<>("chat", BitmapFont.class)); + public Seq getDependencies(){ + return Seq.with(new AssetDescriptor<>(Control.class), new AssetDescriptor<>("outline", BitmapFont.class), new AssetDescriptor<>("default", BitmapFont.class), new AssetDescriptor<>("chat", BitmapFont.class)); } @Override diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index 00dc23c333..f1bd49ce2b 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -527,7 +527,7 @@ public class World{ @Override public void end(){ - Array filters = map.filters(); + Seq filters = map.filters(); if(!filters.isEmpty()){ //input for filter queries diff --git a/core/src/mindustry/editor/DrawOperation.java b/core/src/mindustry/editor/DrawOperation.java index 17e84715db..0d6607e8ff 100755 --- a/core/src/mindustry/editor/DrawOperation.java +++ b/core/src/mindustry/editor/DrawOperation.java @@ -1,7 +1,7 @@ package mindustry.editor; import mindustry.annotations.Annotations.*; -import arc.struct.LongArray; +import arc.struct.LongSeq; import mindustry.game.Team; import mindustry.gen.TileOp; import mindustry.world.Block; @@ -12,7 +12,7 @@ import static mindustry.Vars.content; public class DrawOperation{ private MapEditor editor; - private LongArray array = new LongArray(); + private LongSeq array = new LongSeq(); public DrawOperation(MapEditor editor) { this.editor = editor; diff --git a/core/src/mindustry/editor/EditorTool.java b/core/src/mindustry/editor/EditorTool.java index 26820d3c78..a6493d4401 100644 --- a/core/src/mindustry/editor/EditorTool.java +++ b/core/src/mindustry/editor/EditorTool.java @@ -91,7 +91,7 @@ public enum EditorTool{ edit = true; } - IntArray stack = new IntArray(); + IntSeq stack = new IntSeq(); @Override public void touched(MapEditor editor, int x, int y){ @@ -200,7 +200,7 @@ public enum EditorTool{ stack = null; System.gc(); e.printStackTrace(); - stack = new IntArray(); + stack = new IntSeq(); } } } diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index 96792a7cc2..7c5dd8d321 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -46,7 +46,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ private Rules lastSavedRules; private boolean saved = false; private boolean shownWithMap = false; - private Array blocksOut = new Array<>(); + private Seq blocksOut = new Seq<>(); public MapEditorDialog(){ super(""); diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index ac84bbf24d..e6a7e04c6c 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -38,7 +38,7 @@ public class MapGenerateDialog extends BaseDialog{ private Pixmap pixmap; private Texture texture; private GenerateInput input = new GenerateInput(); - private Array filters = new Array<>(); + private Seq filters = new Seq<>(); private int scaling = mobile ? 3 : 1; private Table filterTable; @@ -48,7 +48,7 @@ public class MapGenerateDialog extends BaseDialog{ private GenTile returnTile = new GenTile(); private GenTile[][] buffer1, buffer2; - private Cons> applier; + private Cons> applier; private CachedTile ctile = new CachedTile(){ //nothing. @Override @@ -95,18 +95,18 @@ public class MapGenerateDialog extends BaseDialog{ onResize(this::rebuildFilters); } - public void show(Array filters, Cons> applier){ + public void show(Seq filters, Cons> applier){ this.filters = filters; this.applier = applier; show(); } - public void show(Cons> applier){ + public void show(Cons> applier){ show(this.filters, applier); } /** Applies the specified filters to the editor. */ - public void applyToEditor(Array filters){ + public void applyToEditor(Seq filters){ //writeback buffer GenTile[][] writeTiles = new GenTile[editor.width()][editor.height()]; @@ -342,7 +342,7 @@ public class MapGenerateDialog extends BaseDialog{ return; } - Array copy = new Array<>(filters); + Seq copy = new Seq<>(filters); result = executor.submit(() -> { try{ diff --git a/core/src/mindustry/editor/OperationStack.java b/core/src/mindustry/editor/OperationStack.java index f21cde91b8..623bd1a3cd 100755 --- a/core/src/mindustry/editor/OperationStack.java +++ b/core/src/mindustry/editor/OperationStack.java @@ -1,10 +1,10 @@ package mindustry.editor; -import arc.struct.Array; +import arc.struct.Seq; public class OperationStack{ private final static int maxSize = 10; - private Array stack = new Array<>(); + private Seq stack = new Seq<>(); private int index = 0; public OperationStack(){ diff --git a/core/src/mindustry/editor/WaveInfoDialog.java b/core/src/mindustry/editor/WaveInfoDialog.java index e051c5d231..77574793af 100644 --- a/core/src/mindustry/editor/WaveInfoDialog.java +++ b/core/src/mindustry/editor/WaveInfoDialog.java @@ -26,7 +26,7 @@ import static mindustry.game.SpawnGroup.never; public class WaveInfoDialog extends BaseDialog{ private final static int displayed = 20; - private Array groups = new Array<>(); + private Seq groups = new Seq<>(); private Table table, preview; private int start = 0; @@ -87,7 +87,7 @@ public class WaveInfoDialog extends BaseDialog{ main.pane(t -> table = t).growX().growY().padRight(8f).get().setScrollingDisabled(true, false); main.row(); main.button("$add", () -> { - if(groups == null) groups = new Array<>(); + if(groups == null) groups = new Seq<>(); groups.add(new SpawnGroup(lastType)); buildGroups(); }).growX().height(70f); diff --git a/core/src/mindustry/entities/EntityCollisions.java b/core/src/mindustry/entities/EntityCollisions.java index 4aaf455f10..41a9f21276 100644 --- a/core/src/mindustry/entities/EntityCollisions.java +++ b/core/src/mindustry/entities/EntityCollisions.java @@ -22,7 +22,7 @@ public class EntityCollisions{ private Rect r2 = new Rect(); //entity collisions - private Array arrOut = new Array<>(); + private Seq arrOut = new Seq<>(); public void move(Hitboxc entity, float deltax, float deltay){ move(entity, deltax, deltay, EntityCollisions::solid); diff --git a/core/src/mindustry/entities/EntityGroup.java b/core/src/mindustry/entities/EntityGroup.java index 088f782349..423fad05f0 100644 --- a/core/src/mindustry/entities/EntityGroup.java +++ b/core/src/mindustry/entities/EntityGroup.java @@ -15,8 +15,8 @@ import static mindustry.Vars.collisions; public class EntityGroup implements Iterable{ private static int lastId = 0; - private final Array array; - private final Array intersectArray = new Array<>(); + private final Seq array; + private final Seq intersectArray = new Seq<>(); private final Rect viewport = new Rect(); private final Rect intersectRect = new Rect(); private IntMap map; @@ -30,7 +30,7 @@ public class EntityGroup implements Iterable{ } public EntityGroup(Class type, boolean spatial, boolean mapping){ - array = new Array<>(false, 32, type); + array = new Seq<>(false, 32, type); if(spatial){ tree = new QuadTree<>(new Rect(0, 0, 0, 0)); @@ -57,7 +57,7 @@ public class EntityGroup implements Iterable{ each(Entityc::update); } - public void copy(Array arr){ + public void copy(Seq arr){ arr.addAll(array); } @@ -111,7 +111,7 @@ public class EntityGroup implements Iterable{ tree.intersect(height, x, y, width, out); } - public Array intersect(float x, float y, float width, float height){ + public Seq intersect(float x, float y, float width, float height){ intersectArray.clear(); //don't waste time for empty groups if(isEmpty()) return intersectArray; diff --git a/core/src/mindustry/entities/Lightning.java b/core/src/mindustry/entities/Lightning.java index c0cd8aab85..db37d6c39b 100644 --- a/core/src/mindustry/entities/Lightning.java +++ b/core/src/mindustry/entities/Lightning.java @@ -14,7 +14,7 @@ import static mindustry.Vars.*; public class Lightning{ private static final Rand random = new Rand(); private static final Rect rect = new Rect(); - private static final Array entities = new Array<>(); + private static final Seq entities = new Seq<>(); private static final IntSet hit = new IntSet(); private static final int maxChain = 8; private static final float hitRange = 30f; @@ -32,7 +32,7 @@ public class Lightning{ random.setSeed(seed); hit.clear(); - Array lines = new Array<>(); + Seq lines = new Seq<>(); bhit = false; for(int i = 0; i < length / 2; i++){ diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index c56849af8c..b97e6bea4e 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -19,7 +19,7 @@ import static mindustry.Vars.*; abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Drawc, Shielderc, Ownerc, Velc, Bulletc, Timerc{ @Import Team team; - IntArray collided = new IntArray(6); + IntSeq collided = new IntSeq(6); Object data; BulletType type; float damage; diff --git a/core/src/mindustry/entities/comp/CommanderComp.java b/core/src/mindustry/entities/comp/CommanderComp.java index 94c4c8dfb2..607b0968bf 100644 --- a/core/src/mindustry/entities/comp/CommanderComp.java +++ b/core/src/mindustry/entities/comp/CommanderComp.java @@ -11,12 +11,12 @@ import mindustry.gen.*; /** A unit that can command other units. */ @Component abstract class CommanderComp implements Unitc{ - private static final Array members = new Array<>(); + private static final Seq members = new Seq<>(); @Import float x, y, rotation; transient @Nullable Formation formation; - transient Array controlling = new Array<>(); + transient Seq controlling = new Seq<>(); @Override public void update(){ @@ -42,7 +42,7 @@ abstract class CommanderComp implements Unitc{ clearCommand(); } - void command(Formation formation, Array units){ + void command(Formation formation, Seq units){ clearCommand(); controlling.addAll(units); diff --git a/core/src/mindustry/entities/comp/PayloadComp.java b/core/src/mindustry/entities/comp/PayloadComp.java index 3a02a6ae25..fafbc99532 100644 --- a/core/src/mindustry/entities/comp/PayloadComp.java +++ b/core/src/mindustry/entities/comp/PayloadComp.java @@ -15,7 +15,7 @@ import mindustry.world.blocks.payloads.*; abstract class PayloadComp implements Posc, Rotc{ @Import float x, y, rotation; - Array payloads = new Array<>(); + Seq payloads = new Seq<>(); boolean hasPayload(){ return payloads.size > 0; diff --git a/core/src/mindustry/entities/comp/StatusComp.java b/core/src/mindustry/entities/comp/StatusComp.java index e5b62135ec..53cefee8fd 100644 --- a/core/src/mindustry/entities/comp/StatusComp.java +++ b/core/src/mindustry/entities/comp/StatusComp.java @@ -17,7 +17,7 @@ import static mindustry.Vars.content; @Component abstract class StatusComp implements Posc, Flyingc{ - private Array statuses = new Array<>(); + private Seq statuses = new Seq<>(); private transient Bits applied = new Bits(content.getBy(ContentType.status).size); @ReadOnly transient float speedMultiplier, damageMultiplier, armorMultiplier; diff --git a/core/src/mindustry/entities/comp/TileComp.java b/core/src/mindustry/entities/comp/TileComp.java index 039469162e..6d4d197586 100644 --- a/core/src/mindustry/entities/comp/TileComp.java +++ b/core/src/mindustry/entities/comp/TileComp.java @@ -41,8 +41,8 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree //region vars and initialization static final float timeToSleep = 60f * 1; static final ObjectSet tmpTiles = new ObjectSet<>(); - static final Array tempTileEnts = new Array<>(); - static final Array tempTiles = new Array<>(); + static final Seq tempTileEnts = new Seq<>(); + static final Seq tempTiles = new Seq<>(); static int sleepingEntities = 0; @Import float x, y, health; @@ -50,7 +50,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree transient Tile tile; transient Block block; - transient Array proximity = new Array<>(8); + transient Seq proximity = new Seq<>(8); transient boolean updateFlow; PowerModule power; @@ -548,7 +548,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree * containers, it gets added to the block's inventory. */ public void offload(Item item){ - Array proximity = proximity(); + Seq proximity = proximity(); int dump = tile.data; useContent(item); @@ -568,7 +568,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree * Tries to put this item into a nearby container. Returns success. Unlike #offload(), this method does not change the block inventory. */ public boolean put(Item item){ - Array proximity = proximity(); + Seq proximity = proximity(); int dump = tile.data; useContent(item); @@ -596,7 +596,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree public boolean dump(Item todump){ if(!block.hasItems || items.total() == 0 || (todump != null && !items.has(todump))) return false; - Array proximity = proximity(); + Seq proximity = proximity(); int dump = tile.data; if(proximity.size == 0) return false; @@ -683,7 +683,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree } } - public Array getPowerConnections(Array out){ + public Seq getPowerConnections(Seq out){ out.clear(); if(power == null) return out; @@ -995,7 +995,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree /** Returns whether or not a hand cursor should be shown over this block. */ public Cursor getCursor(){ - return block.configurable && tile.team() == player.team() ? SystemCursor.hand : SystemCursor.arrow; + return block.configurable ? SystemCursor.hand : SystemCursor.arrow; } /** diff --git a/core/src/mindustry/game/DefaultWaves.java b/core/src/mindustry/game/DefaultWaves.java index 82fddd3a62..1f9bf7b2ce 100644 --- a/core/src/mindustry/game/DefaultWaves.java +++ b/core/src/mindustry/game/DefaultWaves.java @@ -1,15 +1,15 @@ package mindustry.game; -import arc.struct.Array; +import arc.struct.Seq; import mindustry.content.*; import mindustry.type.ItemStack; public class DefaultWaves{ - private Array spawns; + private Seq spawns; - public Array get(){ + public Seq get(){ if(spawns == null && UnitTypes.dagger != null){ - spawns = Array.with( + spawns = Seq.with( new SpawnGroup(UnitTypes.dagger){{ end = 10; unitScaling = 2f; @@ -186,6 +186,6 @@ public class DefaultWaves{ }} ); } - return spawns == null ? new Array<>() : spawns; + return spawns == null ? new Seq<>() : spawns; } } diff --git a/core/src/mindustry/game/GlobalData.java b/core/src/mindustry/game/GlobalData.java index a10e91486b..eec634226d 100644 --- a/core/src/mindustry/game/GlobalData.java +++ b/core/src/mindustry/game/GlobalData.java @@ -23,7 +23,7 @@ public class GlobalData{ private boolean modified; public void exportData(Fi file) throws IOException{ - Array files = new Array<>(); + Seq files = new Seq<>(); files.add(Core.settings.getSettingsFile()); files.addAll(customMapDirectory.list()); files.addAll(saveDirectory.list()); @@ -85,7 +85,7 @@ public class GlobalData{ modified = true; } - public boolean hasItems(Array stacks){ + public boolean hasItems(Seq stacks){ return !stacks.contains(s -> items.get(s.item, 0) < s.amount); } @@ -105,7 +105,7 @@ public class GlobalData{ } } - public void removeItems(Array stacks){ + public void removeItems(Seq stacks){ for(ItemStack stack : stacks){ remove(stack.item, stack.amount); } diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index a4f2921eb3..a26c6307d0 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -57,7 +57,7 @@ public class Rules{ /** Sector for saves that have them.*/ public @Nullable Sector sector; /** Spawn layout. */ - public Array spawns = new Array<>(); + public Seq spawns = new Seq<>(); /** Whether to pause the wave timer until all enemies are destroyed. */ public boolean waitEnemies = false; /** Determinates if gamemode is attack mode */ @@ -74,9 +74,9 @@ public class Rules{ /** EXPERIMENTAL building AI. TODO remove */ public boolean buildAI = true; /** Starting items put in cores */ - public Array loadout = Array.with(ItemStack.with(Items.copper, 100)); + public Seq loadout = Seq.with(ItemStack.with(Items.copper, 100)); /** Weather events that occur here. */ - public Array weather = new Array<>(1); + public Seq weather = new Seq<>(1); /** Blocks that cannot be placed. */ public ObjectSet bannedBlocks = new ObjectSet<>(); /** Whether everything is dark. Enables lights. Experimental. */ diff --git a/core/src/mindustry/game/Saves.java b/core/src/mindustry/game/Saves.java index 8c521c534f..c54107b646 100644 --- a/core/src/mindustry/game/Saves.java +++ b/core/src/mindustry/game/Saves.java @@ -23,7 +23,7 @@ import java.util.*; import static mindustry.Vars.*; public class Saves{ - private Array saves = new Array<>(); + private Seq saves = new Seq<>(); private @Nullable SaveSlot current; private @Nullable SaveSlot lastSectorSave; private AsyncExecutor previewExecutor = new AsyncExecutor(1); @@ -160,7 +160,7 @@ public class Saves{ return file; } - public Array getSaveSlots(){ + public Seq getSaveSlots(){ return saves; } @@ -259,7 +259,7 @@ public class Saves{ } public void cautiousLoad(Runnable run){ - Array mods = Array.with(getMods()); + Seq mods = Seq.with(getMods()); mods.removeAll(Vars.mods.getModStrings()); if(!mods.isEmpty()){ diff --git a/core/src/mindustry/game/Schematic.java b/core/src/mindustry/game/Schematic.java index f573c8d029..7c33b2726b 100644 --- a/core/src/mindustry/game/Schematic.java +++ b/core/src/mindustry/game/Schematic.java @@ -14,21 +14,21 @@ import mindustry.world.blocks.storage.*; import static mindustry.Vars.*; public class Schematic implements Publishable, Comparable{ - public final Array tiles; + public final Seq tiles; public StringMap tags; public int width, height; public @Nullable Fi file; /** Associated mod. If null, no mod is associated with this schematic. */ public @Nullable LoadedMod mod; - public Schematic(Array tiles, @NonNull StringMap tags, int width, int height){ + public Schematic(Seq tiles, @NonNull StringMap tags, int width, int height){ this.tiles = tiles; this.tags = tags; this.width = width; this.height = height; } - public Array requirements(){ + public Seq requirements(){ IntIntMap amounts = new IntIntMap(); tiles.each(t -> { @@ -36,7 +36,7 @@ public class Schematic implements Publishable, Comparable{ amounts.getAndIncrement(stack.item.id, 0, stack.amount); } }); - Array stacks = new Array<>(); + Seq stacks = new Seq<>(); for(Entry ent : amounts.entries()){ stacks.add(new ItemStack(Vars.content.item(ent.key), ent.value)); } diff --git a/core/src/mindustry/game/Schematics.java b/core/src/mindustry/game/Schematics.java index 4d74a13dae..5e087a4aba 100644 --- a/core/src/mindustry/game/Schematics.java +++ b/core/src/mindustry/game/Schematics.java @@ -40,8 +40,8 @@ import static mindustry.Vars.*; /** Handles schematics.*/ public class Schematics implements Loadable{ - private static final Schematic tmpSchem = new Schematic(new Array<>(), new StringMap(), 0, 0); - private static final Schematic tmpSchem2 = new Schematic(new Array<>(), new StringMap(), 0, 0); + private static final Schematic tmpSchem = new Schematic(new Seq<>(), new StringMap(), 0, 0); + private static final Schematic tmpSchem2 = new Schematic(new Seq<>(), new StringMap(), 0, 0); public static final String base64Header = "bXNjaAB"; private static final byte[] header = {'m', 's', 'c', 'h'}; @@ -52,7 +52,7 @@ public class Schematics implements Loadable{ private static final int resolution = 32; private OptimizedByteArrayOutputStream out = new OptimizedByteArrayOutputStream(1024); - private Array all = new Array<>(); + private Seq all = new Seq<>(); private OrderedMap previews = new OrderedMap<>(); private ObjectSet errored = new ObjectSet<>(); private FrameBuffer shadowBuffer; @@ -155,7 +155,7 @@ public class Schematics implements Loadable{ return null; } - public Array all(){ + public Seq all(){ return all; } @@ -199,7 +199,7 @@ public class Schematics implements Loadable{ //dispose unneeded previews to prevent memory outage errors. //only runs every 2 seconds if(mobile && Time.timeSinceMillis(lastClearTime) > 1000 * 2 && previews.size > maxPreviewsMobile){ - Array keys = previews.orderedKeys().copy(); + Seq keys = previews.orderedKeys().copy(); for(int i = 0; i < previews.size - maxPreviewsMobile; i++){ //dispose and remove unneeded previews previews.get(keys.get(i)).dispose(); @@ -246,7 +246,7 @@ public class Schematics implements Loadable{ Draw.rect(Tmp.tr1, buffer.getWidth()/2f, buffer.getHeight()/2f, buffer.getWidth(), -buffer.getHeight()); Draw.color(); - Array requests = schematic.tiles.map(t -> new BuildRequest(t.x, t.y, t.rotation, t.block).configure(t.config)); + Seq requests = schematic.tiles.map(t -> new BuildRequest(t.x, t.y, t.rotation, t.block).configure(t.config)); Draw.flush(); //scale each request to fit schematic @@ -276,7 +276,7 @@ public class Schematics implements Loadable{ } /** Creates an array of build requests from a schematic's data, centered on the provided x+y coordinates. */ - public Array toRequests(Schematic schem, int x, int y){ + public Seq toRequests(Schematic schem, int x, int y){ return schem.tiles.map(t -> new BuildRequest(t.x + x - schem.width/2, t.y + y - schem.height/2, t.rotation, t.block).original(t.x, t.y, schem.width, schem.height).configure(t.config)) .removeAll(s -> !s.block.isVisible() || !s.block.unlockedCur()); } @@ -318,7 +318,7 @@ public class Schematics implements Loadable{ int ox = x, oy = y, ox2 = x2, oy2 = y2; - Array tiles = new Array<>(); + Seq tiles = new Seq<>(); int minx = x2, miny = y2, maxx = x, maxy = y; boolean found = false; @@ -344,7 +344,7 @@ public class Schematics implements Loadable{ x2 = maxx; y2 = maxy; }else{ - return new Schematic(new Array<>(), new StringMap(), 1, 1); + return new Schematic(new Seq<>(), new StringMap(), 1, 1); } int width = x2 - x + 1, height = y2 - y + 1; @@ -466,7 +466,7 @@ public class Schematics implements Loadable{ } int total = stream.readInt(); - Array tiles = new Array<>(total); + Seq tiles = new Seq<>(total); for(int i = 0; i < total; i++){ Block block = blocks.get(stream.readByte()); int position = stream.readInt(); diff --git a/core/src/mindustry/game/Stats.java b/core/src/mindustry/game/Stats.java index 01744a7537..931baa4dcd 100644 --- a/core/src/mindustry/game/Stats.java +++ b/core/src/mindustry/game/Stats.java @@ -39,7 +39,7 @@ public class Stats{ //weigh used fractions float frac = 0f; - Array obtainable = Array.select(zone.data.resources, i -> i instanceof Item && ((Item)i).type == ItemType.material).as(); + Seq obtainable = Seq.select(zone.data.resources, i -> i instanceof Item && ((Item)i).type == ItemType.material).as(); for(Item item : obtainable){ frac += Mathf.clamp((float)itemsDelivered.get(item, 0) / capacity) / (float)obtainable.size; } diff --git a/core/src/mindustry/game/Team.java b/core/src/mindustry/game/Team.java index f49fea7494..c2948d875e 100644 --- a/core/src/mindustry/game/Team.java +++ b/core/src/mindustry/game/Team.java @@ -55,7 +55,7 @@ public class Team implements Comparable{ all[us] = this; } - public Array enemies(){ + public Seq enemies(){ return state.teams.enemiesOf(this); } @@ -75,7 +75,7 @@ public class Team implements Comparable{ return state.teams.areEnemies(this, other); } - public Array cores(){ + public Seq cores(){ return state.teams.cores(this); } diff --git a/core/src/mindustry/game/Teams.java b/core/src/mindustry/game/Teams.java index 60a534d9a8..e14d37548c 100644 --- a/core/src/mindustry/game/Teams.java +++ b/core/src/mindustry/game/Teams.java @@ -16,7 +16,7 @@ public class Teams{ /** Maps team IDs to team data. */ private TeamData[] map = new TeamData[256]; /** Active teams. */ - private Array active = new Array<>(); + private Seq active = new Seq<>(); public Teams(){ active.add(get(Team.crux)); @@ -38,7 +38,7 @@ public class Teams{ return Geometry.findClosest(x, y, get(team).cores); } - public Array enemiesOf(Team team){ + public Seq enemiesOf(Team team){ return get(team).enemies; } @@ -73,12 +73,12 @@ public class Teams{ return map[Pack.u(team.id)]; } - public Array playerCores(){ + public Seq playerCores(){ return get(state.rules.defaultTeam).cores; } /** Do not modify! */ - public Array cores(Team team){ + public Seq cores(Team team){ return get(team).cores; } @@ -98,7 +98,7 @@ public class Teams{ } /** Do not modify. */ - public Array getActive(){ + public Seq getActive(){ active.removeAll(t -> !t.active()); return active; } @@ -145,8 +145,8 @@ public class Teams{ } public class TeamData{ - public final Array cores = new Array<>(); - public final Array enemies = new Array<>(); + public final Seq cores = new Seq<>(); + public final Seq enemies = new Seq<>(); public final Team team; public final BaseAI ai; public Queue blocks = new Queue<>(); diff --git a/core/src/mindustry/game/Tutorial.java b/core/src/mindustry/game/Tutorial.java index d89c48323a..d9f91623da 100644 --- a/core/src/mindustry/game/Tutorial.java +++ b/core/src/mindustry/game/Tutorial.java @@ -195,7 +195,7 @@ public class Tutorial{ protected String line = ""; protected final Func text; - protected Array sentences; + protected Seq sentences; protected final Boolp done; TutorialStage(Func text, Boolp done){ @@ -218,7 +218,7 @@ public class Tutorial{ void load(){ this.line = Core.bundle.has("tutorial." + name() + ".mobile") && mobile ? "tutorial." + name() + ".mobile" : "tutorial." + name(); - this.sentences = Array.select(Core.bundle.get(line).split("\n"), s -> !s.isEmpty()); + this.sentences = Seq.select(Core.bundle.get(line).split("\n"), s -> !s.isEmpty()); } /** called every frame when this stage is active.*/ diff --git a/core/src/mindustry/graphics/BlockRenderer.java b/core/src/mindustry/graphics/BlockRenderer.java index 1a91d796fe..382589eafd 100644 --- a/core/src/mindustry/graphics/BlockRenderer.java +++ b/core/src/mindustry/graphics/BlockRenderer.java @@ -26,14 +26,14 @@ public class BlockRenderer implements Disposable{ public final FloorRenderer floor = new FloorRenderer(); - private Array requests = new Array<>(false, initialRequests, Tile.class); + private Seq requests = new Seq<>(false, initialRequests, Tile.class); private int lastCamX, lastCamY, lastRangeX, lastRangeY; private float brokenFade = 0f; private FrameBuffer shadows = new FrameBuffer(); private FrameBuffer fog = new FrameBuffer(); - private Array outArray2 = new Array<>(); - private Array shadowEvents = new Array<>(); + private Seq outArray2 = new Seq<>(); + private Seq shadowEvents = new Seq<>(); private boolean displayStatus = false; public BlockRenderer(){ diff --git a/core/src/mindustry/graphics/FloorRenderer.java b/core/src/mindustry/graphics/FloorRenderer.java index 4dcf17add2..fe83e9bbcb 100644 --- a/core/src/mindustry/graphics/FloorRenderer.java +++ b/core/src/mindustry/graphics/FloorRenderer.java @@ -24,7 +24,7 @@ public class FloorRenderer implements Disposable{ private MultiCacheBatch cbatch; private IntSet drawnLayerSet = new IntSet(); private IntSet recacheSet = new IntSet(); - private IntArray drawnLayers = new IntArray(); + private IntSeq drawnLayers = new IntSeq(); private ObjectSet used = new ObjectSet<>(); public FloorRenderer(){ diff --git a/core/src/mindustry/graphics/LightRenderer.java b/core/src/mindustry/graphics/LightRenderer.java index f36f3d35a4..a6c0c1c785 100644 --- a/core/src/mindustry/graphics/LightRenderer.java +++ b/core/src/mindustry/graphics/LightRenderer.java @@ -18,7 +18,7 @@ public class LightRenderer{ private float[] vertices = new float[24]; private FrameBuffer buffer = new FrameBuffer(); - private Array lights = new Array<>(); + private Seq lights = new Seq<>(); public void add(Runnable run){ if(!enabled()) return; diff --git a/core/src/mindustry/graphics/LoadRenderer.java b/core/src/mindustry/graphics/LoadRenderer.java index 8dc51f2715..b5cec075be 100644 --- a/core/src/mindustry/graphics/LoadRenderer.java +++ b/core/src/mindustry/graphics/LoadRenderer.java @@ -26,7 +26,7 @@ public class LoadRenderer implements Disposable{ private static final Color colorRed = Pal.breakInvalid.cpy().lerp(Color.black, 0.3f); private static final String red = "[#" + colorRed + "]"; private static final String orange = "[#" + color + "]"; - private static final FloatArray floats = new FloatArray(); + private static final FloatSeq floats = new FloatSeq(); private static final boolean preview = false; private float testprogress = 0f; diff --git a/core/src/mindustry/graphics/MenuRenderer.java b/core/src/mindustry/graphics/MenuRenderer.java index 32af36e457..e8f8857591 100644 --- a/core/src/mindustry/graphics/MenuRenderer.java +++ b/core/src/mindustry/graphics/MenuRenderer.java @@ -42,7 +42,7 @@ public class MenuRenderer implements Disposable{ private void generate(){ world.beginMapLoad(); Tiles tiles = world.resize(width, height); - Array ores = content.blocks().select(b -> b instanceof OreBlock); + Seq ores = content.blocks().select(b -> b instanceof OreBlock); shadows = new FrameBuffer(width, height); int offset = Mathf.random(100000); Simplex s1 = new Simplex(offset); diff --git a/core/src/mindustry/graphics/MinimapRenderer.java b/core/src/mindustry/graphics/MinimapRenderer.java index a7b85b330a..35783237c6 100644 --- a/core/src/mindustry/graphics/MinimapRenderer.java +++ b/core/src/mindustry/graphics/MinimapRenderer.java @@ -22,7 +22,7 @@ import static mindustry.Vars.*; public class MinimapRenderer implements Disposable{ private static final float baseSize = 16f; - private final Array units = new Array<>(); + private final Seq units = new Seq<>(); private Pixmap pixmap; private Texture texture; private TextureRegion region; diff --git a/core/src/mindustry/graphics/Trail.java b/core/src/mindustry/graphics/Trail.java index 69dcf6fd98..5093194020 100644 --- a/core/src/mindustry/graphics/Trail.java +++ b/core/src/mindustry/graphics/Trail.java @@ -9,7 +9,7 @@ import arc.util.pooling.*; public class Trail{ private static final int length = 20; - private Array points = new Array<>(); + private Seq points = new Seq<>(); private float lastX = -1, lastY = -1; public void draw(Color color, float width){ diff --git a/core/src/mindustry/graphics/g3d/PlanetRenderer.java b/core/src/mindustry/graphics/g3d/PlanetRenderer.java index e148254139..214b8be191 100644 --- a/core/src/mindustry/graphics/g3d/PlanetRenderer.java +++ b/core/src/mindustry/graphics/g3d/PlanetRenderer.java @@ -22,7 +22,7 @@ public class PlanetRenderer implements Disposable{ borderColor = Pal.accent.cpy().a(0.3f), shadowColor = new Color(0, 0, 0, 0.7f); - private static final Array points = new Array<>(); + private static final Seq points = new Seq<>(); private static final PlanetInterfaceRenderer emptyRenderer = new PlanetInterfaceRenderer(){ @Override public void renderSectors(Planet planet){} @Override public void renderProjections(){} diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 3608e399c1..9445eb0465 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -47,7 +47,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ final static int maxLength = 100; final static Vec2 stackTrns = new Vec2(); final static Rect r1 = new Rect(), r2 = new Rect(); - final static Array units = new Array<>(); + final static Seq units = new Seq<>(); /** Distance on the back from where items originate. */ final static float backTrns = 3f; @@ -66,8 +66,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ protected PlaceLine line = new PlaceLine(); protected BuildRequest resultreq; protected BuildRequest brequest = new BuildRequest(); - protected Array lineRequests = new Array<>(); - protected Array selectRequests = new Array<>(); + protected Seq lineRequests = new Seq<>(); + protected Seq selectRequests = new Seq<>(); //methods to override @@ -362,7 +362,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ }); } - public void rotateRequests(Array requests, int direction){ + public void rotateRequests(Seq requests, int direction){ int ox = schemOriginX(), oy = schemOriginY(); requests.each(req -> { @@ -396,7 +396,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ }); } - public void flipRequests(Array requests, boolean x){ + public void flipRequests(Seq requests, boolean x){ int origin = (x ? schemOriginX() : schemOriginY()) * tilesize; requests.each(req -> { @@ -533,7 +533,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y); } - protected void flushSelectRequests(Array requests){ + protected void flushSelectRequests(Seq requests){ for(BuildRequest req : requests){ if(req.block != null && validPlace(req.x, req.y, req.block, req.rotation)){ BuildRequest other = getRequest(req.x, req.y, req.block.size, null); @@ -547,7 +547,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } } - protected void flushRequests(Array requests){ + protected void flushRequests(Seq requests){ for(BuildRequest req : requests){ if(req.block != null && validPlace(req.x, req.y, req.block, req.rotation)){ BuildRequest copy = req.copy(); @@ -953,7 +953,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } void iterateLine(int startX, int startY, int endX, int endY, Cons cons){ - Array points; + Seq points; boolean diagonal = Core.input.keyDown(Binding.diagonal_placement); if(Core.settings.getBool("swapdiagonal") && mobile){ @@ -971,7 +971,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } if(block instanceof PowerNode){ - Array skip = new Array<>(); + Seq skip = new Seq<>(); for(int i = 1; i < points.size; i++){ int overlaps = 0; diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 16f7261a24..57d4946ef9 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -48,7 +48,7 @@ public class MobileInput extends InputHandler implements GestureListener{ private float shiftDeltaX, shiftDeltaY; /** Place requests to be removed. */ - private Array removals = new Array<>(); + private Seq removals = new Seq<>(); /** Whether or not the player is currently shifting all placed tiles. */ private boolean selecting; /** Whether the player is currently in line-place mode. */ diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index 6c2264d0fe..1d06fbd907 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -13,7 +13,7 @@ public class Placement{ private static final NormalizeResult result = new NormalizeResult(); private static final NormalizeDrawResult drawResult = new NormalizeDrawResult(); private static Bresenham2 bres = new Bresenham2(); - private static Array points = new Array<>(); + private static Seq points = new Seq<>(); //for pathfinding private static IntFloatMap costs = new IntFloatMap(); @@ -21,7 +21,7 @@ public class Placement{ private static IntSet closed = new IntSet(); /** Normalize a diagonal line into points. */ - public static Array pathfindLine(boolean conveyors, int startX, int startY, int endX, int endY){ + public static Seq pathfindLine(boolean conveyors, int startX, int startY, int endX, int endY){ Pools.freeAll(points); points.clear(); @@ -37,7 +37,7 @@ public class Placement{ } /** Normalize two points into one straight line, no diagonals. */ - public static Array normalizeLine(int startX, int startY, int endX, int endY){ + public static Seq normalizeLine(int startX, int startY, int endX, int endY){ Pools.freeAll(points); points.clear(); if(Math.abs(startX - endX) > Math.abs(startY - endY)){ diff --git a/core/src/mindustry/io/SaveIO.java b/core/src/mindustry/io/SaveIO.java index d6ff052f12..3ae3996d23 100644 --- a/core/src/mindustry/io/SaveIO.java +++ b/core/src/mindustry/io/SaveIO.java @@ -20,7 +20,7 @@ public class SaveIO{ /** Format header. This is the string 'MSAV' in ASCII. */ public static final byte[] header = {77, 83, 65, 86}; public static final IntMap versions = new IntMap<>(); - public static final Array versionArray = Array.with(new Save1(), new Save2(), new Save3(), new Save4()); + public static final Seq versionArray = Seq.with(new Save1(), new Save2(), new Save3(), new Save4()); static{ for(SaveVersion version : versionArray){ diff --git a/core/src/mindustry/io/SaveVersion.java b/core/src/mindustry/io/SaveVersion.java index 6e17150ca7..27c7397be6 100644 --- a/core/src/mindustry/io/SaveVersion.java +++ b/core/src/mindustry/io/SaveVersion.java @@ -270,7 +270,7 @@ public abstract class SaveVersion extends SaveFileReader{ public void writeEntities(DataOutput stream) throws IOException{ //write team data with entities. - Array data = state.teams.getActive(); + Seq data = state.teams.getActive(); stream.writeInt(data.size); for(TeamData team : data){ stream.writeInt(team.team.id); @@ -337,17 +337,17 @@ public abstract class SaveVersion extends SaveFileReader{ } public void writeContentHeader(DataOutput stream) throws IOException{ - Array[] map = content.getContentMap(); + Seq[] map = content.getContentMap(); int mappable = 0; - for(Array arr : map){ + for(Seq arr : map){ if(arr.size > 0 && arr.first() instanceof MappableContent){ mappable++; } } stream.writeByte(mappable); - for(Array arr : map){ + for(Seq arr : map){ if(arr.size > 0 && arr.first() instanceof MappableContent){ stream.writeByte(arr.first().getContentType().ordinal()); stream.writeShort(arr.size); diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.java index e5c4103091..bc5b4b877f 100644 --- a/core/src/mindustry/io/TypeIO.java +++ b/core/src/mindustry/io/TypeIO.java @@ -50,9 +50,9 @@ public class TypeIO{ write.b((byte)5); write.b((byte)map.getContentType().ordinal()); write.s(map.id); - }else if(object instanceof IntArray){ + }else if(object instanceof IntSeq){ write.b((byte)6); - IntArray arr = (IntArray)object; + IntSeq arr = (IntSeq)object; write.s((short)arr.size); for(int i = 0; i < arr.size; i++){ write.i(arr.items[i]); @@ -81,7 +81,7 @@ public class TypeIO{ case 3: return read.f(); case 4: return readString(read); case 5: return content.getByID(ContentType.all[read.b()], read.s()); - case 6: short length = read.s(); IntArray arr = new IntArray(); for(int i = 0; i < length; i ++) arr.add(read.i()); return arr; + case 6: short length = read.s(); IntSeq arr = new IntSeq(); for(int i = 0; i < length; i ++) arr.add(read.i()); return arr; case 7: return new Point2(read.i(), read.i()); case 8: byte len = read.b(); Point2[] out = new Point2[len]; for(int i = 0; i < len; i ++) out[i] = Point2.unpack(read.i()); return out; default: throw new IllegalArgumentException("Unknown object type: " + type); diff --git a/core/src/mindustry/io/legacy/LegacyIO.java b/core/src/mindustry/io/legacy/LegacyIO.java index cfec4b20b5..621533b418 100644 --- a/core/src/mindustry/io/legacy/LegacyIO.java +++ b/core/src/mindustry/io/legacy/LegacyIO.java @@ -8,8 +8,8 @@ import java.io.*; public class LegacyIO{ - public static Array readServers(){ - Array arr = new Array<>(); + public static Seq readServers(){ + Seq arr = new Seq<>(); try{ byte[] bytes = Core.settings.getBytes("server-list"); diff --git a/core/src/mindustry/maps/Map.java b/core/src/mindustry/maps/Map.java index 296180680b..f23f6d6c0b 100644 --- a/core/src/mindustry/maps/Map.java +++ b/core/src/mindustry/maps/Map.java @@ -111,9 +111,9 @@ public class Map implements Comparable, Publishable{ } /** Returns the generation filters that this map uses on load.*/ - public Array filters(){ + public Seq filters(){ if(tags.getInt("build", -1) < 83 && tags.getInt("build", -1) != -1 && tags.get("genfilters", "").isEmpty()){ - return Array.with(); + return Seq.with(); } return maps.readFilters(tags.get("genfilters", "")); } @@ -196,9 +196,9 @@ public class Map implements Comparable, Publishable{ } @Override - public Array extraTags(){ + public Seq extraTags(){ Gamemode mode = Gamemode.attack.valid(this) ? Gamemode.attack : Gamemode.survival; - return Array.with(mode.name()); + return Seq.with(mode.name()); } @Override diff --git a/core/src/mindustry/maps/MapPreviewLoader.java b/core/src/mindustry/maps/MapPreviewLoader.java index 3572846ea7..ebc69eeae4 100644 --- a/core/src/mindustry/maps/MapPreviewLoader.java +++ b/core/src/mindustry/maps/MapPreviewLoader.java @@ -43,8 +43,8 @@ public class MapPreviewLoader extends TextureLoader{ } @Override - public Array getDependencies(String fileName, Fi file, TextureParameter parameter){ - return Array.with(new AssetDescriptor<>("contentcreate", Content.class)); + public Seq getDependencies(String fileName, Fi file, TextureParameter parameter){ + return Seq.with(new AssetDescriptor<>("contentcreate", Content.class)); } public static class MapPreviewParameter extends TextureParameter{ diff --git a/core/src/mindustry/maps/Maps.java b/core/src/mindustry/maps/Maps.java index 183f4158b8..46d79c5db2 100644 --- a/core/src/mindustry/maps/Maps.java +++ b/core/src/mindustry/maps/Maps.java @@ -32,7 +32,7 @@ public class Maps{ /** List of all built-in maps. Filenames only. */ private static String[] defaultMapNames = {"maze", "fortress", "labyrinth", "islands", "tendrils", "caldera", "wasteland", "shattered", "fork", "triad", "veins", "glacier"}; /** All maps stored in an ordered array. */ - private Array maps = new Array<>(); + private Seq maps = new Seq<>(); /** Serializer for meta. */ private Json json = new Json(); @@ -61,17 +61,17 @@ public class Maps{ } /** Returns a list of all maps, including custom ones. */ - public Array all(){ + public Seq all(){ return maps; } /** Returns a list of only custom maps. */ - public Array customMaps(){ + public Seq customMaps(){ return maps.select(m -> m.custom); } /** Returns a list of only default maps. */ - public Array defaultMaps(){ + public Seq defaultMaps(){ return maps.select(m -> !m.custom); } @@ -298,10 +298,10 @@ public class Maps{ /** Reads JSON of filters, returning a new default array if not found.*/ @SuppressWarnings("unchecked") - public Array readFilters(String str){ + public Seq readFilters(String str){ if(str == null || str.isEmpty()){ //create default filters list - Array filters = Array.with( + Seq filters = Seq.with( new ScatterFilter(){{ flooronto = Blocks.stone; block = Blocks.rock; @@ -329,7 +329,7 @@ public class Maps{ return filters; }else{ try{ - return JsonIO.read(Array.class, str); + return JsonIO.read(Seq.class, str); }catch(Throwable e){ e.printStackTrace(); return readFilters(""); @@ -337,8 +337,8 @@ public class Maps{ } } - public void addDefaultOres(Array filters){ - Array ores = content.blocks().select(b -> b.isOverlay() && b.asFloor().oreDefault); + public void addDefaultOres(Seq filters){ + Seq ores = content.blocks().select(b -> b.isOverlay() && b.asFloor().oreDefault); for(Block block : ores){ OreFilter filter = new OreFilter(); filter.threshold = block.asFloor().oreThreshold; @@ -348,7 +348,7 @@ public class Maps{ } } - public String writeWaves(Array groups){ + public String writeWaves(Seq groups){ if(groups == null) return "[]"; StringWriter buffer = new StringWriter(); @@ -364,8 +364,8 @@ public class Maps{ return buffer.toString(); } - public Array readWaves(String str){ - return str == null ? null : str.equals("[]") ? new Array<>() : Array.with(json.fromJson(SpawnGroup[].class, str)); + public Seq readWaves(String str){ + return str == null ? null : str.equals("[]") ? new Seq<>() : Seq.with(json.fromJson(SpawnGroup[].class, str)); } public void loadPreviews(){ @@ -473,17 +473,17 @@ public class Maps{ public enum ShuffleMode implements MapProvider{ none(map -> null), all(prev -> { - Array maps = Array.withArrays(Vars.maps.defaultMaps(), Vars.maps.customMaps()); + Seq maps = Seq.withArrays(Vars.maps.defaultMaps(), Vars.maps.customMaps()); maps.shuffle(); return maps.find(m -> m != prev || maps.size == 1); }), custom(prev -> { - Array maps = Array.withArrays(Vars.maps.customMaps().isEmpty() ? Vars.maps.defaultMaps() : Vars.maps.customMaps()); + Seq maps = Seq.withArrays(Vars.maps.customMaps().isEmpty() ? Vars.maps.defaultMaps() : Vars.maps.customMaps()); maps.shuffle(); return maps.find(m -> m != prev || maps.size == 1); }), builtin(prev -> { - Array maps = Array.withArrays(Vars.maps.defaultMaps()); + Seq maps = Seq.withArrays(Vars.maps.defaultMaps()); maps.shuffle(); return maps.find(m -> m != prev || maps.size == 1); }); diff --git a/core/src/mindustry/maps/filters/CoreSpawnFilter.java b/core/src/mindustry/maps/filters/CoreSpawnFilter.java index b418c3d56a..fa3b270d4d 100644 --- a/core/src/mindustry/maps/filters/CoreSpawnFilter.java +++ b/core/src/mindustry/maps/filters/CoreSpawnFilter.java @@ -21,7 +21,7 @@ public class CoreSpawnFilter extends GenerateFilter{ @Override public void apply(Tiles tiles, GenerateInput in){ - IntArray spawns = new IntArray(); + IntSeq spawns = new IntSeq(); for(Tile tile : tiles){ if(tile.team() == state.rules.defaultTeam && tile.block() instanceof CoreBlock && tile.isCenter()){ spawns.add(tile.pos()); diff --git a/core/src/mindustry/maps/filters/EnemySpawnFilter.java b/core/src/mindustry/maps/filters/EnemySpawnFilter.java index 53f97e488c..ac64761632 100644 --- a/core/src/mindustry/maps/filters/EnemySpawnFilter.java +++ b/core/src/mindustry/maps/filters/EnemySpawnFilter.java @@ -19,7 +19,7 @@ public class EnemySpawnFilter extends GenerateFilter{ @Override public void apply(Tiles tiles, GenerateInput in){ - IntArray spawns = new IntArray(); + IntSeq spawns = new IntSeq(); for(Tile tile : tiles){ if(tile.overlay() == Blocks.spawn){ spawns.add(tile.pos()); diff --git a/core/src/mindustry/maps/filters/MedianFilter.java b/core/src/mindustry/maps/filters/MedianFilter.java index cf3fbc2b29..c70bf6d71b 100644 --- a/core/src/mindustry/maps/filters/MedianFilter.java +++ b/core/src/mindustry/maps/filters/MedianFilter.java @@ -11,7 +11,7 @@ import static mindustry.Vars.content; public class MedianFilter extends GenerateFilter{ float radius = 2; float percentile = 0.5f; - IntArray blocks = new IntArray(), floors = new IntArray(); + IntSeq blocks = new IntSeq(), floors = new IntSeq(); @Override public FilterOption[] options(){ diff --git a/core/src/mindustry/maps/filters/OreMedianFilter.java b/core/src/mindustry/maps/filters/OreMedianFilter.java index 519b642ab4..43c589d586 100644 --- a/core/src/mindustry/maps/filters/OreMedianFilter.java +++ b/core/src/mindustry/maps/filters/OreMedianFilter.java @@ -12,7 +12,7 @@ public class OreMedianFilter extends GenerateFilter{ public float radius = 2; public float percentile = 0.5f; - private IntArray blocks = new IntArray(); + private IntSeq blocks = new IntSeq(); @Override public FilterOption[] options(){ diff --git a/core/src/mindustry/maps/filters/RandomItemFilter.java b/core/src/mindustry/maps/filters/RandomItemFilter.java index dc20cd6ace..c7b2d7e419 100644 --- a/core/src/mindustry/maps/filters/RandomItemFilter.java +++ b/core/src/mindustry/maps/filters/RandomItemFilter.java @@ -7,7 +7,7 @@ import mindustry.world.*; import mindustry.world.blocks.storage.*; public class RandomItemFilter extends GenerateFilter{ - public Array drops = new Array<>(); + public Seq drops = new Seq<>(); public float chance = 0.3f; @Override diff --git a/core/src/mindustry/maps/generators/BaseGenerator.java b/core/src/mindustry/maps/generators/BaseGenerator.java index 98d68b26d4..80e87f0108 100644 --- a/core/src/mindustry/maps/generators/BaseGenerator.java +++ b/core/src/mindustry/maps/generators/BaseGenerator.java @@ -26,9 +26,9 @@ public class BaseGenerator{ private Tiles tiles; private Team team; private ObjectMap ores = new ObjectMap<>(); - private Array cores; + private Seq cores; - public void generate(Tiles tiles, Array cores, Tile spawn, Team team, Sector sector){ + public void generate(Tiles tiles, Seq cores, Tile spawn, Team team, Sector sector){ this.tiles = tiles; this.team = team; this.cores = cores; @@ -42,8 +42,8 @@ public class BaseGenerator{ float costBudget = 1000; - Array wallsSmall = content.blocks().select(b -> b instanceof Wall && b.size == 1); - Array wallsLarge = content.blocks().select(b -> b instanceof Wall && b.size == 2); + Seq wallsSmall = content.blocks().select(b -> b instanceof Wall && b.size == 1); + Seq wallsLarge = content.blocks().select(b -> b instanceof Wall && b.size == 2); float bracket = 0.1f; int wallAngle = 70; //180 for full coverage @@ -69,7 +69,7 @@ public class BaseGenerator{ if(!tile.block().alwaysReplace) return; if((tile.drop() != null || (tile.floor().liquidDrop != null && Mathf.chance(nonResourceChance * 2))) && Mathf.chance(resourceChance)){ - Array parts = bases.forResource(tile.drop() != null ? tile.drop() : tile.floor().liquidDrop); + Seq parts = bases.forResource(tile.drop() != null ? tile.drop() : tile.floor().liquidDrop); if(!parts.isEmpty()){ tryPlace(parts.random(), tile.x, tile.y); } diff --git a/core/src/mindustry/maps/generators/BasicGenerator.java b/core/src/mindustry/maps/generators/BasicGenerator.java index 5035662d28..ac5323fa16 100644 --- a/core/src/mindustry/maps/generators/BasicGenerator.java +++ b/core/src/mindustry/maps/generators/BasicGenerator.java @@ -14,7 +14,7 @@ import mindustry.world.*; import static mindustry.Vars.*; public abstract class BasicGenerator implements WorldGenerator{ - protected static final ShortArray ints1 = new ShortArray(), ints2 = new ShortArray(); + protected static final ShortSeq ints1 = new ShortSeq(), ints2 = new ShortSeq(); protected Rand rand = new Rand(); @@ -124,7 +124,7 @@ public abstract class BasicGenerator implements WorldGenerator{ }); } - public void ores(Array ores){ + public void ores(Seq ores){ pass((x, y) -> { if(floor.asFloor().isLiquid) return; @@ -297,7 +297,7 @@ public abstract class BasicGenerator implements WorldGenerator{ } } - public void brush(Array path, int rad){ + public void brush(Seq path, int rad){ path.each(tile -> erase(tile.x, tile.y, rad)); } @@ -313,7 +313,7 @@ public abstract class BasicGenerator implements WorldGenerator{ } } - public Array pathfind(int startX, int startY, int endX, int endY, TileHueristic th, DistanceHeuristic dh){ + public Seq pathfind(int startX, int startY, int endX, int endY, TileHueristic th, DistanceHeuristic dh){ return Astar.pathfind(startX, startY, endX, endY, th, dh, tile -> world.getDarkness(tile.x, tile.y) <= 1f); } @@ -331,7 +331,7 @@ public abstract class BasicGenerator implements WorldGenerator{ } public void inverseFloodFill(Tile start){ - IntArray arr = new IntArray(); + IntSeq arr = new IntSeq(); arr.add(start.pos()); while(!arr.isEmpty()){ int i = arr.pop(); diff --git a/core/src/mindustry/maps/planet/TODOPlanetGenerator.java b/core/src/mindustry/maps/planet/TODOPlanetGenerator.java index dc838ea5a4..a3478e5e7a 100644 --- a/core/src/mindustry/maps/planet/TODOPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/TODOPlanetGenerator.java @@ -143,7 +143,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{ float constraint = 1.3f; float radius = width / 2f / Mathf.sqrt3; int rooms = rand.random(2, 5); - Array array = new Array<>(); + Seq array = new Seq<>(); for(int i = 0; i < rooms; i++){ Tmp.v1.trns(rand.random(360f), rand.random(radius / constraint)); @@ -156,7 +156,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{ //check positions on the map to place the player spawn. this needs to be in the corner of the map Room spawn = null; - Array enemies = new Array<>(); + Seq enemies = new Seq<>(); int enemySpawns = rand.chance(0.3) ? 2 : 1; int offset = rand.nextInt(360); float length = width/2.55f - rand.random(13, 23); @@ -212,7 +212,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{ inverseFloodFill(tiles.getn(spawn.x, spawn.y)); - Array ores = Array.with(Blocks.oreCopper, Blocks.oreLead); + Seq ores = Seq.with(Blocks.oreCopper, Blocks.oreLead); float poles = Math.abs(sector.tile.v.y); float nmag = 0.5f; float scl = 1f; @@ -230,7 +230,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{ ores.add(Blocks.oreThorium); } - FloatArray frequencies = new FloatArray(); + FloatSeq frequencies = new FloatSeq(); for(int i = 0; i < ores.size; i++){ frequencies.add(rand.random(-0.09f, 0.01f) - i * 0.01f); } diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 2d09b45353..6da2243884 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -7,7 +7,7 @@ import arc.files.*; import arc.func.*; import arc.graphics.*; import arc.mock.*; -import arc.struct.Array; +import arc.struct.Seq; import arc.struct.*; import arc.util.ArcAnnotate.*; import arc.util.*; @@ -102,8 +102,8 @@ public class ContentParser{ }}; /** Stores things that need to be parsed fully, e.g. reading fields of content. * This is done to accomodate binding of content names first.*/ - private Array reads = new Array<>(); - private Array postreads = new Array<>(); + private Seq reads = new Seq<>(); + private Seq postreads = new Seq<>(); private ObjectSet toBeParsed = new ObjectSet<>(); private LoadedMod currentMod; private Content currentContent; @@ -368,7 +368,7 @@ public class ContentParser{ private void init(){ for(ContentType type : ContentType.all){ - Array arr = Vars.content.getBy(type); + Seq arr = Vars.content.getBy(type); if(!arr.isEmpty()){ Class c = arr.first().getClass(); //get base content class, skipping intermediates @@ -459,7 +459,7 @@ public class ContentParser{ }else if(t instanceof NullPointerException){ builder.append(Strings.parseException(t, true)); }else{ - Array causes = Strings.getCauses(t); + Seq causes = Strings.getCauses(t); for(Throwable e : causes){ builder.append("[accent][[").append(e.getClass().getSimpleName().replace("Exception", "")) .append("][] ") diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 9961eb8f8c..7192c69bf4 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -33,13 +33,13 @@ public class Mods implements Loadable{ private Json json = new Json(); private @Nullable Scripts scripts; private ContentParser parser = new ContentParser(); - private ObjectMap> bundles = new ObjectMap<>(); + private ObjectMap> bundles = new ObjectMap<>(); private ObjectSet specialFolders = ObjectSet.with("bundles", "sprites", "sprites-override"); private int totalSprites; private MultiPacker packer; - private Array mods = new Array<>(); + private Seq mods = new Seq<>(); private ObjectMap, ModMeta> metas = new ObjectMap<>(); private boolean requiresReload, createdAtlas; @@ -103,8 +103,8 @@ public class Mods implements Loadable{ packer = new MultiPacker(); eachEnabled(mod -> { - Array sprites = mod.root.child("sprites").findAll(f -> f.extension().equals("png")); - Array overrides = mod.root.child("sprites-override").findAll(f -> f.extension().equals("png")); + Seq sprites = mod.root.child("sprites").findAll(f -> f.extension().equals("png")); + Seq overrides = mod.root.child("sprites-override").findAll(f -> f.extension().equals("png")); packSprites(sprites, mod, true); packSprites(overrides, mod, false); Log.debug("Packed @ images for mod '@'.", sprites.size + overrides.size, mod.meta.name); @@ -127,7 +127,7 @@ public class Mods implements Loadable{ } } - private void packSprites(Array sprites, LoadedMod mod, boolean prefix){ + private void packSprites(Seq sprites, LoadedMod mod, boolean prefix){ for(Fi file : sprites){ try(InputStream stream = file.read()){ byte[] bytes = Streams.copyBytes(stream, Math.max((int)file.length(), 512)); @@ -171,7 +171,7 @@ public class Mods implements Loadable{ packer.flush(filter, Core.atlas); //generate new icons - for(Array arr : content.getContentMap()){ + for(Seq arr : content.getContentMap()){ arr.each(c -> { if(c instanceof UnlockableContent && c.minfo.mod != null){ UnlockableContent u = (UnlockableContent)c; @@ -305,16 +305,16 @@ public class Mods implements Loadable{ } } - private void topoSort(LoadedMod mod, Array stack, ObjectSet visited){ + private void topoSort(LoadedMod mod, Seq stack, ObjectSet visited){ visited.add(mod); mod.dependencies.each(m -> !visited.contains(m), m -> topoSort(m, stack, visited)); stack.add(mod); } /** @return mods ordered in the correct way needed for dependencies. */ - private Array orderedMods(){ + private Seq orderedMods(){ ObjectSet visited = new ObjectSet<>(); - Array result = new Array<>(); + Seq result = new Seq<>(); eachEnabled(mod -> { if(!visited.contains(mod)){ topoSort(mod, result, visited); @@ -346,7 +346,7 @@ public class Mods implements Loadable{ for(Fi file : folder.list()){ if(file.name().startsWith("bundle") && file.extension().equals("properties")){ String name = file.nameWithoutExtension(); - bundles.get(name, Array::new).add(file); + bundles.get(name, Seq::new).add(file); } } } @@ -357,7 +357,7 @@ public class Mods implements Loadable{ while(bundle != null){ String str = bundle.getLocale().toString(); String locale = "bundle" + (str.isEmpty() ? "" : "_" + str); - for(Fi file : bundles.get(locale, Array::new)){ + for(Fi file : bundles.get(locale, Seq::new)){ try{ PropertiesUtils.load(bundle.getProperties(), file.reader()); }catch(Throwable e){ @@ -469,7 +469,7 @@ public class Mods implements Loadable{ if(mod.root.child("scripts").exists()){ content.setCurrentMod(mod); //if there's only one script file, use it (for backwards compatibility); if there isn't, use "main.js" - Array allScripts = mod.root.child("scripts").findAll(f -> f.extEquals("js")); + Seq allScripts = mod.root.child("scripts").findAll(f -> f.extEquals("js")); Fi main = allScripts.size == 1 ? allScripts.first() : mod.root.child("scripts").child("main.js"); if(main.exists() && !main.isDirectory()){ try{ @@ -519,7 +519,7 @@ public class Mods implements Loadable{ } } - Array runs = new Array<>(); + Seq runs = new Seq<>(); for(LoadedMod mod : orderedMods()){ if(mod.root.child("content").exists()){ @@ -562,7 +562,7 @@ public class Mods implements Loadable{ } /** @return a list of mods and versions, in the format name:version. */ - public Array getModStrings(){ + public Seq getModStrings(){ return mods.select(l -> !l.meta.hidden && l.enabled()).map(l -> l.name + ":" + l.meta.version); } @@ -579,9 +579,9 @@ public class Mods implements Loadable{ /** @return the mods that the client is missing. * The inputted array is changed to contain the extra mods that the client has but the server doesn't.*/ - public Array getIncompatibility(Array out){ - Array mods = getModStrings(); - Array result = mods.copy(); + public Seq getIncompatibility(Seq out){ + Seq mods = getModStrings(); + Seq result = mods.copy(); for(String mod : mods){ if(out.remove(mod)){ result.remove(mod); @@ -590,7 +590,7 @@ public class Mods implements Loadable{ return result; } - public Array list(){ + public Seq list(){ return mods; } @@ -681,11 +681,11 @@ public class Mods implements Loadable{ /** This mod's metadata. */ public final ModMeta meta; /** This mod's dependencies as already-loaded mods. */ - public Array dependencies = new Array<>(); + public Seq dependencies = new Seq<>(); /** All missing dependencies of this mod as strings. */ - public Array missingDependencies = new Array<>(); + public Seq missingDependencies = new Seq<>(); /** Script files to run. */ - public Array scripts = new Array<>(); + public Seq scripts = new Seq<>(); /** Content with intialization code. */ public ObjectSet erroredContent = new ObjectSet<>(); /** Current state of this mod. */ @@ -805,7 +805,7 @@ public class Mods implements Loadable{ /** Plugin metadata information.*/ public static class ModMeta{ public String name, displayName, author, description, version, main, minGameVersion; - public Array dependencies = Array.with(); + public Seq dependencies = Seq.with(); /** Hidden mods are only server-side or client-side, and do not support adding new content. */ public boolean hidden; diff --git a/core/src/mindustry/mod/Scripts.java b/core/src/mindustry/mod/Scripts.java index c25a34fb66..02e70ffb42 100644 --- a/core/src/mindustry/mod/Scripts.java +++ b/core/src/mindustry/mod/Scripts.java @@ -18,15 +18,15 @@ import java.util.regex.*; public class Scripts implements Disposable{ private final static Object[] emptyObjects = {}; - private final Array blacklist = Array.with("net", "files", "reflect", "javax", "rhino", "file", "channels", "jdk", + private final Seq blacklist = Seq.with("net", "files", "reflect", "javax", "rhino", "file", "channels", "jdk", "runtime", "util.os", "rmi", "security", "org.", "sun.", "beans", "sql", "http", "exec", "compiler", "process", "system", ".awt", "socket", "classloader", "oracle", "invoke", "arc.events", "java.util.function", "java.util.stream"); - private final Array whitelist = Array.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "mindustry.gen."); + private final Seq whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "mindustry.gen."); private final Context context; private Scriptable scope; private boolean errored; private LoadedMod currentMod = null; - private Array events = new Array<>(); + private Seq events = new Seq<>(); public Scripts(){ Time.mark(); diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index 0afc7a33c1..0edf3db062 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -20,11 +20,11 @@ import static mindustry.game.EventType.*; public class Administration{ /** All player info. Maps UUIDs to info. This persists throughout restarts. */ private ObjectMap playerInfo = new ObjectMap<>(); - private Array bannedIPs = new Array<>(); - private Array whitelist = new Array<>(); - private Array chatFilters = new Array<>(); - private Array actionFilters = new Array<>(); - private Array subnetBans = new Array<>(); + private Seq bannedIPs = new Seq<>(); + private Seq whitelist = new Seq<>(); + private Seq chatFilters = new Seq<>(); + private Seq actionFilters = new Seq<>(); + private Seq subnetBans = new Seq<>(); private IntIntMap lastPlaced = new IntIntMap(); public Administration(){ @@ -97,7 +97,7 @@ public class Administration{ }); } - public Array getSubnetBans(){ + public Seq getSubnetBans(){ return subnetBans; } @@ -256,8 +256,8 @@ public class Administration{ /** * Returns list of all players with admin status */ - public Array getAdmins(){ - Array result = new Array<>(); + public Seq getAdmins(){ + Seq result = new Seq<>(); for(PlayerInfo info : playerInfo.values()){ if(info.admin){ result.add(info); @@ -269,8 +269,8 @@ public class Administration{ /** * Returns list of all players which are banned */ - public Array getBanned(){ - Array result = new Array<>(); + public Seq getBanned(){ + Seq result = new Seq<>(); for(PlayerInfo info : playerInfo.values()){ if(info.banned){ result.add(info); @@ -282,7 +282,7 @@ public class Administration{ /** * Returns all banned IPs. This does not include the IPs of ID-banned players. */ - public Array getBannedIPs(){ + public Seq getBannedIPs(){ return bannedIPs; } @@ -384,8 +384,8 @@ public class Administration{ return result; } - public Array findByIPs(String ip){ - Array result = new Array<>(); + public Seq findByIPs(String ip){ + Seq result = new Seq<>(); for(PlayerInfo info : playerInfo.values()){ if(info.ips.contains(ip, false)){ @@ -413,7 +413,7 @@ public class Administration{ return null; } - public Array getWhitelisted(){ + public Seq getWhitelisted(){ return playerInfo.values().toArray().select(p -> isWhitelisted(p.id, p.adminUsid)); } @@ -440,9 +440,9 @@ public class Administration{ if(!loadLegacy()){ //load default data playerInfo = Core.settings.getJson("player-data", ObjectMap.class, ObjectMap::new); - bannedIPs = Core.settings.getJson("ip-bans", Array.class, Array::new); - whitelist = Core.settings.getJson("whitelist-ids", Array.class, Array::new); - subnetBans = Core.settings.getJson("banned-subnets", Array.class, Array::new); + bannedIPs = Core.settings.getJson("ip-bans", Seq.class, Seq::new); + whitelist = Core.settings.getJson("whitelist-ids", Seq.class, Seq::new); + subnetBans = Core.settings.getJson("banned-subnets", Seq.class, Seq::new); }else{ //save over loaded legacy data save(); @@ -631,8 +631,8 @@ public class Administration{ public static class PlayerInfo{ public String id; public String lastName = "", lastIP = ""; - public Array ips = new Array<>(); - public Array names = new Array<>(); + public Seq ips = new Seq<>(); + public Seq names = new Seq<>(); public String adminUsid; public int timesKicked; public int timesJoined; diff --git a/core/src/mindustry/net/ArcNetProvider.java b/core/src/mindustry/net/ArcNetProvider.java index 400f99f772..ea30157955 100644 --- a/core/src/mindustry/net/ArcNetProvider.java +++ b/core/src/mindustry/net/ArcNetProvider.java @@ -198,7 +198,7 @@ public class ArcNetProvider implements NetProvider{ @Override public void discoverServers(Cons callback, Runnable done){ - Array foundAddresses = new Array<>(); + Seq foundAddresses = new Seq<>(); client.discoverHosts(port, multicastGroup, multicastPort, 3000, packet -> { Core.app.post(() -> { try{ diff --git a/core/src/mindustry/net/Net.java b/core/src/mindustry/net/Net.java index 7096947e0b..117ccba23e 100644 --- a/core/src/mindustry/net/Net.java +++ b/core/src/mindustry/net/Net.java @@ -23,7 +23,7 @@ public class Net{ private boolean clientLoaded; private @Nullable StreamBuilder currentStream; - private final Array packetQueue = new Array<>(); + private final Seq packetQueue = new Seq<>(); private final ObjectMap, Cons> clientListeners = new ObjectMap<>(); private final ObjectMap, Cons2> serverListeners = new ObjectMap<>(); private final IntMap streams = new IntMap<>(); diff --git a/core/src/mindustry/net/NetConnection.java b/core/src/mindustry/net/NetConnection.java index a6c5266fc7..d4ff73a7f0 100644 --- a/core/src/mindustry/net/NetConnection.java +++ b/core/src/mindustry/net/NetConnection.java @@ -27,7 +27,7 @@ public abstract class NetConnection{ /** Timestamp of last recieved snapshot. */ public long lastRecievedClientTime; /** Build requests that have been recently rejected. This is cleared every snapshot. */ - public Array rejectedRequests = new Array<>(); + public Seq rejectedRequests = new Seq<>(); public boolean hasConnected, hasBegunConnecting, hasDisconnected; public float viewWidth, viewHeight, viewX, viewY; diff --git a/core/src/mindustry/net/Packets.java b/core/src/mindustry/net/Packets.java index d842bbd331..afe4016091 100644 --- a/core/src/mindustry/net/Packets.java +++ b/core/src/mindustry/net/Packets.java @@ -159,7 +159,7 @@ public class Packets{ public static class ConnectPacket implements Packet{ public int version; public String versionType; - public Array mods; + public Seq mods; public String name, uuid, usid; public boolean mobile; public int color; @@ -196,7 +196,7 @@ public class Packets{ mobile = buffer.get() == 1; color = buffer.getInt(); int totalMods = buffer.get(); - mods = new Array<>(totalMods); + mods = new Seq<>(totalMods); for(int i = 0; i < totalMods; i++){ mods.add(TypeIO.readString(buffer)); } diff --git a/core/src/mindustry/type/Item.java b/core/src/mindustry/type/Item.java index 58f3b805fc..bd9e28b66e 100644 --- a/core/src/mindustry/type/Item.java +++ b/core/src/mindustry/type/Item.java @@ -53,7 +53,7 @@ public class Item extends UnlockableContent{ } /** Allocates a new array containing all items that generate ores. */ - public static Array getAllOres(){ + public static Seq getAllOres(){ return content.blocks().select(b -> b instanceof OreBlock).map(b -> ((Floor)b).itemDrop); } } diff --git a/core/src/mindustry/type/ItemStack.java b/core/src/mindustry/type/ItemStack.java index 99957c6fcb..a8a765c4df 100644 --- a/core/src/mindustry/type/ItemStack.java +++ b/core/src/mindustry/type/ItemStack.java @@ -1,6 +1,6 @@ package mindustry.type; -import arc.struct.Array; +import arc.struct.Seq; import mindustry.content.Items; public class ItemStack implements Comparable{ @@ -51,8 +51,8 @@ public class ItemStack implements Comparable{ return stacks; } - public static Array list(Object... items){ - Array stacks = new Array<>(items.length / 2); + public static Seq list(Object... items){ + Seq stacks = new Seq<>(items.length / 2); for(int i = 0; i < items.length; i += 2){ stacks.add(new ItemStack((Item)items[i], ((Number)items[i + 1]).intValue())); } diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index c3d13fe62b..e1b47919be 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -34,7 +34,7 @@ public class Planet extends UnlockableContent{ /** Generator that will make the planet. Can be null for planets that don't need to be landed on. */ public @Nullable PlanetGenerator generator; /** Array of sectors; directly maps to tiles in the grid. */ - public @NonNull Array sectors; + public @NonNull Seq sectors; /** Radius of this planet's sphere. Does not take into account sattelites. */ public float radius; /** Orbital radius around the sun. Do not change unless you know exactly what you are doing.*/ @@ -62,9 +62,9 @@ public class Planet extends UnlockableContent{ /** The root parent of the whole solar system this planet is in. */ public @NonNull Planet solarSystem; /** All planets orbiting this one, in ascending order of radius. */ - public Array children = new Array<>(); + public Seq children = new Seq<>(); /** Sattelites orbiting this planet. */ - public Array satellites = new Array<>(); + public Seq satellites = new Seq<>(); /** Loads the mesh. Clientside only. Defaults to a boring sphere mesh. */ protected Prov meshLoader = () -> new ShaderSphereMesh(this, Shaders.unlit, 2); @@ -77,7 +77,7 @@ public class Planet extends UnlockableContent{ if(sectorSize > 0){ grid = PlanetGrid.create(sectorSize); - sectors = new Array<>(grid.tiles.length); + sectors = new Seq<>(grid.tiles.length); for(int i = 0; i < grid.tiles.length; i++){ sectors.add(new Sector(this, grid.tiles[i], new SectorData())); } @@ -103,7 +103,7 @@ public class Planet extends UnlockableContent{ sector.generate(); } }else{ - sectors = new Array<>(); + sectors = new Seq<>(); } //total radius is initially just the radius diff --git a/core/src/mindustry/type/Publishable.java b/core/src/mindustry/type/Publishable.java index 5e99f2b4b5..8c8b32edde 100644 --- a/core/src/mindustry/type/Publishable.java +++ b/core/src/mindustry/type/Publishable.java @@ -24,8 +24,8 @@ public interface Publishable{ /** @return a preview file PNG. */ Fi createSteamPreview(String id); /** @return any extra tags to add to this item.*/ - default Array extraTags(){ - return new Array<>(0); + default Seq extraTags(){ + return new Seq<>(0); } /** @return whether this item is or was once on the workshop.*/ default boolean hasSteamID(){ diff --git a/core/src/mindustry/type/SectorPreset.java b/core/src/mindustry/type/SectorPreset.java index 7e19736e3b..6de84e9499 100644 --- a/core/src/mindustry/type/SectorPreset.java +++ b/core/src/mindustry/type/SectorPreset.java @@ -18,17 +18,17 @@ public class SectorPreset extends UnlockableContent{ public @NonNull FileMapGenerator generator; public @NonNull Planet planet; public @NonNull Sector sector; - public Array requirements = new Array<>(); + public Seq requirements = new Seq<>(); public Cons rules = rules -> {}; public int conditionWave = Integer.MAX_VALUE; public int launchPeriod = 10; public Schematic loadout = Loadouts.basicShard; - protected Array baseLaunchCost = new Array<>(); - protected Array startingItems = new Array<>(); - protected Array launchCost; - protected Array defaultStartingItems = new Array<>(); + protected Seq baseLaunchCost = new Seq<>(); + protected Seq startingItems = new Seq<>(); + protected Seq launchCost; + protected Seq defaultStartingItems = new Seq<>(); public SectorPreset(String name, Planet planet, int sector){ super(name); @@ -51,14 +51,14 @@ public class SectorPreset extends UnlockableContent{ return data.isUnlocked(this) || !requirements.contains(r -> !r.complete()); } - public Array getLaunchCost(){ + public Seq getLaunchCost(){ if(launchCost == null){ updateLaunchCost(); } return launchCost; } - public Array getStartingItems(){ + public Seq getStartingItems(){ return startingItems; } @@ -90,7 +90,7 @@ public class SectorPreset extends UnlockableContent{ } public void updateObjectives(Runnable closure){ - Array incomplete = content.sectors() + Seq incomplete = content.sectors() .flatMap(z -> z.requirements) .filter(o -> o.zone() == this && !o.complete()).as(); @@ -112,7 +112,7 @@ public class SectorPreset extends UnlockableContent{ } public void updateLaunchCost(){ - Array stacks = new Array<>(); + Seq stacks = new Seq<>(); Cons adder = stack -> { for(ItemStack other : stacks){ diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 09fa8a7c68..1b3e99d224 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -66,7 +66,7 @@ public class UnitType extends UnlockableContent{ public ObjectSet immunities = new ObjectSet<>(); public Sound deathSound = Sounds.bang; - public Array weapons = new Array<>(); + public Seq weapons = new Seq<>(); public TextureRegion baseRegion, legRegion, region, shadowRegion, cellRegion, occlusionRegion, jointRegion, footRegion, legBaseRegion, baseJointRegion; diff --git a/core/src/mindustry/ui/ContentDisplay.java b/core/src/mindustry/ui/ContentDisplay.java index d654aecab1..7208c42f41 100644 --- a/core/src/mindustry/ui/ContentDisplay.java +++ b/core/src/mindustry/ui/ContentDisplay.java @@ -38,7 +38,7 @@ public class ContentDisplay{ BlockStats stats = block.stats; for(StatCategory cat : stats.toMap().keys()){ - OrderedMap> map = stats.toMap().get(cat); + OrderedMap> map = stats.toMap().get(cat); if(map.size == 0) continue; @@ -49,7 +49,7 @@ public class ContentDisplay{ table.table(inset -> { inset.left(); inset.add("[lightgray]" + stat.localized() + ":[] ").left(); - Array arr = map.get(stat); + Seq arr = map.get(stat); for(StatValue value : arr){ value.display(inset); inset.add().size(10f); diff --git a/core/src/mindustry/ui/Fonts.java b/core/src/mindustry/ui/Fonts.java index 136730d2e9..9ad71e4b3c 100644 --- a/core/src/mindustry/ui/Fonts.java +++ b/core/src/mindustry/ui/Fonts.java @@ -67,7 +67,7 @@ public class Fonts{ } public static void loadContentIcons(){ - Array fonts = Array.with(Fonts.chat, Fonts.def, Fonts.outline); + Seq fonts = Seq.with(Fonts.chat, Fonts.def, Fonts.outline); Texture uitex = Core.atlas.find("logo").getTexture(); int size = (int)(Fonts.def.getData().lineHeight/Fonts.def.getData().scaleY); @@ -156,7 +156,7 @@ public class Fonts{ Page page = UI.packer.getPages().first(); - Array regions = atlas.getRegions().select(t -> t.getTexture() == texture); + Seq regions = atlas.getRegions().select(t -> t.getTexture() == texture); for(AtlasRegion region : regions){ //get new pack rect page.setDirty(false); diff --git a/core/src/mindustry/ui/MultiReqImage.java b/core/src/mindustry/ui/MultiReqImage.java index 6d7f199f57..715f629088 100644 --- a/core/src/mindustry/ui/MultiReqImage.java +++ b/core/src/mindustry/ui/MultiReqImage.java @@ -1,11 +1,11 @@ package mindustry.ui; -import arc.struct.Array; +import arc.struct.Seq; import arc.scene.ui.layout.Stack; import arc.util.Time; public class MultiReqImage extends Stack{ - private Array displays = new Array<>(); + private Seq displays = new Seq<>(); private float time; public void add(ReqImage display){ diff --git a/core/src/mindustry/ui/dialogs/AboutDialog.java b/core/src/mindustry/ui/dialogs/AboutDialog.java index 3986dba4bd..a930e6f3f2 100644 --- a/core/src/mindustry/ui/dialogs/AboutDialog.java +++ b/core/src/mindustry/ui/dialogs/AboutDialog.java @@ -15,14 +15,14 @@ import mindustry.ui.Links.*; import static mindustry.Vars.*; public class AboutDialog extends BaseDialog{ - private Array contributors = new Array<>(); + private Seq contributors = new Seq<>(); private static ObjectSet bannedItems = ObjectSet.with("google-play", "itch.io", "dev-builds", "f-droid"); public AboutDialog(){ super("$about.button"); shown(() -> { - contributors = Array.with(Core.files.internal("contributors").readString("UTF-8").split("\n")); + contributors = Seq.with(Core.files.internal("contributors").readString("UTF-8").split("\n")); Core.app.post(this::setup); }); diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index f45850b0fd..be09111dd9 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -59,7 +59,7 @@ public class CustomRulesDialog extends BaseDialog{ t.add("$empty"); } - Array array = Array.with(rules.bannedBlocks); + Seq array = Seq.with(rules.bannedBlocks); array.sort(); int cols = mobile && Core.graphics.isPortrait() ? 1 : mobile ? 2 : 3; diff --git a/core/src/mindustry/ui/dialogs/DatabaseDialog.java b/core/src/mindustry/ui/dialogs/DatabaseDialog.java index 0f4209ecfd..9e2af57df8 100644 --- a/core/src/mindustry/ui/dialogs/DatabaseDialog.java +++ b/core/src/mindustry/ui/dialogs/DatabaseDialog.java @@ -34,12 +34,12 @@ public class DatabaseDialog extends BaseDialog{ table.margin(20); ScrollPane pane = new ScrollPane(table); - Array[] allContent = Vars.content.getContentMap(); + Seq[] allContent = Vars.content.getContentMap(); for(int j = 0; j < allContent.length; j++){ ContentType type = ContentType.values()[j]; - Array array = allContent[j].select(c -> c instanceof UnlockableContent && !((UnlockableContent)c).isHidden()); + Seq array = allContent[j].select(c -> c instanceof UnlockableContent && !((UnlockableContent)c).isHidden()); if(array.size == 0) continue; table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent); diff --git a/core/src/mindustry/ui/dialogs/FileChooser.java b/core/src/mindustry/ui/dialogs/FileChooser.java index 3e2118fb84..d2046c435e 100644 --- a/core/src/mindustry/ui/dialogs/FileChooser.java +++ b/core/src/mindustry/ui/dialogs/FileChooser.java @@ -254,7 +254,7 @@ public class FileChooser extends BaseDialog{ } public class FileHistory{ - private Array history = new Array<>(); + private Seq history = new Seq<>(); private int index; public FileHistory(){ diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index 4e75d13552..fcd62af0b8 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -20,7 +20,7 @@ import mindustry.ui.*; import static mindustry.Vars.*; public class JoinDialog extends BaseDialog{ - Array servers = new Array<>(); + Seq servers = new Seq<>(); Dialog add; Server renaming; Table local = new Table(); @@ -417,7 +417,7 @@ public class JoinDialog extends BaseDialog{ @SuppressWarnings("unchecked") private void loadServers(){ - servers = Core.settings.getJson("servers", Array.class, Array::new); + servers = Core.settings.getJson("servers", Seq.class, Seq::new); //load imported legacy data if(Core.settings.has("server-list")){ diff --git a/core/src/mindustry/ui/dialogs/LoadDialog.java b/core/src/mindustry/ui/dialogs/LoadDialog.java index 9231f1f289..e341a1b224 100644 --- a/core/src/mindustry/ui/dialogs/LoadDialog.java +++ b/core/src/mindustry/ui/dialogs/LoadDialog.java @@ -50,7 +50,7 @@ public class LoadDialog extends BaseDialog{ Time.runTask(2f, () -> Core.scene.setScrollFocus(pane)); - Array array = control.saves.getSaveSlots(); + Seq array = control.saves.getSaveSlots(); array.sort((slot, other) -> -Long.compare(slot.getTimestamp(), other.getTimestamp())); int maxwidth = Math.max((int)(Core.graphics.getWidth() / Scl.scl(470)), 1); diff --git a/core/src/mindustry/ui/dialogs/LoadoutDialog.java b/core/src/mindustry/ui/dialogs/LoadoutDialog.java index 510032e7d7..58d0e057d5 100644 --- a/core/src/mindustry/ui/dialogs/LoadoutDialog.java +++ b/core/src/mindustry/ui/dialogs/LoadoutDialog.java @@ -15,8 +15,8 @@ public class LoadoutDialog extends BaseDialog{ private Runnable hider; private Runnable resetter; private Runnable updater; - private Array stacks = new Array<>(); - private Array originalStacks = new Array<>(); + private Seq stacks = new Seq<>(); + private Seq originalStacks = new Seq<>(); private Table items; private int capacity; @@ -51,7 +51,7 @@ public class LoadoutDialog extends BaseDialog{ }).size(210f, 64f); } - public void show(int capacity, Array stacks, Runnable reseter, Runnable updater, Runnable hider){ + public void show(int capacity, Seq stacks, Runnable reseter, Runnable updater, Runnable hider){ this.originalStacks = stacks; reseed(); this.resetter = reseter; diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java index 3628ff3f14..bfe16a064c 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -332,7 +332,7 @@ public class SchematicsDialog extends BaseDialog{ cont.add(new SchematicImage(schem)).maxSize(800f); cont.row(); - Array arr = schem.requirements(); + Seq arr = schem.requirements(); cont.table(r -> { int i = 0; for(ItemStack s : arr){ diff --git a/core/src/mindustry/ui/dialogs/TechTreeDialog.java b/core/src/mindustry/ui/dialogs/TechTreeDialog.java index a7b212ebd1..9ce2495bb6 100644 --- a/core/src/mindustry/ui/dialogs/TechTreeDialog.java +++ b/core/src/mindustry/ui/dialogs/TechTreeDialog.java @@ -191,7 +191,7 @@ public class TechTreeDialog extends BaseDialog{ this.parent = parent; this.width = this.height = nodeSize; if(node.children != null){ - children = Array.with(node.children).map(t -> new LayoutNode(t, this)).toArray(LayoutNode.class); + children = Seq.with(node.children).map(t -> new LayoutNode(t, this)).toArray(LayoutNode.class); } } } diff --git a/core/src/mindustry/ui/fragments/ChatFragment.java b/core/src/mindustry/ui/fragments/ChatFragment.java index f279178fd7..7b5057bb46 100644 --- a/core/src/mindustry/ui/fragments/ChatFragment.java +++ b/core/src/mindustry/ui/fragments/ChatFragment.java @@ -22,7 +22,7 @@ import static mindustry.Vars.*; public class ChatFragment extends Table{ private final static int messagesShown = 10; - private Array messages = new Array<>(); + private Seq messages = new Seq<>(); private float fadetime; private boolean shown = false; private TextField chatfield; @@ -32,7 +32,7 @@ public class ChatFragment extends Table{ private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50); private Color shadowColor = new Color(0, 0, 0, 0.4f); private float textspacing = Scl.scl(10); - private Array history = new Array<>(); + private Seq history = new Seq<>(); private int historyPos = 0; private int scrollPos = 0; private Fragment container = new Fragment(){ diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 79c7196693..7bbd08029c 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -119,7 +119,7 @@ public class HudFragment extends Fragment{ select.image().color(Pal.gray).width(4f).fillY(); float size = Scl.scl(dsize); - Array children = new Array<>(select.getChildren()); + Seq children = new Seq<>(select.getChildren()); //now, you may be wondering, why is this necessary? the answer is, I don't know, but it fixes layout issues somehow int index = 0; @@ -474,7 +474,7 @@ public class HudFragment extends Fragment{ int cap = col * col - 1; //get old elements - Array elements = new Array<>(lastUnlockLayout.getChildren()); + Seq elements = new Seq<>(lastUnlockLayout.getChildren()); int esize = elements.size; //...if it's already reached the cap, ignore everything diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java index 7f5775b2d7..c4c0c4d09c 100644 --- a/core/src/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/mindustry/ui/fragments/PlacementFragment.java @@ -27,8 +27,8 @@ public class PlacementFragment extends Fragment{ final int rowWidth = 4; public Category currentCategory = Category.distribution; - Array returnArray = new Array<>(); - Array returnCatArray = new Array<>(); + Seq returnArray = new Seq<>(); + Seq returnCatArray = new Seq<>(); boolean[] categoryEmpty = new boolean[Category.all.length]; ObjectMap selectedBlocks = new ObjectMap<>(); ObjectFloatMap scrollPositions = new ObjectFloatMap<>(); @@ -115,7 +115,7 @@ public class PlacementFragment extends Fragment{ for(int i = 0; i < blockSelect.length; i++){ if(Core.input.keyTap(blockSelect[i])){ if(i > 9) { //select block directionally - Array blocks = getByCategory(currentCategory); + Seq blocks = getByCategory(currentCategory); Block currentBlock = getSelectedBlock(currentCategory); for(int j = 0; j < blocks.size; j++){ if(blocks.get(j) == currentBlock){ @@ -157,7 +157,7 @@ public class PlacementFragment extends Fragment{ i += (blockSelectSeq - (i != 9 ? 0 : 1)) * 10; blockSelectEnd = true; } - Array blocks = getByCategory(currentCategory); + Seq blocks = getByCategory(currentCategory); input.block = (i < blocks.size) ? blocks.get(i) : null; selectedBlocks.put(currentCategory, input.block); blockSelectSeqMillis = Time.millis(); @@ -276,7 +276,7 @@ public class PlacementFragment extends Fragment{ topTable.table(header -> { String keyCombo = ""; if(!mobile && Core.settings.getBool("blockselectkeys")){ - Array blocks = getByCategory(currentCategory); + Seq blocks = getByCategory(currentCategory); for(int i = 0; i < blocks.size; i++){ if(blocks.get(i) == lastDisplay && (i + 1) / 10 - 1 < blockSelect.length){ keyCombo = Core.bundle.format("placement.blockselectkeys", Core.keybinds.get(blockSelect[currentCategory.ordinal()]).key.toString()) @@ -384,7 +384,7 @@ public class PlacementFragment extends Fragment{ //update category empty values for(Category cat : Category.all){ - Array blocks = getByCategory(cat); + Seq blocks = getByCategory(cat); categoryEmpty[cat.ordinal()] = blocks.isEmpty(); } @@ -415,14 +415,14 @@ public class PlacementFragment extends Fragment{ }); } - Array getCategories(){ + Seq getCategories(){ returnCatArray.clear(); returnCatArray.addAll(Category.all); returnCatArray.sort((c1, c2) -> Boolean.compare(categoryEmpty[c1.ordinal()], categoryEmpty[c2.ordinal()])); return returnCatArray; } - Array getByCategory(Category cat){ + Seq getByCategory(Category cat){ returnArray.clear(); for(Block block : content.blocks()){ if(block.category == cat && block.isVisible() && unlocked(block)){ diff --git a/core/src/mindustry/ui/fragments/ScriptConsoleFragment.java b/core/src/mindustry/ui/fragments/ScriptConsoleFragment.java index 524bf08770..7a057a262d 100644 --- a/core/src/mindustry/ui/fragments/ScriptConsoleFragment.java +++ b/core/src/mindustry/ui/fragments/ScriptConsoleFragment.java @@ -20,7 +20,7 @@ import static mindustry.Vars.*; public class ScriptConsoleFragment extends Table{ private final static int messagesShown = 30; - private Array messages = new Array<>(); + private Seq messages = new Seq<>(); private boolean open = false, shown; private TextField chatfield; private Label fieldlabel = new Label(">"); @@ -29,7 +29,7 @@ public class ScriptConsoleFragment extends Table{ private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50); private Color shadowColor = new Color(0, 0, 0, 0.4f); private float textspacing = Scl.scl(10); - private Array history = new Array<>(); + private Seq history = new Seq<>(); private int historyPos = 0; private int scrollPos = 0; private Fragment container = new Fragment(){ diff --git a/core/src/mindustry/ui/layout/BranchTreeLayout.java b/core/src/mindustry/ui/layout/BranchTreeLayout.java index 0e24685705..eaa8a5cdd9 100644 --- a/core/src/mindustry/ui/layout/BranchTreeLayout.java +++ b/core/src/mindustry/ui/layout/BranchTreeLayout.java @@ -12,7 +12,7 @@ public class BranchTreeLayout implements TreeLayout{ public float gapBetweenLevels = 10; public float gapBetweenNodes = 10f; - private final FloatArray sizeOfLevel = new FloatArray(); + private final FloatSeq sizeOfLevel = new FloatSeq(); private float boundsLeft = Float.MAX_VALUE; private float boundsRight = Float.MIN_VALUE; private float boundsTop = Float.MAX_VALUE; diff --git a/core/src/mindustry/ui/layout/RowTreeLayout.java b/core/src/mindustry/ui/layout/RowTreeLayout.java index 58fa8596e4..c79b01abbf 100644 --- a/core/src/mindustry/ui/layout/RowTreeLayout.java +++ b/core/src/mindustry/ui/layout/RowTreeLayout.java @@ -6,7 +6,7 @@ public class RowTreeLayout implements TreeLayout{ @Override public void layout(TreeNode root){ - layout(root, 0, new IntArray()); + layout(root, 0, new IntSeq()); /* def minimum_ws(tree, depth=0): @@ -18,7 +18,7 @@ public class RowTreeLayout implements TreeLayout{ */ } - void layout(TreeNode node, int depth, IntArray nexts){ + void layout(TreeNode node, int depth, IntSeq nexts){ float size = node.height * 5f; if(nexts.size < depth + 1){ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index e706110633..9a0ea79d11 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -9,7 +9,7 @@ import arc.graphics.g2d.TextureAtlas.*; import arc.math.*; import arc.math.geom.*; import arc.scene.ui.layout.*; -import arc.struct.Array; +import arc.struct.Seq; import arc.struct.EnumSet; import arc.struct.*; import arc.util.*; @@ -183,12 +183,12 @@ public class Block extends UnlockableContent{ //TODO remove completely protected TextureRegion[] cacheRegions = {}; - protected Array cacheRegionStrings = new Array<>(); + protected Seq cacheRegionStrings = new Seq<>(); //TODO move public static TextureRegion[][] cracks; - protected static final Array tempTiles = new Array<>(); - protected static final Array tempTileEnts = new Array<>(); + protected static final Seq tempTiles = new Seq<>(); + protected static final Seq tempTileEnts = new Seq<>(); /** Dump timer ID.*/ protected final int timerDump = timers++; @@ -348,7 +348,7 @@ public class Block extends UnlockableContent{ } /** @return a possible replacement for this block when placed in a line by the player. */ - public Block getReplacement(BuildRequest req, Array requests){ + public Block getReplacement(BuildRequest req, Seq requests){ return this; } diff --git a/core/src/mindustry/world/Tile.java b/core/src/mindustry/world/Tile.java index 545378c23a..75c969cb60 100644 --- a/core/src/mindustry/world/Tile.java +++ b/core/src/mindustry/world/Tile.java @@ -376,7 +376,7 @@ public class Tile implements Position, QuadTreeObject{ * Returns the list of all tiles linked to this multiblock. * This array contains all linked tiles, including this tile itself. */ - public Array getLinkedTiles(Array tmpArray){ + public Seq getLinkedTiles(Seq tmpArray){ tmpArray.clear(); getLinkedTiles(tmpArray::add); return tmpArray; @@ -386,7 +386,7 @@ public class Tile implements Position, QuadTreeObject{ * Returns the list of all tiles linked to this multiblock if it were this block. * This array contains all linked tiles, including this tile itself. */ - public Array getLinkedTilesAs(Block block, Array tmpArray){ + public Seq getLinkedTilesAs(Block block, Seq tmpArray){ tmpArray.clear(); if(block.isMultiblock()){ int offsetx = -(block.size - 1) / 2; diff --git a/core/src/mindustry/world/blocks/ItemSelection.java b/core/src/mindustry/world/blocks/ItemSelection.java index 0e2376eb47..abd5a1a24a 100644 --- a/core/src/mindustry/world/blocks/ItemSelection.java +++ b/core/src/mindustry/world/blocks/ItemSelection.java @@ -14,7 +14,7 @@ import static mindustry.Vars.*; public class ItemSelection{ private static float scrollPos = 0f; - public static void buildTable(Table table, Array items, Prov holder, Cons consumer){ + public static void buildTable(Table table, Seq items, Prov holder, Cons consumer){ ButtonGroup group = new ButtonGroup<>(); group.setMinCheckCount(0); diff --git a/core/src/mindustry/world/blocks/campaign/LaunchPad.java b/core/src/mindustry/world/blocks/campaign/LaunchPad.java index 7dbded1b5c..c8ddfa5855 100644 --- a/core/src/mindustry/world/blocks/campaign/LaunchPad.java +++ b/core/src/mindustry/world/blocks/campaign/LaunchPad.java @@ -113,7 +113,7 @@ public class LaunchPad extends Block{ static abstract class LaunchPayloadComp implements Drawc, Timedc, Teamc{ @Import float x,y; - Array stacks = new Array<>(); + Seq stacks = new Seq<>(); transient Interval in = new Interval(); @Override diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index e7ac459f39..e14f0eeebc 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -139,7 +139,7 @@ public abstract class Turret extends Block{ } public class TurretEntity extends TileEntity implements ControlBlock{ - public Array ammo = new Array<>(); + public Seq ammo = new Seq<>(); public int totalAmmo; public float reload, rotation = 90, recoil, heat; public int shotCounter; diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index a2dae61ea5..c09478e432 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -82,7 +82,7 @@ public class Conveyor extends Block implements Autotiler{ } @Override - public Block getReplacement(BuildRequest req, Array requests){ + public Block getReplacement(BuildRequest req, Seq requests){ Boolf cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && o.rotation == req.rotation && (req.block instanceof Conveyor || req.block instanceof Junction)); return cont.get(Geometry.d4(req.rotation)) && cont.get(Geometry.d4(req.rotation - 2)) && diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index d3b3929975..c379d921cf 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -64,7 +64,7 @@ public class Floor extends Block{ public Block decoration = Blocks.air; protected TextureRegion[][] edges; - protected Array blenders = new Array<>(); + protected Seq blenders = new Seq<>(); protected IntSet blended = new IntSet(); protected TextureRegion edgeRegion; diff --git a/core/src/mindustry/world/blocks/experimental/BlockForge.java b/core/src/mindustry/world/blocks/experimental/BlockForge.java index 22e415e609..ec2843a523 100644 --- a/core/src/mindustry/world/blocks/experimental/BlockForge.java +++ b/core/src/mindustry/world/blocks/experimental/BlockForge.java @@ -108,7 +108,7 @@ public class BlockForge extends PayloadAcceptor{ @Override public void buildConfiguration(Table table){ - Array blocks = Vars.content.blocks().select(b -> b.isVisible() && b.size <= 2); + Seq blocks = Vars.content.blocks().select(b -> b.isVisible() && b.size <= 2); ItemSelection.buildTable(table, blocks, () -> recipe, block -> recipe = block); } diff --git a/core/src/mindustry/world/blocks/experimental/ProcessorBlock.java b/core/src/mindustry/world/blocks/experimental/ProcessorBlock.java index 97ffad9c34..9fa481beba 100644 --- a/core/src/mindustry/world/blocks/experimental/ProcessorBlock.java +++ b/core/src/mindustry/world/blocks/experimental/ProcessorBlock.java @@ -14,7 +14,7 @@ public class ProcessorBlock extends Block{ public class ProcessorEntity extends TileEntity{ //all tiles in the block network - does not include itself - Array network = new Array<>(); + Seq network = new Seq<>(); @Override public boolean onConfigureTileTapped(Tilec other){ diff --git a/core/src/mindustry/world/blocks/liquid/Conduit.java b/core/src/mindustry/world/blocks/liquid/Conduit.java index 30c28e7a06..8bc474093a 100644 --- a/core/src/mindustry/world/blocks/liquid/Conduit.java +++ b/core/src/mindustry/world/blocks/liquid/Conduit.java @@ -53,7 +53,7 @@ public class Conduit extends LiquidBlock implements Autotiler{ } @Override - public Block getReplacement(BuildRequest req, Array requests){ + public Block getReplacement(BuildRequest req, Seq requests){ Boolf cont = p -> requests.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && o.rotation == req.rotation && (req.block instanceof Conduit || req.block instanceof LiquidJunction)); return cont.get(Geometry.d4(req.rotation)) && cont.get(Geometry.d4(req.rotation - 2)) && diff --git a/core/src/mindustry/world/blocks/power/PowerGraph.java b/core/src/mindustry/world/blocks/power/PowerGraph.java index da360d9343..bc0b9e117f 100644 --- a/core/src/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/mindustry/world/blocks/power/PowerGraph.java @@ -9,8 +9,8 @@ import mindustry.world.consumers.*; public class PowerGraph{ private final static Queue queue = new Queue<>(); - private final static Array outArray1 = new Array<>(); - private final static Array outArray2 = new Array<>(); + private final static Seq outArray1 = new Seq<>(); + private final static Seq outArray2 = new Seq<>(); private final static IntSet closedSet = new IntSet(); private final ObjectSet producers = new ObjectSet<>(); diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index 15409f8408..2731b84cb9 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -23,7 +23,7 @@ public class Drill extends Block{ public float hardnessDrillMultiplier = 50f; protected final ObjectIntMap oreCount = new ObjectIntMap<>(); - protected final Array itemArray = new Array<>(); + protected final Seq itemArray = new Seq<>(); /** Maximum tier of blocks this drill can mine. */ public int tier; @@ -138,7 +138,7 @@ public class Drill extends Block{ super.setStats(); stats.add(BlockStat.drillTier, table -> { - Array list = content.blocks().select(b -> b.isFloor() && b.asFloor().itemDrop != null && b.asFloor().itemDrop.hardness <= tier); + Seq list = content.blocks().select(b -> b.isFloor() && b.asFloor().itemDrop != null && b.asFloor().itemDrop.hardness <= tier); table.table(l -> { l.left(); diff --git a/core/src/mindustry/world/blocks/units/UnitFactory.java b/core/src/mindustry/world/blocks/units/UnitFactory.java index 0bac7424bb..e27c319f65 100644 --- a/core/src/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/mindustry/world/blocks/units/UnitFactory.java @@ -122,7 +122,7 @@ public class UnitFactory extends UnitBlock{ @Override public void buildConfiguration(Table table){ - Array units = Array.with(plans).map(u -> u.unit); + Seq units = Seq.with(plans).map(u -> u.unit); ItemSelection.buildTable(table, units, () -> currentPlan == -1 ? null : plans[currentPlan].unit, unit -> configure(units.indexOf(unit))); } diff --git a/core/src/mindustry/world/consumers/ConsumeLiquidFilter.java b/core/src/mindustry/world/consumers/ConsumeLiquidFilter.java index e582d2eb2c..962986905a 100644 --- a/core/src/mindustry/world/consumers/ConsumeLiquidFilter.java +++ b/core/src/mindustry/world/consumers/ConsumeLiquidFilter.java @@ -29,7 +29,7 @@ public class ConsumeLiquidFilter extends ConsumeLiquidBase{ @Override public void build(Tilec tile, Table table){ - Array list = content.liquids().select(l -> !l.isHidden() && filter.get(l)); + Seq list = content.liquids().select(l -> !l.isHidden() && filter.get(l)); MultiReqImage image = new MultiReqImage(); list.each(liquid -> image.add(new ReqImage(liquid.icon(Cicon.medium), () -> tile.liquids() != null && tile.liquids().get(liquid) >= use(tile)))); diff --git a/core/src/mindustry/world/meta/BlockStats.java b/core/src/mindustry/world/meta/BlockStats.java index c5f1dc0f5b..2917a92aa3 100644 --- a/core/src/mindustry/world/meta/BlockStats.java +++ b/core/src/mindustry/world/meta/BlockStats.java @@ -9,7 +9,7 @@ import mindustry.world.meta.values.*; /** Hold and organizes a list of block stats. */ public class BlockStats{ - private final OrderedMap>> map = new OrderedMap<>(); + private final OrderedMap>> map = new OrderedMap<>(); private boolean dirty; /** Adds a single float value with this stat, formatted to 2 decimal places. */ @@ -59,7 +59,7 @@ public class BlockStats{ map.put(stat.category, new OrderedMap<>()); } - map.get(stat.category).get(stat, Array::new).add(value); + map.get(stat.category).get(stat, Seq::new).add(value); dirty = true; } @@ -75,11 +75,11 @@ public class BlockStats{ dirty = true; } - public OrderedMap>> toMap(){ + public OrderedMap>> toMap(){ //sort stats by index if they've been modified if(dirty){ map.orderedKeys().sort(); - for(Entry>> entry : map.entries()){ + for(Entry>> entry : map.entries()){ entry.value.orderedKeys().sort(); } diff --git a/core/src/mindustry/world/meta/Producers.java b/core/src/mindustry/world/meta/Producers.java index eaa52f76cf..c54a5172f5 100644 --- a/core/src/mindustry/world/meta/Producers.java +++ b/core/src/mindustry/world/meta/Producers.java @@ -4,7 +4,7 @@ import arc.struct.*; import mindustry.gen.*; public class Producers{ - private Array producers = new Array<>(); + private Seq producers = new Seq<>(); public void add(Produce prod){ producers.add(prod); diff --git a/core/src/mindustry/world/meta/values/ItemFilterValue.java b/core/src/mindustry/world/meta/values/ItemFilterValue.java index 72928e173f..8f9420ff95 100644 --- a/core/src/mindustry/world/meta/values/ItemFilterValue.java +++ b/core/src/mindustry/world/meta/values/ItemFilterValue.java @@ -1,6 +1,6 @@ package mindustry.world.meta.values; -import arc.struct.Array; +import arc.struct.Seq; import arc.func.Boolf; import arc.scene.ui.layout.Table; import mindustry.type.Item; @@ -18,7 +18,7 @@ public class ItemFilterValue implements StatValue{ @Override public void display(Table table){ - Array list = content.items().select(filter); + Seq list = content.items().select(filter); for(int i = 0; i < list.size; i++){ Item item = list.get(i); diff --git a/core/src/mindustry/world/meta/values/LiquidFilterValue.java b/core/src/mindustry/world/meta/values/LiquidFilterValue.java index 9e44f97ed2..a88a912981 100644 --- a/core/src/mindustry/world/meta/values/LiquidFilterValue.java +++ b/core/src/mindustry/world/meta/values/LiquidFilterValue.java @@ -1,6 +1,6 @@ package mindustry.world.meta.values; -import arc.struct.Array; +import arc.struct.Seq; import arc.func.Boolf; import arc.scene.ui.layout.Table; import mindustry.type.Liquid; @@ -22,7 +22,7 @@ public class LiquidFilterValue implements StatValue{ @Override public void display(Table table){ - Array list = new Array<>(); + Seq list = new Seq<>(); for(Liquid item : content.liquids()){ if(!item.isHidden() && filter.get(item)) list.add(item); diff --git a/core/src/mindustry/world/modules/PowerModule.java b/core/src/mindustry/world/modules/PowerModule.java index ac503ab825..6f05f94304 100644 --- a/core/src/mindustry/world/modules/PowerModule.java +++ b/core/src/mindustry/world/modules/PowerModule.java @@ -1,6 +1,6 @@ package mindustry.world.modules; -import arc.struct.IntArray; +import arc.struct.IntSeq; import arc.util.io.*; import mindustry.world.blocks.power.PowerGraph; @@ -12,7 +12,7 @@ public class PowerModule extends BlockModule{ */ public float status = 0.0f; public PowerGraph graph = new PowerGraph(); - public IntArray links = new IntArray(); + public IntSeq links = new IntSeq(); @Override public void write(Writes write){ diff --git a/desktop/src/mindustry/desktop/DesktopLauncher.java b/desktop/src/mindustry/desktop/DesktopLauncher.java index 4fda014cac..bae54f56b2 100644 --- a/desktop/src/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/mindustry/desktop/DesktopLauncher.java @@ -53,7 +53,7 @@ public class DesktopLauncher extends ClientLauncher{ public DesktopLauncher(String[] args){ Version.init(); boolean useSteam = Version.modifier.contains("steam"); - testMobile = Array.with(args).contains("-testMobile"); + testMobile = Seq.with(args).contains("-testMobile"); if(useDiscord){ try{ @@ -196,7 +196,7 @@ public class DesktopLauncher extends ClientLauncher{ } @Override - public Array getWorkshopContent(Class type){ + public Seq getWorkshopContent(Class type){ return !steam ? super.getWorkshopContent(type) : SVars.workshop.getWorkshopFiles(type); } diff --git a/desktop/src/mindustry/desktop/steam/SNet.java b/desktop/src/mindustry/desktop/steam/SNet.java index 00ba48b970..0da2fcdfa9 100644 --- a/desktop/src/mindustry/desktop/steam/SNet.java +++ b/desktop/src/mindustry/desktop/steam/SNet.java @@ -298,7 +298,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, Log.info("found @ matches @", matches, lobbyDoneCallback); if(lobbyDoneCallback != null){ - Array hosts = new Array<>(); + Seq hosts = new Seq<>(); for(int i = 0; i < matches; i++){ try{ SteamID lobby = smat.getLobbyByIndex(i); diff --git a/desktop/src/mindustry/desktop/steam/SWorkshop.java b/desktop/src/mindustry/desktop/steam/SWorkshop.java index 9f064db597..8475d8d720 100644 --- a/desktop/src/mindustry/desktop/steam/SWorkshop.java +++ b/desktop/src/mindustry/desktop/steam/SWorkshop.java @@ -21,9 +21,9 @@ import static mindustry.Vars.*; public class SWorkshop implements SteamUGCCallback{ public final SteamUGC ugc = new SteamUGC(this); - private ObjectMap, Array> workshopFiles = new ObjectMap<>(); - private ObjectMap, SteamResult>> detailHandlers = new ObjectMap<>(); - private Array> itemHandlers = new Array<>(); + private ObjectMap, Seq> workshopFiles = new ObjectMap<>(); + private ObjectMap, SteamResult>> detailHandlers = new ObjectMap<>(); + private Seq> itemHandlers = new Seq<>(); private ObjectMap updatedHandlers = new ObjectMap<>(); public SWorkshop(){ @@ -32,7 +32,7 @@ public class SWorkshop implements SteamUGCCallback{ ItemInstallInfo info = new ItemInstallInfo(); ugc.getSubscribedItems(ids); - Array folders = Array.with(ids).map(f -> { + Seq folders = Seq.with(ids).map(f -> { ugc.getItemInstallInfo(f, info); return new Fi(info.getFolder()); }).select(f -> f != null && f.list().length > 0); @@ -50,8 +50,8 @@ public class SWorkshop implements SteamUGCCallback{ }); } - public Array getWorkshopFiles(Class type){ - return workshopFiles.get(type, () -> new Array<>(0)); + public Seq getWorkshopFiles(Class type){ + return workshopFiles.get(type, () -> new Seq<>(0)); } /** Publish a new item and submit an update for it. @@ -158,7 +158,7 @@ public class SWorkshop implements SteamUGCCallback{ ugc.setItemDescription(h, p.steamDescription()); } - Array tags = p.extraTags(); + Seq tags = p.extraTags(); tags.add(p.steamTag()); ugc.setItemTitle(h, p.steamTitle()); @@ -195,7 +195,7 @@ public class SWorkshop implements SteamUGCCallback{ dialog.show(); } - void query(SteamUGCQuery query, Cons2, SteamResult> handler){ + void query(SteamUGCQuery query, Cons2, SteamResult> handler){ Log.info("POST QUERY " + query); detailHandlers.put(query, handler); ugc.sendQueryUGCRequest(query); @@ -241,7 +241,7 @@ public class SWorkshop implements SteamUGCCallback{ Log.info("Query being handled..."); if(numResultsReturned > 0){ Log.info("@ q results", numResultsReturned); - Array details = new Array<>(); + Seq details = new Seq<>(); for(int i = 0; i < numResultsReturned; i++){ details.add(new SteamUGCDetails()); ugc.getQueryUGCResult(query, i, details.get(i)); @@ -249,7 +249,7 @@ public class SWorkshop implements SteamUGCCallback{ detailHandlers.get(query).get(details, result); }else{ Log.info("Nothing found."); - detailHandlers.get(query).get(new Array<>(), SteamResult.FileNotFound); + detailHandlers.get(query).get(new Seq<>(), SteamResult.FileNotFound); } detailHandlers.remove(query); diff --git a/gradle.properties b/gradle.properties index 2133fb65f2..c3e4aee29d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=d0768a3a00f62a343a52910241be649456a7f0eb +archash=a91b070e283deff33c57f2bd6b2ec6f93c803fa3 diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 96ea86692e..b3d9dd638e 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -3,7 +3,7 @@ package mindustry.server; import arc.*; import arc.files.*; import arc.struct.*; -import arc.struct.Array.*; +import arc.struct.Seq.*; import arc.util.ArcAnnotate.*; import arc.util.*; import arc.util.Timer; @@ -85,7 +85,7 @@ public class ServerControl implements ApplicationListener{ registerCommands(); Core.app.post(() -> { - Array commands = new Array<>(); + Seq commands = new Seq<>(); if(args.length > 0){ commands.addAll(Strings.join(" ", args).split(",")); @@ -616,7 +616,7 @@ public class ServerControl implements ApplicationListener{ }); handler.register("bans", "List all banned IPs and IDs.", arg -> { - Array bans = netServer.admins.getBanned(); + Seq bans = netServer.admins.getBanned(); if(bans.size == 0){ info("No ID-banned players have been found."); @@ -627,7 +627,7 @@ public class ServerControl implements ApplicationListener{ } } - Array ipbans = netServer.admins.getBannedIPs(); + Seq ipbans = netServer.admins.getBannedIPs(); if(ipbans.size == 0){ info("No IP-banned players have been found."); @@ -699,7 +699,7 @@ public class ServerControl implements ApplicationListener{ }); handler.register("admins", "List all admins.", arg -> { - Array admins = netServer.admins.getAdmins(); + Seq admins = netServer.admins.getAdmins(); if(admins.size == 0){ info("No admins have been found."); @@ -879,7 +879,7 @@ public class ServerControl implements ApplicationListener{ private void play(boolean wait, Runnable run){ inExtraRound = true; Runnable r = () -> { - Array players = new Array<>(); + Seq players = new Seq<>(); for(Playerc p : Groups.player){ players.add(p); p.clearUnit(); @@ -897,7 +897,7 @@ public class ServerControl implements ApplicationListener{ p.reset(); if(state.rules.pvp){ - p.team(netServer.assignTeam(p, new ArrayIterable<>(players))); + p.team(netServer.assignTeam(p, new SeqIterable<>(players))); } netServer.sendWorldData(p); } diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index 6cfc6bf7cf..d36fbc6f0f 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -369,7 +369,7 @@ public class ApplicationTests{ world.tile(0, 0).setBlock(Blocks.itemSource); world.tile(0, 0).entity.configureAny(Items.copper); - Array entities = Array.with(world.tile(0, 0).entity); + Seq entities = Seq.with(world.tile(0, 0).entity); for(int i = 0; i < length; i++){ world.tile(i + 1, 0).setBlock(Blocks.conveyor); @@ -429,13 +429,13 @@ public class ApplicationTests{ @Test void arrayIterators(){ - Array arr = Array.with("a", "b" , "c", "d", "e", "f"); - Array results = new Array<>(); + Seq arr = Seq.with("a", "b" , "c", "d", "e", "f"); + Seq results = new Seq<>(); for(String s : arr); for(String s : results); - Array.iteratorsAllocated = 0; + Seq.iteratorsAllocated = 0; //simulate non-enhanced for loops, which should be correct @@ -455,7 +455,7 @@ public class ApplicationTests{ } assertEquals(results.size, index); - assertEquals(0, Array.iteratorsAllocated, "No new iterators must have been allocated."); + assertEquals(0, Seq.iteratorsAllocated, "No new iterators must have been allocated."); } @Test diff --git a/tests/src/test/java/SectorTests.java b/tests/src/test/java/SectorTests.java index 68cb6793c7..c4ded0a4bd 100644 --- a/tests/src/test/java/SectorTests.java +++ b/tests/src/test/java/SectorTests.java @@ -30,7 +30,7 @@ public class SectorTests{ @TestFactory DynamicTest[] testZoneValidity(){ - Array out = new Array<>(); + Seq out = new Seq<>(); if(world == null) world = new World(); for(SectorPreset zone : content.sectors()){ @@ -57,7 +57,7 @@ public class SectorTests{ } } - Array spawns = state.rules.spawns; + Seq spawns = state.rules.spawns; int bossWave = 0; outer: diff --git a/tools/build.gradle b/tools/build.gradle index baa2953413..5d1e6440b2 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -114,7 +114,7 @@ def medianBlur = { File file -> def image = ImageIO.read(file) def result = new BufferedImage(image.width, image.height, BufferedImage.TYPE_INT_ARGB) def radius = 4 - IntArray array = new IntArray() + IntSeq array = new IntSeq() def getRGB = { int ix, int iy -> return image.getRGB(Math.max(Math.min(ix, image.width - 1), 0), Math.max(Math.min(iy, image.height - 1), 0)) diff --git a/tools/src/mindustry/tools/BundleLauncher.java b/tools/src/mindustry/tools/BundleLauncher.java index a52ea5fb31..fe1484175a 100644 --- a/tools/src/mindustry/tools/BundleLauncher.java +++ b/tools/src/mindustry/tools/BundleLauncher.java @@ -11,9 +11,9 @@ public class BundleLauncher{ public static void main(String[] args){ OrderedMap base = new OrderedMap<>(); PropertiesUtils.load(base, Fi.get("bundle.properties").reader()); - Array removals = new Array<>(); + Seq removals = new Seq<>(); String str = Fi.get("bundle.properties").readString(); - ObjectSet newlines = Array.with(str.split("\n")).select(l -> l.contains(" = ") && str.indexOf(l) + l.length() < str.length() - 2 && str.charAt(str.indexOf(l) + l.length() + 1) == '\n').map(l -> l.split(" = ")[0]).asSet(); + ObjectSet newlines = Seq.with(str.split("\n")).select(l -> l.contains(" = ") && str.indexOf(l) + l.length() < str.length() - 2 && str.charAt(str.indexOf(l) + l.length() + 1) == '\n').map(l -> l.split(" = ")[0]).asSet(); Fi.get(".").walk(child -> { if(child.name().equals("bundle.properties") || child.toString().contains("output")) return; diff --git a/tools/src/mindustry/tools/Edgifier.java b/tools/src/mindustry/tools/Edgifier.java index abbd649281..f83694d13a 100644 --- a/tools/src/mindustry/tools/Edgifier.java +++ b/tools/src/mindustry/tools/Edgifier.java @@ -17,7 +17,7 @@ public class Edgifier{ private static Pixmap edgify(Pixmap in, int chunk){ Pixmap out = new Pixmap(in.getWidth(), in.getHeight()); - IntArray side1 = new IntArray(), side2 = new IntArray(); + IntSeq side1 = new IntSeq(), side2 = new IntSeq(); for(int x = 0; x < in.getWidth(); x += chunk){ for(int y = 0; y < in.getHeight(); y += chunk){ diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 7efaa8ef76..9f776e3d37 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -229,7 +229,7 @@ public class Generators{ }); ImagePacker.generate("item-icons", () -> { - for(UnlockableContent item : (Array)(Array)Array.withArrays(content.items(), content.liquids())){ + for(UnlockableContent item : (Seq)(Seq)Seq.withArrays(content.items(), content.liquids())){ Image base = ImagePacker.get(item.getContentType().name() + "-" + item.name); for(Cicon icon : Cicon.scaled){ //if(icon.size == base.width) continue; diff --git a/tools/src/mindustry/tools/ImagePacker.java b/tools/src/mindustry/tools/ImagePacker.java index 38754c0935..16687d8875 100644 --- a/tools/src/mindustry/tools/ImagePacker.java +++ b/tools/src/mindustry/tools/ImagePacker.java @@ -109,7 +109,7 @@ public class ImagePacker{ ObjectMap content2id = new ObjectMap<>(); map.each((key, val) -> content2id.put(val.split("\\|")[0], key)); - Array cont = Array.withArrays(Vars.content.blocks(), Vars.content.items(), Vars.content.liquids()); + Seq cont = Seq.withArrays(Vars.content.blocks(), Vars.content.items(), Vars.content.liquids()); cont.removeAll(u -> u instanceof BuildBlock || u == Blocks.air); int minid = 0xF8FF; diff --git a/tools/src/mindustry/tools/ScriptStubGenerator.java b/tools/src/mindustry/tools/ScriptStubGenerator.java index 50426ec79f..560047b112 100644 --- a/tools/src/mindustry/tools/ScriptStubGenerator.java +++ b/tools/src/mindustry/tools/ScriptStubGenerator.java @@ -1,7 +1,7 @@ package mindustry.tools; import arc.*; -import arc.struct.Array; +import arc.struct.Seq; import arc.struct.*; import arc.files.*; import arc.graphics.*; @@ -23,13 +23,13 @@ public class ScriptStubGenerator{ public static void main(String[] args) throws Exception{ String base = "mindustry"; - Array blacklist = Array.with("plugin", "mod", "net", "io", "tools"); - Array nameBlacklist = Array.with("ClassAccess"); - Array> whitelist = Array.with(Draw.class, Fill.class, Lines.class, Core.class, TextureAtlas.class, TextureRegion.class, Time.class, System.class, PrintStream.class, + Seq blacklist = Seq.with("plugin", "mod", "net", "io", "tools"); + Seq nameBlacklist = Seq.with("ClassAccess"); + Seq> whitelist = Seq.with(Draw.class, Fill.class, Lines.class, Core.class, TextureAtlas.class, TextureRegion.class, Time.class, System.class, PrintStream.class, AtlasRegion.class, String.class, Mathf.class, Angles.class, Color.class, Runnable.class, Object.class, Icon.class, Tex.class, Sounds.class, Musics.class, Call.class, Texture.class, TextureData.class, Pixmap.class, I18NBundle.class, Interval.class, DataInput.class, DataOutput.class, DataInputStream.class, DataOutputStream.class, Integer.class, Float.class, Double.class, Long.class, Boolean.class, Short.class, Byte.class, Character.class); - Array nopackage = Array.with("java.lang", "java"); + Seq nopackage = Seq.with("java.lang", "java"); List classLoadersList = new LinkedList<>(); classLoadersList.add(ClasspathHelper.contextClassLoader()); @@ -46,7 +46,7 @@ public class ScriptStubGenerator{ .include(FilterBuilder.prefix("arc.math")) )); - Array> classes = Array.with(reflections.getSubTypesOf(Object.class)); + Seq> classes = Seq.with(reflections.getSubTypesOf(Object.class)); classes.addAll(reflections.getSubTypesOf(Enum.class)); classes.addAll(whitelist); classes.sort(Structs.comparing(Class::getName)); diff --git a/tools/src/mindustry/tools/SectorDataGenerator.java b/tools/src/mindustry/tools/SectorDataGenerator.java index 144734f6b0..84c2e56263 100644 --- a/tools/src/mindustry/tools/SectorDataGenerator.java +++ b/tools/src/mindustry/tools/SectorDataGenerator.java @@ -4,6 +4,7 @@ import arc.*; import arc.files.*; import arc.mock.*; import arc.struct.*; +import arc.struct.ObjectIntMap.*; import arc.util.*; import arc.util.io.*; import mindustry.*; @@ -45,7 +46,7 @@ public class SectorDataGenerator{ Fi fi = Fi.get("planets").child(planet.name + ".dat"); - Array list = planet.sectors.map(sector -> { + Seq list = planet.sectors.map(sector -> { SectorData data = new SectorData(); ObjectIntMap floors = new ObjectIntMap<>(); @@ -105,7 +106,7 @@ public class SectorDataGenerator{ } //sort counts in descending order - Array> entries = floors.entries().toArray(); + Seq> entries = floors.entries().toArray(); entries.sort(e -> -e.value); //remove all blocks occuring < 30 times - unimportant entries.removeAll(e -> e.value < 30);