Seq.
This commit is contained in:
@@ -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<String> cacheRegionStrings = new Array<>();
|
||||
protected Seq<String> cacheRegionStrings = new Seq<>();
|
||||
|
||||
//TODO move
|
||||
public static TextureRegion[][] cracks;
|
||||
protected static final Array<Tile> tempTiles = new Array<>();
|
||||
protected static final Array<Tilec> tempTileEnts = new Array<>();
|
||||
protected static final Seq<Tile> tempTiles = new Seq<>();
|
||||
protected static final Seq<Tilec> 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<BuildRequest> requests){
|
||||
public Block getReplacement(BuildRequest req, Seq<BuildRequest> requests){
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<Tile> getLinkedTiles(Array<Tile> tmpArray){
|
||||
public Seq<Tile> getLinkedTiles(Seq<Tile> 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<Tile> getLinkedTilesAs(Block block, Array<Tile> tmpArray){
|
||||
public Seq<Tile> getLinkedTilesAs(Block block, Seq<Tile> tmpArray){
|
||||
tmpArray.clear();
|
||||
if(block.isMultiblock()){
|
||||
int offsetx = -(block.size - 1) / 2;
|
||||
|
||||
@@ -14,7 +14,7 @@ import static mindustry.Vars.*;
|
||||
public class ItemSelection{
|
||||
private static float scrollPos = 0f;
|
||||
|
||||
public static <T extends UnlockableContent> void buildTable(Table table, Array<T> items, Prov<T> holder, Cons<T> consumer){
|
||||
public static <T extends UnlockableContent> void buildTable(Table table, Seq<T> items, Prov<T> holder, Cons<T> consumer){
|
||||
|
||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||
group.setMinCheckCount(0);
|
||||
|
||||
@@ -113,7 +113,7 @@ public class LaunchPad extends Block{
|
||||
static abstract class LaunchPayloadComp implements Drawc, Timedc, Teamc{
|
||||
@Import float x,y;
|
||||
|
||||
Array<ItemStack> stacks = new Array<>();
|
||||
Seq<ItemStack> stacks = new Seq<>();
|
||||
transient Interval in = new Interval();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -139,7 +139,7 @@ public abstract class Turret extends Block{
|
||||
}
|
||||
|
||||
public class TurretEntity extends TileEntity implements ControlBlock{
|
||||
public Array<AmmoEntry> ammo = new Array<>();
|
||||
public Seq<AmmoEntry> ammo = new Seq<>();
|
||||
public int totalAmmo;
|
||||
public float reload, rotation = 90, recoil, heat;
|
||||
public int shotCounter;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getReplacement(BuildRequest req, Array<BuildRequest> requests){
|
||||
public Block getReplacement(BuildRequest req, Seq<BuildRequest> requests){
|
||||
Boolf<Point2> 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)) &&
|
||||
|
||||
@@ -64,7 +64,7 @@ public class Floor extends Block{
|
||||
public Block decoration = Blocks.air;
|
||||
|
||||
protected TextureRegion[][] edges;
|
||||
protected Array<Block> blenders = new Array<>();
|
||||
protected Seq<Block> blenders = new Seq<>();
|
||||
protected IntSet blended = new IntSet();
|
||||
protected TextureRegion edgeRegion;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class BlockForge extends PayloadAcceptor{
|
||||
|
||||
@Override
|
||||
public void buildConfiguration(Table table){
|
||||
Array<Block> blocks = Vars.content.blocks().select(b -> b.isVisible() && b.size <= 2);
|
||||
Seq<Block> blocks = Vars.content.blocks().select(b -> b.isVisible() && b.size <= 2);
|
||||
|
||||
ItemSelection.buildTable(table, blocks, () -> recipe, block -> recipe = block);
|
||||
}
|
||||
|
||||
@@ -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<Tilec> network = new Array<>();
|
||||
Seq<Tilec> network = new Seq<>();
|
||||
|
||||
@Override
|
||||
public boolean onConfigureTileTapped(Tilec other){
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getReplacement(BuildRequest req, Array<BuildRequest> requests){
|
||||
public Block getReplacement(BuildRequest req, Seq<BuildRequest> requests){
|
||||
Boolf<Point2> 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)) &&
|
||||
|
||||
@@ -9,8 +9,8 @@ import mindustry.world.consumers.*;
|
||||
|
||||
public class PowerGraph{
|
||||
private final static Queue<Tilec> queue = new Queue<>();
|
||||
private final static Array<Tilec> outArray1 = new Array<>();
|
||||
private final static Array<Tilec> outArray2 = new Array<>();
|
||||
private final static Seq<Tilec> outArray1 = new Seq<>();
|
||||
private final static Seq<Tilec> outArray2 = new Seq<>();
|
||||
private final static IntSet closedSet = new IntSet();
|
||||
|
||||
private final ObjectSet<Tilec> producers = new ObjectSet<>();
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Drill extends Block{
|
||||
public float hardnessDrillMultiplier = 50f;
|
||||
|
||||
protected final ObjectIntMap<Item> oreCount = new ObjectIntMap<>();
|
||||
protected final Array<Item> itemArray = new Array<>();
|
||||
protected final Seq<Item> 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<Block> list = content.blocks().select(b -> b.isFloor() && b.asFloor().itemDrop != null && b.asFloor().itemDrop.hardness <= tier);
|
||||
Seq<Block> list = content.blocks().select(b -> b.isFloor() && b.asFloor().itemDrop != null && b.asFloor().itemDrop.hardness <= tier);
|
||||
|
||||
table.table(l -> {
|
||||
l.left();
|
||||
|
||||
@@ -122,7 +122,7 @@ public class UnitFactory extends UnitBlock{
|
||||
|
||||
@Override
|
||||
public void buildConfiguration(Table table){
|
||||
Array<UnitType> units = Array.with(plans).map(u -> u.unit);
|
||||
Seq<UnitType> units = Seq.with(plans).map(u -> u.unit);
|
||||
|
||||
ItemSelection.buildTable(table, units, () -> currentPlan == -1 ? null : plans[currentPlan].unit, unit -> configure(units.indexOf(unit)));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ConsumeLiquidFilter extends ConsumeLiquidBase{
|
||||
|
||||
@Override
|
||||
public void build(Tilec tile, Table table){
|
||||
Array<Liquid> list = content.liquids().select(l -> !l.isHidden() && filter.get(l));
|
||||
Seq<Liquid> 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))));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import mindustry.world.meta.values.*;
|
||||
|
||||
/** Hold and organizes a list of block stats. */
|
||||
public class BlockStats{
|
||||
private final OrderedMap<StatCategory, OrderedMap<BlockStat, Array<StatValue>>> map = new OrderedMap<>();
|
||||
private final OrderedMap<StatCategory, OrderedMap<BlockStat, Seq<StatValue>>> 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<StatCategory, OrderedMap<BlockStat, Array<StatValue>>> toMap(){
|
||||
public OrderedMap<StatCategory, OrderedMap<BlockStat, Seq<StatValue>>> toMap(){
|
||||
//sort stats by index if they've been modified
|
||||
if(dirty){
|
||||
map.orderedKeys().sort();
|
||||
for(Entry<StatCategory, OrderedMap<BlockStat, Array<StatValue>>> entry : map.entries()){
|
||||
for(Entry<StatCategory, OrderedMap<BlockStat, Seq<StatValue>>> entry : map.entries()){
|
||||
entry.value.orderedKeys().sort();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import arc.struct.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
public class Producers{
|
||||
private Array<Produce> producers = new Array<>();
|
||||
private Seq<Produce> producers = new Seq<>();
|
||||
|
||||
public void add(Produce prod){
|
||||
producers.add(prod);
|
||||
|
||||
@@ -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<Item> list = content.items().select(filter);
|
||||
Seq<Item> list = content.items().select(filter);
|
||||
|
||||
for(int i = 0; i < list.size; i++){
|
||||
Item item = list.get(i);
|
||||
|
||||
@@ -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<Liquid> list = new Array<>();
|
||||
Seq<Liquid> list = new Seq<>();
|
||||
|
||||
for(Liquid item : content.liquids()){
|
||||
if(!item.isHidden() && filter.get(item)) list.add(item);
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user