Seq.
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user