Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/gamecore/util/math/constraints/rect/caching/RectDigest.java

41 lines
841 B

package mightypork.gamecore.util.math.constraints.rect.caching;
import mightypork.gamecore.util.math.constraints.rect.Rect;
public class RectDigest {
public final double x;
public final double y;
public final double width;
public final double height;
public final double left;
public final double right;
public final double top;
public final double bottom;
public RectDigest(Rect rect)
{
this.x = rect.origin().x();
this.y = rect.origin().y();
this.width = rect.size().x();
this.height = rect.size().y();
this.left = x;
this.right = x + width;
this.top = y;
this.bottom = y + height;
}
@Override
public String toString()
{
return String
.format("Rect{ at: (%.1f, %.1f), size: (%.1f, %.1f), bounds: L %.1f R %.1f T %.1f B %.1f }", x, y, width, height, left, right, top, bottom);
}
}