Class ConditionAndActionPortalFactory
java.lang.Object
games.stendhal.server.entity.mapstuff.portal.ConditionAndActionPortalFactory
- All Implemented Interfaces:
ConfigurableFactory
A factory for
ConditionCheckingPortal objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a keyed portal.protected AccessCheckingPortalCreate a condition checking portal.protected ChatActionExtract the quest name from a context.protected ChatConditionExtract the quest name from a context.protected intgetIntValue(ConfigurableFactoryContext ctx, String key) Extract integer value from a context.protected ChatActionCreates a new ChatAction from ConfigurableFactoryContext.protected StringgetStringValue(ConfigurableFactoryContext ctx, String key) Extract string value from a context.
-
Constructor Details
-
ConditionAndActionPortalFactory
public ConditionAndActionPortalFactory()
-
-
Method Details
-
getCondition
Extract the quest name from a context.- Parameters:
ctx- The configuration context.- Returns:
- The quest name.
- Throws:
IllegalArgumentException- If the quest attribute is missing.
-
getAction
Extract the quest name from a context.- Parameters:
ctx- The configuration context.- Returns:
- The quest name.
- Throws:
IllegalArgumentException- If the quest attribute is missing.
-
createPortal
Create a condition checking portal.- Parameters:
ctx- Configuration context.- Returns:
- A ConditionCheckingPortal
- Throws:
IllegalArgumentException- If there is a problem with the attributes. The exception message should be a value suitable for meaningful user interpretation.
-
create
Create a keyed portal.- Specified by:
createin interfaceConfigurableFactory- Parameters:
ctx- Configuration context.- Returns:
- A KeyedPortal.
- Throws:
IllegalArgumentException- If there is a problem with the attributes. The exception message should be a value suitable for meaningful user interpretation.- See Also:
-
getStringValue
Extract string value from a context.- Parameters:
ctx- The configuration context.key- The key to search for.- Returns:
- The string value of the key, or
nullif none. - Throws:
IllegalArgumentException- If the class attribute is missing.
-
getIntValue
Extract integer value from a context.- Parameters:
ctx- The configuration context.key- The key to search for.- Returns:
- The integer value of the key, or
nullif none. - Throws:
IllegalArgumentException- If the class attribute is missing.
-
getRejectedAction
Creates a new ChatAction from ConfigurableFactoryContext.- Parameters:
ctx- ConfigurableFactoryContext- Returns:
- ChatAction instance
-