Enum Class Effect.Operation

java.lang.Object
java.lang.Enum<Effect.Operation>
com.tnsai.annotations.Effect.Operation
All Implemented Interfaces:
Serializable, Comparable<Effect.Operation>, Constable
Enclosing class:
Effect

public static enum Effect.Operation extends Enum<Effect.Operation>
Effect operations for state modification.
  • Enum Constant Details

    • SET

      public static final Effect.Operation SET
      Set state to the specified value.

      Example: state = ALIVE

    • ADD

      public static final Effect.Operation ADD
      Add value to numeric state.

      Example: count = count + value

    • SUBTRACT

      public static final Effect.Operation SUBTRACT
      Subtract value from numeric state.

      Example: energy = energy - value

    • MULTIPLY

      public static final Effect.Operation MULTIPLY
      Multiply numeric state by value.

      Example: score = score * value

    • DIVIDE

      public static final Effect.Operation DIVIDE
      Divide numeric state by value.

      Example: ratio = total / value

    • TOGGLE

      public static final Effect.Operation TOGGLE
      Toggle boolean state.

      Example: isActive = !isActive

    • CLEAR

      public static final Effect.Operation CLEAR
      Clear state (set to null/empty/zero).
    • INCREMENT

      public static final Effect.Operation INCREMENT
      Increment numeric state by 1.

      Example: counter++

    • DECREMENT

      public static final Effect.Operation DECREMENT
      Decrement numeric state by 1.

      Example: counter--

    • APPEND

      public static final Effect.Operation APPEND
      Append to list/collection state.

      Example: history.add(value)

    • REMOVE

      public static final Effect.Operation REMOVE
      Remove from list/collection state.

      Example: history.remove(value)

  • Method Details

    • values

      public static Effect.Operation[] 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 Effect.Operation 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