Enum Class ForceApproachFlag
- All Implemented Interfaces:
Serializable, Comparable<ForceApproachFlag>, Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic intcombine(ForceApproachFlag... flags) Combines multipleForceApproachFlagvalues into a single integer mask.static EnumSet<ForceApproachFlag> fromValue(int flags) Converts a raw flags value into anEnumSetof blocked directions.intgetValue()static booleanisAllowed(int flags, ForceApproachFlag blockedFlag) Semantics helper: returns true if this approach option is allowed.static booleanisAllSet(int flags, ForceApproachFlag... test) Checks whether all of the specified flags are present.static booleanisAnySet(int flags, ForceApproachFlag... test) Checks whether any of the specified flags are present.static booleanisSet(int flags, ForceApproachFlag flag) Checks whether a specific flag bit is present in the given value.static StringtoString(int flags) Returns a human-readable list of all BLOCK_* flags that are set.static ForceApproachFlagReturns the enum constant of this class with the specified name.static ForceApproachFlag[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
INVALID
-
BLOCK_NORTH
-
BLOCK_EAST
-
BLOCK_SOUTH
-
BLOCK_WEST
-
BLOCK_UNKNOWN
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
combine
Combines multipleForceApproachFlagvalues into a single integer mask.- Parameters:
flags- the flags to combine- Returns:
- a bitmask containing all provided flags
-
isSet
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 valueflag- the flag to test- Returns:
trueif the bit is set
-
isAnySet
Checks whether any of the specified flags are present. -
isAllSet
Checks whether all of the specified flags are present. -
isAllowed
Semantics helper: returns true if this approach option is allowed. In your decoding, "0 means allowed".- Parameters:
flags- raw force approach flagsblockedFlag- which direction-block bit to test- Returns:
trueif the bit is NOT set
-
fromValue
Converts a raw flags value into anEnumSetof blocked directions.- Parameters:
flags- raw force approach flags- Returns:
- set of flags that are present (blocked)
-
toString
Returns a human-readable list of all BLOCK_* flags that are set. -
getValue
public int getValue()
-