Class LabyrinthPanelInit
- All Implemented Interfaces:
Serializable,Loadable
LabyrinthPanelInit is an implementation of the Initializer class for creating instances of
LabyrinthPanel. It is responsible for the creation of a labyrinth panel by initializing it with
specific parameters such as width, height, dimension, number of lights, seed, and key logic.
This initializer provides the mechanism to create a labyrinth panel with customizable properties. It is used
as part of a plugin or modular system to allow different configurations of labyrinths within the application.
It is designed to throw an IllegalArgumentException if the provided arguments are incorrect or insufficient
to create the LabyrinthPanel.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance ofLabyrinthPanelwith the provided parameters.getName()Returns the name of this initializer.Methods inherited from class net.regsirius06.engine.API.Initializer
getType
-
Constructor Details
-
LabyrinthPanelInit
public LabyrinthPanelInit()
-
-
Method Details
-
getName
Returns the name of this initializer.The name is used to identify the initializer in the system. In this case, the name "Default" represents the standard initializer for a labyrinth panel.
- Specified by:
getNamein classInitializer<LabyrinthPanel>- Returns:
- the name of this initializer, "Default".
-
create
Creates a new instance ofLabyrinthPanelwith the provided parameters.The
createmethod takes in exactly six parameters: width, height, dimension, quantity of lights, seed for randomization, and the key logic handler. These values are used to configure the labyrinth panel. The method checks the number and types of arguments to ensure they are correct. If there is any discrepancy, anIllegalArgumentExceptionwill be thrown.- Specified by:
createin classInitializer<LabyrinthPanel>- Parameters:
objects- an array of objects containing the necessary arguments: width, height, dimension, number of lights, seed, and key logic. The arguments must be passed in the exact order: (width, height, dimension, lights, seed, keyLogic).- Returns:
- a newly created
LabyrinthPanelobject configured with the provided arguments. - Throws:
IllegalArgumentException- if the arguments are invalid, insufficient, or not of the correct types.
-