Class HierarchicalTier
java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.clauses.BattleClause
com.pixelmonmod.pixelmon.battles.api.rules.clauses.tiers.Tier
com.pixelmonmod.pixelmon.battles.api.rules.clauses.tiers.HierarchicalTier
- All Implemented Interfaces:
IEncodeable,Comparable<BattleClause>
A type of
Tier that works similarly to a LinkedList in that it has a parent tier
and will validate the pokemon against that first.
If it fails to validate the parent then it won't check it against the current spec-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionHierarchicalTier(String id, boolean ban, PokemonSpecification... specs) Initializes a new tierHierarchicalTier(String id, boolean ban, Tier tierAbove, PokemonSpecification... specs) Initializes a new tier -
Method Summary
Modifier and TypeMethodDescriptionbooleanvalidateSingle(Pokemon pokemon) The logic executed here is - When ban is true: if a single spec matches return false (i.e.Methods inherited from class com.pixelmonmod.pixelmon.battles.api.rules.clauses.tiers.Tier
getTierDescriptionMethods inherited from class com.pixelmonmod.pixelmon.battles.api.rules.clauses.BattleClause
compareTo, decodeInto, encodeInto, equals, getDescription, getID, getLocalizedName, getLocalizedName, hashCode, setDescription, toString, validateTeam
-
Constructor Details
-
HierarchicalTier
Initializes a new tier- Parameters:
id- The id of the tier/battle clauseban- If the tier is a ban listspecs- The specs checked for this ban list
-
HierarchicalTier
Initializes a new tier- Parameters:
id- The id of the tier/battle clauseban- If the tier is a ban listtierAbove- The parent tier of this tierspecs- The specs checked for this ban list
-
-
Method Details
-
validateSingle
Description copied from class:TierThe logic executed here is - When ban is true: if a single spec matches return false (i.e. isn't valid as it matches a banned spec) However, if no spec match then return true When ban is false: if all specs match return true (i.e. all the specs match the given pokemon) If a single spec doesn't match return false (doesn't meet requirements)- Overrides:
validateSinglein classTier- Parameters:
pokemon- The Pokémon to check.- Returns:
- True if a valid single pokemon
-