mmmmthock, yum yum thock (remove xy buildables)
parent
54229b1f2e
commit
04eaf1434f
|
|
@ -22,18 +22,6 @@ public abstract class Designation<T extends ISelectable> extends GameObject impl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void buildAt(int x, int y) {
|
||||
Class<T> type = getType();
|
||||
List<T> things = getAll(type);
|
||||
for(ISelectable thing : things) {
|
||||
Vector4f box = thing.getWorldBox();
|
||||
if(rectanglesIntersect(x, y, x + 1, y + 1, box.x, box.y, box.z, box.w))
|
||||
designate((T) thing);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean rectanglesIntersect(
|
||||
float minAx, float minAy, float maxAx, float maxAy,
|
||||
float minBx, float minBy, float maxBx, float maxBy ) {
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ public class BuildTab extends Tab implements ISelectionChangeListener, IBuildLay
|
|||
if(building instanceof GameObject) {
|
||||
add((GameObject) building);
|
||||
}
|
||||
building.buildAt(x1, y1);
|
||||
building.buildAt(x1, y1, 1, 1);
|
||||
} catch (Exception e) {
|
||||
DebugTab.log(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,6 @@ public abstract class Buildable extends WorldObject implements IBuildable, ITile
|
|||
setPosition(x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildAt(int x, int y) {
|
||||
Vector2i dim = getDimensions();
|
||||
setPosition(x, y, dim.x, dim.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlaced(Tile tile) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@ import xyz.valnet.hadean.util.detail.PercentDetail;
|
|||
|
||||
public class Tree extends WorldObject implements ITileThing, ISelectable, IWorkable {
|
||||
|
||||
private static int counter = 0;
|
||||
private String name = "Tree " + (++ counter);
|
||||
|
||||
private Job chopJob = null;
|
||||
|
||||
public Tree(int x, int y) {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package xyz.valnet.hadean.interfaces;
|
|||
public interface IBuildable {
|
||||
|
||||
public void buildAt(int x, int y, int w, int h);
|
||||
@Deprecated
|
||||
public void buildAt(int x, int y);
|
||||
|
||||
public String getBuildTabCategory();
|
||||
public BuildType getBuildType();
|
||||
|
|
|
|||
Loading…
Reference in New Issue