Enum Class LogicCondition.Operator

java.lang.Object
java.lang.Enum<LogicCondition.Operator>
com.hypixel.hytale.server.core.modules.entity.condition.LogicCondition.Operator
All Implemented Interfaces:
Serializable, Comparable<LogicCondition.Operator>, Constable
Enclosing class:
LogicCondition

public static enum LogicCondition.Operator extends Enum<LogicCondition.Operator>
The logical operators for combining conditions.
  • Enum Constant Details

    • AND

      public static final LogicCondition.Operator AND
      An AND operator that requires all conditions to be true.

      If any of the conditions is false, the entire evaluation fails.

    • OR

      public static final LogicCondition.Operator OR
      An OR operator that requires at least one condition to be true.

      If any of the conditions is true, the entire evaluation succeeds.

  • Method Details

    • values

      public static LogicCondition.Operator[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LogicCondition.Operator valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • eval

      public abstract boolean eval(@Nonnull ComponentAccessor<EntityStore> store, @Nonnull Ref<EntityStore> ref, @Nonnull Instant currentTime, @Nonnull Condition[] conditions)
      Evaluates the logical operation on the given conditions.
      Parameters:
      store - The ComponentAccessor<EntityStore> for store access.
      ref - The entity reference of the entity.
      currentTime - The current world time.
      conditions - The array of Condition instances to evaluate.
      Returns:
      true if the logical operation evaluates to true, false otherwise.