Class LabyrinthPanelInit

java.lang.Object
net.regsirius06.engine.API.Initializer<LabyrinthPanel>
net.regsirius06.engine.core.initializers.LabyrinthPanelInit
All Implemented Interfaces:
Serializable, Loadable

public class LabyrinthPanelInit extends Initializer<LabyrinthPanel>
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 Details

    • LabyrinthPanelInit

      public LabyrinthPanelInit()
  • Method Details

    • getName

      public String 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:
      getName in class Initializer<LabyrinthPanel>
      Returns:
      the name of this initializer, "Default".
    • create

      public LabyrinthPanel create(Object @NotNull ... objects) throws IllegalArgumentException
      Creates a new instance of LabyrinthPanel with the provided parameters.

      The create method 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, an IllegalArgumentException will be thrown.

      Specified by:
      create in class Initializer<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 LabyrinthPanel object configured with the provided arguments.
      Throws:
      IllegalArgumentException - if the arguments are invalid, insufficient, or not of the correct types.