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
-
Method Summary
Modifier and TypeMethodDescriptionCreate an object.protected abstract OccupantArea
Creates the OccupantArea.protected int
Extract the height from context.protected int
Extract the interval (in seconds) to perform actions while stationary.protected boolean
Extract the flag to only affect players.protected int
Extract 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:ConfigurableFactory
Create an object.- Specified by:
create
in interfaceConfigurableFactory
- Parameters:
ctx
- Configuration context.- Returns:
- A new object, or
null
if allowed by the factory type.
-