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/utils/math/constraints/rect/RectDigest.java

42 lines
894 B

package mightypork.utils.math.constraints.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) {
final RectConst frozen = rect.freeze();
this.x = frozen.x().value();
this.y = frozen.y().value();
this.width = frozen.width().value();
this.height = frozen.height().value();
this.left = frozen.left().value();
this.right = frozen.right().value();
this.top = frozen.top().value();
this.bottom = frozen.bottom().value();
}
@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);
}
}