Class OccupantAreaFactory
java.lang.Object
games.stendhal.server.entity.mapstuff.area.OccupantAreaFactory
- All Implemented Interfaces:
ConfigurableFactory
- Direct Known Subclasses:
DamagingAreaFactory,LifeDrainAreaFactory
A base factory for
OccupantArea objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate an object.protected abstract OccupantAreaCreates the OccupantArea.protected intExtract the height from context.protected intExtract the interval (in seconds) to perform actions while stationary.protected booleanExtract the flag to only affect players.protected intExtract the width from context.
-
Constructor Details
-
OccupantAreaFactory
public OccupantAreaFactory()
-
-
Method Details
-
createArea
Creates the OccupantArea.- Parameters:
ctx- The configuration context.- Returns:
- An OccupantArea.
- Throws:
IllegalArgumentException- in case of an invalid configuration
-
getWidth
Extract the width from context.- Parameters:
ctx- The configuration context.- Returns:
- The width, 1 if unspecified.
- Throws:
IllegalArgumentException- If the attribute is invalid.
-
getHeight
Extract the height from context.- Parameters:
ctx- The configuration context.- Returns:
- The height, 1 if unspecified.
- Throws:
IllegalArgumentException- If the attribute is invalid.
-
getInterval
Extract the interval (in seconds) to perform actions while stationary.- Parameters:
ctx- The configuration context.- Returns:
- The stationary interval (in turns).
- Throws:
IllegalArgumentException- if the attribute is missing.
-
getPlayersOnly
Extract the flag to only affect players.- Parameters:
ctx- The configuration context.- Returns:
- The flag to only affect players.
- Throws:
IllegalArgumentException- If the attribute is invalid.
-
create
Description copied from interface:ConfigurableFactoryCreate an object.- Specified by:
createin interfaceConfigurableFactory- Parameters:
ctx- Configuration context.- Returns:
- A new object, or
nullif allowed by the factory type.
-