Class AbstractRecursivePokemonRequirement
java.lang.Object
com.pixelmonmod.api.pokemon.requirement.AbstractRecursivePokemonRequirement
- All Implemented Interfaces:
Requirement<Pokemon,PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>>
- Direct Known Subclasses:
LogicalAndRequirement,LogicalOrRequirement
public abstract class AbstractRecursivePokemonRequirement
extends Object
implements Requirement<Pokemon,PixelmonEntity,List<Requirement<Pokemon,PixelmonEntity,?>>>
The basics for a recursive requirement
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractRecursivePokemonRequirement(Set<String> keys, List<Requirement<Pokemon, PixelmonEntity, ?>> requirements) -
Method Summary
Modifier and TypeMethodDescriptionCreates a list of requirements from the spec being parsedbooleanChecks if the given fits for this requirementThe aliases of the requirement that it can match againstintGets the order priority of the requirement.getValue()Gets the internal value of the requirementbooleanIf the spec should continue processing the results after applying this requirement.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pixelmonmod.api.requirement.Requirement
applyData, applyMinecraft, createInstance, isDataMatch, isMinecraftMatch
-
Field Details
-
keys
-
requirements
-
-
Constructor Details
-
AbstractRecursivePokemonRequirement
-
AbstractRecursivePokemonRequirement
protected AbstractRecursivePokemonRequirement(Set<String> keys, List<Requirement<Pokemon, PixelmonEntity, ?>> requirements)
-
-
Method Details
-
getAliases
Description copied from interface:RequirementThe aliases of the requirement that it can match against- Specified by:
getAliasesin interfaceRequirement<Pokemon,PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- The aliases
-
getPriority
public int getPriority()Description copied from interface:RequirementGets the order priority of the requirement. Higher number = higher priority (i.e. it is applied first)- Specified by:
getPriorityin interfaceRequirement<Pokemon,PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- The priority
-
shouldContinue
public boolean shouldContinue()Description copied from interface:RequirementIf the spec should continue processing the results after applying this requirement.
For example, for a logical AND this would return false as it handles the processing of the remaining requirements- Specified by:
shouldContinuein interfaceRequirement<Pokemon,PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- True if it should continue processing
-
fits
Description copied from interface:RequirementChecks if the given fits for this requirement- Specified by:
fitsin interfaceRequirement<Pokemon,PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Parameters:
spec- The parsed spec- Returns:
- True if this requirement is found in the parameter
-
create
Description copied from interface:RequirementCreates a list of requirements from the spec being parsed- Specified by:
createin interfaceRequirement<Pokemon,PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Parameters:
spec- The spec being parsed- Returns:
- The new list of requirements
-
getValue
Description copied from interface:RequirementGets the internal value of the requirement- Specified by:
getValuein interfaceRequirement<Pokemon,PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- The value stored
-