Class NoLoginAreaFactory

java.lang.Object
games.stendhal.server.entity.mapstuff.area.NoLoginAreaFactory
All Implemented Interfaces:
ConfigurableFactory

public class NoLoginAreaFactory extends Object implements ConfigurableFactory
A base factory for NoLoginArea objects.
  • Constructor Details

    • NoLoginAreaFactory

      public NoLoginAreaFactory()
  • Method Details

    • getHeight

      protected int getHeight(ConfigurableFactoryContext ctx)
      Extract the height from context.
      Parameters:
      ctx - The configuration context.
      Returns:
      The height, 1 if unspecified.
      Throws:
      IllegalArgumentException - If the attribute is invalid.
    • getWidth

      protected int getWidth(ConfigurableFactoryContext ctx)
      Extract the width from context.
      Parameters:
      ctx - The configuration context.
      Returns:
      The width, 1 if unspecified.
      Throws:
      IllegalArgumentException - If the attribute is invalid.
    • getMessage

      protected String getMessage(ConfigurableFactoryContext ctx)
      Get the message to send to the player.
      Parameters:
      ctx - The configuration context.
      Returns:
      The message to send to the player.
    • getNewX

      protected int getNewX(ConfigurableFactoryContext ctx)
      Get the new player X coordinate.
      Parameters:
      ctx - The configuration context.
      Returns:
      The new player X coordinate.
      Throws:
      IllegalArgumentException - If the attribute is missing/invalid.
    • getNewY

      protected int getNewY(ConfigurableFactoryContext ctx)
      Get the new player Y coordinate.
      Parameters:
      ctx - The configuration context.
      Returns:
      The new player Y coordinate.
      Throws:
      IllegalArgumentException - If the attribute is missing/invalid.
    • create

      public AreaEntity create(ConfigurableFactoryContext ctx)
      Create an object.
      Specified by:
      create in interface ConfigurableFactory
      Parameters:
      ctx - The configuration context.
      Returns:
      A new object, or null if allowed by the factory type.
      Throws:
      IllegalArgumentException - If there is a problem with the attributes. The exception message should be a value suitable for meaningful user interpretation.