Class DamagingAreaFactory
java.lang.Object
games.stendhal.server.entity.mapstuff.area.OccupantAreaFactory
games.stendhal.server.entity.mapstuff.area.DamagingAreaFactory
- All Implemented Interfaces:
ConfigurableFactory
A base factory for
DamagingArea
objects.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected OccupantArea
Creates the OccupantArea.protected int
Extract the damage amount from a context.protected double
Extract the moving damage probability (as percent) from a context.Methods inherited from class games.stendhal.server.entity.mapstuff.area.OccupantAreaFactory
create, getHeight, getInterval, getPlayersOnly, getWidth
-
Constructor Details
-
DamagingAreaFactory
public DamagingAreaFactory()
-
-
Method Details
-
getDamage
Extract the damage amount from a context.- Parameters:
ctx
- The configuration context.- Returns:
- The damage amount.
- Throws:
IllegalArgumentException
- If the attribute is missing.
-
getProbability
Extract the moving damage probability (as percent) from a context.- Parameters:
ctx
- The configuration context.- Returns:
- The damage probability (0.0 - 1.0).
- Throws:
IllegalArgumentException
- If the attribute is invalid.
-
createArea
Creates the OccupantArea.- Specified by:
createArea
in classOccupantAreaFactory
- Parameters:
ctx
- The configuration context.- Returns:
- An OccupantArea.
- Throws:
IllegalArgumentException
- in case of an invalid configuration
-