Class LevelCheckingPortalFactory

java.lang.Object
games.stendhal.server.entity.mapstuff.portal.LevelCheckingPortalFactory
All Implemented Interfaces:
ConfigurableFactory

public class LevelCheckingPortalFactory extends Object
A factory for LevelCheckingPortal objects.
  • Constructor Details

    • LevelCheckingPortalFactory

      public LevelCheckingPortalFactory()
  • Method Details

    • getMaximumLevel

      protected int getMaximumLevel(ConfigurableFactoryContext ctx)
      Extract the maximum player level from a context.
      Parameters:
      ctx - The configuration context.
      Returns:
      The level.
      Throws:
      IllegalArgumentException - If the level attribute is invalid.
    • getMinimumLevel

      protected int getMinimumLevel(ConfigurableFactoryContext ctx)
      Extract the minimum player level from a context.
      Parameters:
      ctx - The configuration context.
      Returns:
      The level.
      Throws:
      IllegalArgumentException - If the level attribute is invalid.
    • createPortal

      protected games.stendhal.server.entity.mapstuff.portal.AccessCheckingPortal createPortal(ConfigurableFactoryContext ctx)
      Create a level checking portal.
      Parameters:
      ctx - Configuration context.
      Returns:
      A Portal.
      Throws:
      IllegalArgumentException - If there is a problem with the attributes. The exception message should be a value suitable for meaningful user interpretation.
      See Also:
      LevelCheckingPortal
    • create

      public Object create(ConfigurableFactoryContext ctx)
      Create a keyed portal.
      Specified by:
      create in interface ConfigurableFactory
      Parameters:
      ctx - Configuration context.
      Returns:
      A KeyedPortal.
      Throws:
      IllegalArgumentException - If there is a problem with the attributes. The exception message should be a value suitable for meaningful user interpretation.
      See Also:
      KeyedPortal
    • getStringValue

      protected String getStringValue(ConfigurableFactoryContext ctx, String key)
      Extract string value from a context.
      Parameters:
      ctx - The configuration context.
      key - The key to search for.
      Returns:
      The string value of the key, or null if none.
      Throws:
      IllegalArgumentException - If the class attribute is missing.
    • getIntValue

      protected int getIntValue(ConfigurableFactoryContext ctx, String key)
      Extract integer value from a context.
      Parameters:
      ctx - The configuration context.
      key - The key to search for.
      Returns:
      The integer value of the key, or null if none.
      Throws:
      IllegalArgumentException - If the class attribute is missing.
    • getRejectedAction

      protected ChatAction getRejectedAction(ConfigurableFactoryContext ctx)
      Creates a new ChatAction from ConfigurableFactoryContext.
      Parameters:
      ctx - ConfigurableFactoryContext
      Returns:
      ChatAction instance