Seq.
This commit is contained in:
@@ -22,7 +22,7 @@ public class EntityCollisions{
|
||||
private Rect r2 = new Rect();
|
||||
|
||||
//entity collisions
|
||||
private Array<Hitboxc> arrOut = new Array<>();
|
||||
private Seq<Hitboxc> arrOut = new Seq<>();
|
||||
|
||||
public void move(Hitboxc entity, float deltax, float deltay){
|
||||
move(entity, deltax, deltay, EntityCollisions::solid);
|
||||
|
||||
@@ -15,8 +15,8 @@ import static mindustry.Vars.collisions;
|
||||
public class EntityGroup<T extends Entityc> implements Iterable<T>{
|
||||
private static int lastId = 0;
|
||||
|
||||
private final Array<T> array;
|
||||
private final Array<T> intersectArray = new Array<>();
|
||||
private final Seq<T> array;
|
||||
private final Seq<T> intersectArray = new Seq<>();
|
||||
private final Rect viewport = new Rect();
|
||||
private final Rect intersectRect = new Rect();
|
||||
private IntMap<T> map;
|
||||
@@ -30,7 +30,7 @@ public class EntityGroup<T extends Entityc> implements Iterable<T>{
|
||||
}
|
||||
|
||||
public EntityGroup(Class<T> 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<T extends Entityc> implements Iterable<T>{
|
||||
each(Entityc::update);
|
||||
}
|
||||
|
||||
public void copy(Array arr){
|
||||
public void copy(Seq arr){
|
||||
arr.addAll(array);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class EntityGroup<T extends Entityc> implements Iterable<T>{
|
||||
tree.intersect(height, x, y, width, out);
|
||||
}
|
||||
|
||||
public Array<T> intersect(float x, float y, float width, float height){
|
||||
public Seq<T> intersect(float x, float y, float width, float height){
|
||||
intersectArray.clear();
|
||||
//don't waste time for empty groups
|
||||
if(isEmpty()) return intersectArray;
|
||||
|
||||
@@ -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<Unitc> entities = new Array<>();
|
||||
private static final Seq<Unitc> 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<Vec2> lines = new Array<>();
|
||||
Seq<Vec2> lines = new Seq<>();
|
||||
bhit = false;
|
||||
|
||||
for(int i = 0; i < length / 2; i++){
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -11,12 +11,12 @@ import mindustry.gen.*;
|
||||
/** A unit that can command other units. */
|
||||
@Component
|
||||
abstract class CommanderComp implements Unitc{
|
||||
private static final Array<FormationMember> members = new Array<>();
|
||||
private static final Seq<FormationMember> members = new Seq<>();
|
||||
|
||||
@Import float x, y, rotation;
|
||||
|
||||
transient @Nullable Formation formation;
|
||||
transient Array<Unitc> controlling = new Array<>();
|
||||
transient Seq<Unitc> controlling = new Seq<>();
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
@@ -42,7 +42,7 @@ abstract class CommanderComp implements Unitc{
|
||||
clearCommand();
|
||||
}
|
||||
|
||||
void command(Formation formation, Array<Unitc> units){
|
||||
void command(Formation formation, Seq<Unitc> units){
|
||||
clearCommand();
|
||||
|
||||
controlling.addAll(units);
|
||||
|
||||
@@ -15,7 +15,7 @@ import mindustry.world.blocks.payloads.*;
|
||||
abstract class PayloadComp implements Posc, Rotc{
|
||||
@Import float x, y, rotation;
|
||||
|
||||
Array<Payload> payloads = new Array<>();
|
||||
Seq<Payload> payloads = new Seq<>();
|
||||
|
||||
boolean hasPayload(){
|
||||
return payloads.size > 0;
|
||||
|
||||
@@ -17,7 +17,7 @@ import static mindustry.Vars.content;
|
||||
|
||||
@Component
|
||||
abstract class StatusComp implements Posc, Flyingc{
|
||||
private Array<StatusEntry> statuses = new Array<>();
|
||||
private Seq<StatusEntry> statuses = new Seq<>();
|
||||
private transient Bits applied = new Bits(content.getBy(ContentType.status).size);
|
||||
|
||||
@ReadOnly transient float speedMultiplier, damageMultiplier, armorMultiplier;
|
||||
|
||||
@@ -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<Tilec> tmpTiles = new ObjectSet<>();
|
||||
static final Array<Tilec> tempTileEnts = new Array<>();
|
||||
static final Array<Tile> tempTiles = new Array<>();
|
||||
static final Seq<Tilec> tempTileEnts = new Seq<>();
|
||||
static final Seq<Tile> 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<Tilec> proximity = new Array<>(8);
|
||||
transient Seq<Tilec> 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<Tilec> proximity = proximity();
|
||||
Seq<Tilec> 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<Tilec> proximity = proximity();
|
||||
Seq<Tilec> 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<Tilec> proximity = proximity();
|
||||
Seq<Tilec> 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<Tilec> getPowerConnections(Array<Tilec> out){
|
||||
public Seq<Tilec> getPowerConnections(Seq<Tilec> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user