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
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
AbstractRecursivePokemonRequirement
(Set<String> keys, List<Requirement<Pokemon, PixelmonEntity, ?>> requirements) -
Method Summary
Modifier and TypeMethodDescriptionCreates a list of requirements from the spec being parsedboolean
Checks if the given fits for this requirementThe aliases of the requirement that it can match againstint
Gets the order priority of the requirement.getValue()
Gets the internal value of the requirementboolean
If 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, wait
Methods 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:Requirement
The aliases of the requirement that it can match against- Specified by:
getAliases
in interfaceRequirement<Pokemon,
PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- The aliases
-
getPriority
public int getPriority()Description copied from interface:Requirement
Gets the order priority of the requirement. Higher number = higher priority (i.e. it is applied first)- Specified by:
getPriority
in interfaceRequirement<Pokemon,
PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- The priority
-
shouldContinue
public boolean shouldContinue()Description copied from interface:Requirement
If 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:
shouldContinue
in interfaceRequirement<Pokemon,
PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- True if it should continue processing
-
fits
Description copied from interface:Requirement
Checks if the given fits for this requirement- Specified by:
fits
in 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:Requirement
Creates a list of requirements from the spec being parsed- Specified by:
create
in interfaceRequirement<Pokemon,
PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Parameters:
spec
- The spec being parsed- Returns:
- The new list of requirements
-
getValue
Description copied from interface:Requirement
Gets the internal value of the requirement- Specified by:
getValue
in interfaceRequirement<Pokemon,
PixelmonEntity, List<Requirement<Pokemon, PixelmonEntity, ?>>> - Returns:
- The value stored
-