More cleanup
This commit is contained in:
@@ -489,7 +489,7 @@ public class Block extends BlockStorage{
|
||||
|
||||
/** Update table alignment after configuring.*/
|
||||
public void updateTableAlign(Tile tile, Table table){
|
||||
Vector2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() - tile.block().size * tilesize / 2f - 1);
|
||||
Vec2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() - tile.block().size * tilesize / 2f - 1);
|
||||
table.setPosition(pos.x, pos.y, Align.top);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package mindustry.world;
|
||||
|
||||
import arc.struct.Array;
|
||||
import arc.math.Mathf;
|
||||
import arc.math.geom.Vector2;
|
||||
import arc.math.geom.Vec2;
|
||||
import arc.util.*;
|
||||
import mindustry.Vars;
|
||||
import mindustry.content.Fx;
|
||||
@@ -83,7 +83,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
||||
}
|
||||
|
||||
/** Returns offset for stack placement. */
|
||||
public void getStackOffset(Item item, Tile tile, Vector2 trns){
|
||||
public void getStackOffset(Item item, Tile tile, Vec2 trns){
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class Edges{
|
||||
private static final int maxRadius = 12;
|
||||
private static Point2[][] edges = new Point2[maxSize][0];
|
||||
private static Point2[][] edgeInside = new Point2[maxSize][0];
|
||||
private static Vector2[][] polygons = new Vector2[maxRadius * 2][0];
|
||||
private static Vec2[][] polygons = new Vec2[maxRadius * 2][0];
|
||||
|
||||
static{
|
||||
for(int i = 0; i < maxRadius * 2; i++){
|
||||
@@ -60,7 +60,7 @@ public class Edges{
|
||||
tiley + Mathf.clamp(other.y - tiley, -(size - 1) / 2, (size / 2)));
|
||||
}
|
||||
|
||||
public static Vector2[] getPixelPolygon(float radius){
|
||||
public static Vec2[] getPixelPolygon(float radius){
|
||||
if(radius < 1 || radius > maxRadius)
|
||||
throw new RuntimeException("Polygon size must be between 1 and " + maxRadius);
|
||||
return polygons[(int)(radius * 2) - 1];
|
||||
|
||||
@@ -449,8 +449,8 @@ public class Tile implements Position, TargetTrait{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector2 velocity(){
|
||||
return Vector2.ZERO;
|
||||
public Vec2 velocity(){
|
||||
return Vec2.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ public class DeflectorWall extends Wall{
|
||||
|
||||
bullet.hitbox(rect2);
|
||||
|
||||
Vector2 position = Geometry.raycastRect(bullet.x - bullet.velocity().x*Time.delta(), bullet.y - bullet.velocity().y*Time.delta(), bullet.x + bullet.velocity().x*Time.delta(), bullet.y + bullet.velocity().y*Time.delta(),
|
||||
Vec2 position = Geometry.raycastRect(bullet.x - bullet.velocity().x*Time.delta(), bullet.y - bullet.velocity().y*Time.delta(), bullet.x + bullet.velocity().x*Time.delta(), bullet.y + bullet.velocity().y*Time.delta(),
|
||||
rect.setSize(size * tilesize + rect2.width*2 + rect2.height*2).setCenter(entity.x, entity.y));
|
||||
|
||||
if(position != null){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mindustry.world.blocks.defense.turrets;
|
||||
|
||||
import arc.math.Mathf;
|
||||
import arc.math.geom.Vector2;
|
||||
import arc.math.geom.Vec2;
|
||||
import mindustry.entities.Predict;
|
||||
import mindustry.entities.type.Bullet;
|
||||
import mindustry.entities.bullet.BulletType;
|
||||
@@ -31,7 +31,7 @@ public class ArtilleryTurret extends ItemTurret{
|
||||
|
||||
tr.trns(entity.rotation, size * tilesize / 2);
|
||||
|
||||
Vector2 predict = Predict.intercept(tile, entity.target, type.speed);
|
||||
Vec2 predict = Predict.intercept(tile, entity.target, type.speed);
|
||||
|
||||
float dst = entity.dst(predict.x, predict.y);
|
||||
float maxTraveled = type.lifetime * type.speed;
|
||||
|
||||
@@ -10,7 +10,7 @@ import arc.graphics.Color;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.Angles;
|
||||
import arc.math.Mathf;
|
||||
import arc.math.geom.Vector2;
|
||||
import arc.math.geom.Vec2;
|
||||
import arc.util.Time;
|
||||
import mindustry.content.Fx;
|
||||
import mindustry.entities.*;
|
||||
@@ -54,8 +54,8 @@ public abstract class Turret extends Block{
|
||||
public boolean targetAir = true;
|
||||
public boolean targetGround = true;
|
||||
|
||||
protected Vector2 tr = new Vector2();
|
||||
protected Vector2 tr2 = new Vector2();
|
||||
protected Vec2 tr = new Vec2();
|
||||
protected Vec2 tr2 = new Vec2();
|
||||
|
||||
public TextureRegion baseRegion, heatRegion;
|
||||
|
||||
@@ -162,7 +162,7 @@ public abstract class Turret extends Block{
|
||||
float speed = type.speed;
|
||||
if(speed < 0.1f) speed = 9999999f;
|
||||
|
||||
Vector2 result = Predict.intercept(entity, entity.target, speed);
|
||||
Vec2 result = Predict.intercept(entity, entity.target, speed);
|
||||
if(result.isZero()){
|
||||
result.set(entity.target.getX(), entity.target.getY());
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ public class Conveyor extends Block implements Autotiler{
|
||||
private static ItemPos drawpos = new ItemPos();
|
||||
private static ItemPos pos1 = new ItemPos();
|
||||
private static ItemPos pos2 = new ItemPos();
|
||||
private final Vector2 tr1 = new Vector2();
|
||||
private final Vector2 tr2 = new Vector2();
|
||||
private final Vec2 tr1 = new Vec2();
|
||||
private final Vec2 tr2 = new Vec2();
|
||||
private TextureRegion[][] regions = new TextureRegion[7][4];
|
||||
|
||||
public float speed = 0f;
|
||||
@@ -283,7 +283,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getStackOffset(Item item, Tile tile, Vector2 trns){
|
||||
public void getStackOffset(Item item, Tile tile, Vec2 trns){
|
||||
trns.trns(tile.rotation() * 90 + 180f, tilesize / 2f);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ public class MessageBlock extends Block{
|
||||
|
||||
@Override
|
||||
public void updateTableAlign(Tile tile, Table table){
|
||||
Vector2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() + tile.block().size * tilesize / 2f + 1);
|
||||
Vec2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() + tile.block().size * tilesize / 2f + 1);
|
||||
table.setPosition(pos.x, pos.y, Align.bottom);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import static mindustry.Vars.*;
|
||||
public class NuclearReactor extends PowerGenerator{
|
||||
public final int timerFuel = timers++;
|
||||
|
||||
public final Vector2 tr = new Vector2();
|
||||
public final Vec2 tr = new Vec2();
|
||||
|
||||
public Color lightColor = Color.valueOf("7f19ea");
|
||||
public Color coolColor = new Color(1, 1, 1, 0f);
|
||||
|
||||
@@ -22,7 +22,7 @@ public class PowerNode extends PowerBlock{
|
||||
protected static boolean returnValue = false;
|
||||
|
||||
protected final ObjectSet<PowerGraph> graphs = new ObjectSet<>();
|
||||
protected final Vector2 t1 = new Vector2(), t2 = new Vector2();
|
||||
protected final Vec2 t1 = new Vec2(), t2 = new Vec2();
|
||||
|
||||
public TextureRegion laser, laserEnd;
|
||||
public float laserRange = 6;
|
||||
|
||||
Reference in New Issue
Block a user