Class LogicalAndBattleClause

java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.clauses.BattleClause
com.pixelmonmod.pixelmon.battles.api.rules.clauses.type.LogicalAndBattleClause
All Implemented Interfaces:
IEncodeable, Comparable<BattleClause>

public class LogicalAndBattleClause extends BattleClause
Checks that all sub-clauses of the BattleClause are valid If a single clause is not valid then it fails (returns false)
  • Constructor Details

    • LogicalAndBattleClause

      public LogicalAndBattleClause(String id, BattleClause... clauses)
      Creates the clause with the given cub-clauses
      Parameters:
      id - The unique ID of the battle clause.
      clauses - The clauses that cannot be violated.
  • Method Details

    • validateSingle

      public boolean validateSingle(Pokemon pokemon)
      Description copied from class: BattleClause
      Checks if the rule allows a Pokémon to be chosen for battle.
      Overrides:
      validateSingle in class BattleClause
      Parameters:
      pokemon - The Pokémon to check.
      Returns:
      Whether the rule allows the given Pokémon to be chosen for battle.
    • validateTeam

      public boolean validateTeam(List<Pokemon> team)
      Description copied from class: BattleClause
      Checks if the rule allows a list of Pokémon to be chosen for battle.
      Overrides:
      validateTeam in class BattleClause
      Parameters:
      team - The Pokémon to check.
      Returns:
      Whether the rule allows the given team to be chosen for battle.