Class CreatureProtectionAreaFactory
java.lang.Object
games.stendhal.server.entity.mapstuff.area.CreatureProtectionAreaFactory
- All Implemented Interfaces:
ConfigurableFactory
A base factory for
CreatureProtectionArea
objects.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate a damaging area.protected void
Configure an area's criteria rules.protected boolean
Extract the default action from a context.protected int
Extract the area height from a context.protected int
Extract the area width from a context.
-
Constructor Details
-
CreatureProtectionAreaFactory
public CreatureProtectionAreaFactory()
-
-
Method Details
-
defineCreatures
Configure an area's criteria rules.- Parameters:
area
- The area to configure.ctx
- The configuration context.- Throws:
IllegalArgumentException
- If the attribute is invalid.
-
getBlockedDefault
Extract the default action from a context.- Parameters:
ctx
- The configuration context.- Returns:
- The default action.
- Throws:
IllegalArgumentException
- If the attribute is other than "block" or "allow".
-
getHeight
Extract the area height from a context.- Parameters:
ctx
- The configuration context.- Returns:
- The height.
- Throws:
IllegalArgumentException
- If the attribute is invalid.
-
getWidth
Extract the area width from a context.- Parameters:
ctx
- The configuration context.- Returns:
- The width.
- Throws:
IllegalArgumentException
- If the attribute is invalid.
-
create
Create a damaging area.- Specified by:
create
in interfaceConfigurableFactory
- Parameters:
ctx
- Configuration context.- Returns:
- A CreatureProtectionArea.
- Throws:
IllegalArgumentException
- If there is a problem with the attributes. The exception message should be a value suitable for meaningful user interpretation.- See Also:
CreatureProtectionArea
-