Record Class CellSize
java.lang.Object
java.lang.Record
dev.despical.mazeengine.api.model.CellSize
- Record Components:
width- the number of cells along X, at least twodepth- the number of cells along Z, at least two
Describes the dimensions of a logical maze grid.
Each axis contains at least two cells. The total cell count must fit in a signed int because graph storage and routing use integer cell indices.
This value counts graph cells, not Minecraft blocks. The occupied block volume also depends on the preset's corridor width, wall thickness, wall height, and roof. Configured server limits are checked at submission.
-
Constructor Summary
ConstructorsConstructorDescriptionCellSize(int width, int depth) Constructs grid dimensions supported by the graph representation. -
Method Summary
Modifier and TypeMethodDescriptionintcount()Returns the total number of cells in the logical grid.intdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
CellSize
public CellSize(int width, int depth) Constructs grid dimensions supported by the graph representation.- Parameters:
width- the number of columnsdepth- the number of rows- Throws:
IllegalArgumentException- if either axis is smaller than two or the total cell count exceedsInteger.MAX_VALUE
-
-
Method Details
-
count
public int count()Returns the total number of cells in the logical grid.The constructor ensures the product fits in an int. This count is unrelated to the number of blocks written by generation.
- Returns:
width * depth
-
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. -
width
-
depth
-