Class CreateMazeRequest
Required values identify the maze, target origin, logical grid, and preset. Constructor overrides use direct nullable values: null means inherit the preset, except for the seed, which is generated at submission when absent. Both false and zero remain explicit values rather than absence markers.
Prefer builder(String, MazeLocation, CellSize) when only a few
settings need overriding. Override accessors return Optional values so callers
can distinguish inherited settings from explicitly supplied ones.
Construction validates local values only. The operation service resolves the current preset and checks permissions, world availability, and configured limits when the request is submitted. Built requests are immutable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAssembles immutable creation requests using direct override values.static enumDetermines which existing blocks are accepted by creation preflight. -
Constructor Summary
ConstructorsConstructorDescriptionCreateMazeRequest(MazeId id, MazeLocation origin, CellSize cells, String preset, Long seed, MazeGeometry geometry, Double complexity, Boolean roof, Boolean snapshot, CreateMazeRequest.Placement placement) Constructs a request using direct values for all settings. -
Method Summary
Modifier and TypeMethodDescriptionstatic CreateMazeRequest.Builderbuilder(String name, MazeLocation origin, CellSize cells) Creates a builder with the default preset and no overrides.cells()The logical dimensions of the generated cell graph.The override used to derive generation biases.booleanCompares all captured values with another instance.geometry()The complete override for corridor and wall dimensions.inthashCode()Returns a hash code based on all captured values.id()The normalized identifier reserved for the new maze.origin()The minimum block corner and floor layer of the maze.The override controlling how occupied blocks are handled.preset()The configured preset identifier used to resolve inherited settings.roof()The override controlling whether a ceiling is generated.seed()The explicitly supplied deterministic generation seed.snapshot()The override controlling original terrain capture.toString()Formats the captured values for diagnostics.
-
Constructor Details
-
CreateMazeRequest
public CreateMazeRequest(MazeId id, MazeLocation origin, CellSize cells, String preset, Long seed, MazeGeometry geometry, Double complexity, Boolean roof, Boolean snapshot, CreateMazeRequest.Placement placement) Constructs a request using direct values for all settings.Null overrides inherit from the selected preset; a null seed requests a generated seed. Preset identifiers are normalized to lowercase. Palette settings are resolved from configuration when creation is submitted.
- Parameters:
id- the unique maze identifierorigin- the minimum corner in the target worldcells- the grid dimensions in cellspreset- the case-insensitive preset identifierseed- the explicit seed, or null to generate one at submissiongeometry- the geometry override, or null to inherit the presetcomplexity- the complexity override, or null to inherit the presetroof- the ceiling override, or null to inherit the presetsnapshot- the terrain capture override, or null to inherit the presetplacement- the occupied-block policy, or null to inherit the preset- Throws:
NullPointerException- if a required field or the preset is nullIllegalArgumentException- if the preset identifier is invalid or the supplied complexity is non-finite or outside 0..1
-
-
Method Details
-
id
The normalized identifier reserved for the new maze.- Returns:
- the unique maze identifier
-
origin
The minimum block corner and floor layer of the maze.The world must be loaded when creation is submitted. Negative world coordinates are supported.
- Returns:
- the minimum corner in the target world
-
cells
The logical dimensions of the generated cell graph.Cell counts are independent of corridor widths. Server cell and block-volume limits are checked when the request is submitted.
- Returns:
- the grid dimensions in cells
-
preset
The configured preset identifier used to resolve inherited settings.Identifiers are normalized to lowercase. The preset must exist when the request is submitted; constructing a request does not query configuration.
- Returns:
- the case-insensitive preset identifier
-
seed
The explicitly supplied deterministic generation seed.An absent seed is generated securely at submission. Every long value, including zero and negative values, is a valid explicit seed.
- Returns:
- the explicit seed, or empty when no override is supplied
-
geometry
The complete override for corridor and wall dimensions.An absent value inherits all dimensions from the selected preset. Supplying a value replaces path width, wall thickness, and wall height together.
- Returns:
- the geometry override, or empty when no override is supplied
-
complexity
The override used to derive generation biases.A supplied value must be finite and within 0..1 inclusive. Resolving this override removes the preset's advanced generation biases and derives them anew.
- Returns:
- the complexity override, or empty when no override is supplied
-
roof
-
snapshot
-
placement
The override controlling how occupied blocks are handled.The policy is used during preflight. Palette and advanced generation settings otherwise come from the selected preset.
- Returns:
- the occupied-block policy, or empty when no override is supplied
-
equals
Compares all captured values with another instance.Equality is based on contents rather than object identity, including any absent override or custom destination.
-
hashCode
public int hashCode()Returns a hash code based on all captured values.- Overrides:
hashCodein classObject- Returns:
- the hash code corresponding to
equals(Object)
-
toString
-
builder
Creates a builder with the default preset and no overrides.The builder accepts direct values for overrides. No Optional wrappers are needed; settings not supplied to the builder inherit from the preset.
- Parameters:
name- the case-insensitive maze nameorigin- the minimum block corner and floor layercells- the logical grid dimensions- Returns:
- a new reusable request builder
- Throws:
IllegalArgumentException- if the maze name is invalid or reservedNullPointerException- if any required argument is null
-