Class Tier
java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.clauses.BattleClause
com.pixelmonmod.pixelmon.battles.api.rules.clauses.tiers.Tier
- All Implemented Interfaces:
IEncodeable
,Comparable<BattleClause>
- Direct Known Subclasses:
HierarchicalTier
A type of battle rule that restricts the Pokémon that can be used based on a set of
PokemonSpecification
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
protected final Set<PokemonSpecification>
-
Constructor Summary
ConstructorDescriptionTier
(String id, boolean ban, PokemonSpecification... spec) Initializes a new tier -
Method Summary
Modifier and TypeMethodDescriptionGets a description of the tier for use in /tiershow.boolean
validateSingle
(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.BattleClause
compareTo, decodeInto, encodeInto, equals, getDescription, getID, getLocalizedName, getLocalizedName, hashCode, setDescription, toString, validateTeam
-
Field Details
-
specs
-
ban
protected final boolean ban
-
-
Constructor Details
-
Tier
Initializes a new tier- Parameters:
id
- The id of the tier/battle clauseban
- If the tier is a ban listspec
- The specs checked for this ban list
-
-
Method Details
-
validateSingle
The 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:
validateSingle
in classBattleClause
- Parameters:
pokemon
- The Pokémon to check.- Returns:
- True if a valid single pokemon
-
getTierDescription
Gets a description of the tier for use in /tiershow.
-