Enum Class ForceApproachFlag

java.lang.Object
java.lang.Enum<ForceApproachFlag>
org.rspeer.game.coord.collision.ForceApproachFlag
All Implemented Interfaces:
Serializable, Comparable<ForceApproachFlag>, Constable

public enum ForceApproachFlag extends Enum<ForceApproachFlag>
Represents the "force approach" flags used by the client to describe which approach directions are disallowed (or allowed) for an interaction target.

In the raw value, each bit indicates a direction that is blocked. This matches patterns like:

if ((forceApproachFlags & 1) == 0) allowNorth();

This enum provides:

  • Strongly typed access to individual force-approach bits.
  • Utility methods for combining and testing values.
  • Helpers to interpret the common "0 bit means allowed" semantics.
  • Enum Constant Details

  • Method Details

    • values

      public static ForceApproachFlag[] 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 ForceApproachFlag 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
    • combine

      public static int combine(ForceApproachFlag... flags)
      Combines multiple ForceApproachFlag values into a single integer mask.
      Parameters:
      flags - the flags to combine
      Returns:
      a bitmask containing all provided flags
    • isSet

      public static boolean isSet(int flags, ForceApproachFlag flag)
      Checks whether a specific flag bit is present in the given value. For this enum, a set bit typically means "blocked".
      Parameters:
      flags - the raw force approach flags value
      flag - the flag to test
      Returns:
      true if the bit is set
    • isAnySet

      public static boolean isAnySet(int flags, ForceApproachFlag... test)
      Checks whether any of the specified flags are present.
    • isAllSet

      public static boolean isAllSet(int flags, ForceApproachFlag... test)
      Checks whether all of the specified flags are present.
    • isAllowed

      public static boolean isAllowed(int flags, ForceApproachFlag blockedFlag)
      Semantics helper: returns true if this approach option is allowed. In your decoding, "0 means allowed".
      Parameters:
      flags - raw force approach flags
      blockedFlag - which direction-block bit to test
      Returns:
      true if the bit is NOT set
    • fromValue

      public static EnumSet<ForceApproachFlag> fromValue(int flags)
      Converts a raw flags value into an EnumSet of blocked directions.
      Parameters:
      flags - raw force approach flags
      Returns:
      set of flags that are present (blocked)
    • toString

      public static String toString(int flags)
      Returns a human-readable list of all BLOCK_* flags that are set.
    • getValue

      public int getValue()