Class LifeDrainAreaFactory

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

public class LifeDrainAreaFactory extends OccupantAreaFactory
A base factory for LifeDrainArea objects.
  • Constructor Details

    • LifeDrainAreaFactory

      public LifeDrainAreaFactory()
  • Method Details

    • getDamageRatio

      protected double getDamageRatio(ConfigurableFactoryContext ctx)
      Extract the damage ratio from a context.
      Parameters:
      ctx - The configuration context.
      Returns:
      The damage ratio (or 10% is unset).
    • getMimimumDamage

      protected int getMimimumDamage(ConfigurableFactoryContext ctx)
      Extract the minimum damage amount from a context.
      Parameters:
      ctx - The configuration context.
      Returns:
      The minimum damage amount (or 10 is unset).
    • createArea

      protected OccupantArea createArea(ConfigurableFactoryContext ctx)
      Creates the OccupantArea.
      Specified by:
      createArea in class OccupantAreaFactory
      Parameters:
      ctx - The configuration context.
      Returns:
      An OccupantArea.
      Throws:
      IllegalArgumentException - in case of an invalid configuration