Record Class Bounds
java.lang.Object
java.lang.Record
dev.despical.mazeengine.core.Bounds
Describes an inclusive block volume and its indexed traversal coordinates.
The origin is the minimum block corner and dimensions count blocks, including the maximum faces. Construction requires positive dimensions and checks maximum-coordinate arithmetic so a region cannot wrap around integer limits.
Indexed conversion visits X within each Z row, then advances the Y layer. Grid sizing helpers convert between logical cell counts and structural block spans. Bounds contains no world identity; callers compare worlds separately when checking overlap or locating a saved maze.
-
Constructor Summary
ConstructorsConstructorDescriptionBounds(int x, int y, int z, int width, int height, int depth) Creates an instance of aBoundsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.static intfit(int blocks, int path, int wall) final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.intlocalX(long index) intlocalY(long index) intlocalZ(long index) intmaxX()intmaxY()intmaxZ()booleanstatic intspan(int cells, int path, int wall) final StringtoString()Returns a string representation of this record class.longvolume()intwidth()Returns the value of thewidthrecord component.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.intz()Returns the value of thezrecord component.
-
Constructor Details
-
Bounds
public Bounds(int x, int y, int z, int width, int height, int depth) Creates an instance of aBoundsrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentdepth- the value for thedepthrecord component
-
-
Method Details
-
volume
public long volume() -
maxX
public int maxX() -
maxY
public int maxY() -
maxZ
public int maxZ() -
overlaps
-
localX
public int localX(long index) -
localZ
public int localZ(long index) -
localY
public int localY(long index) -
span
public static int span(int cells, int path, int wall) -
fit
public static int fit(int blocks, int path, int wall) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
depth
public int depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-