worldarea: allow WorldArea to take 2 WorldPoints and calculate width and height

This commit is contained in:
illumineawake
2020-05-21 18:15:30 +10:00
parent 04f926b747
commit fac4cafcf0

View File

@@ -88,6 +88,15 @@ public class WorldArea
this.height = height;
}
public WorldArea(WorldPoint swLocation, WorldPoint neLocation)
{
this.x = swLocation.getX();
this.y = swLocation.getY();
this.plane = swLocation.getPlane();
this.width = neLocation.getX() - swLocation.getX();
this.height = neLocation.getY() - swLocation.getY();
}
/**
* Computes the shortest distance to another area.
*