Enum MovementFlags

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MovementFlags>

    public enum MovementFlags
    extends java.lang.Enum<MovementFlags>
    Enum representing collision flags used in the RuneScape pathfinding system. These flags determine if a tile is blocked for movement or line of sight. Note: stream usage was replaced by iterative loops and EnumSet to reduce allocations and avoid potential stack issues when used frequently in pathfinding.
    • Enum Constant Detail

      • BLOCK_MOVEMENT_NORTH_WEST

        public static final MovementFlags BLOCK_MOVEMENT_NORTH_WEST
        Blocks movement to the north-west
      • BLOCK_MOVEMENT_NORTH

        public static final MovementFlags BLOCK_MOVEMENT_NORTH
        Blocks movement to the north
      • BLOCK_MOVEMENT_NORTH_EAST

        public static final MovementFlags BLOCK_MOVEMENT_NORTH_EAST
        Blocks movement to the north-east
      • BLOCK_MOVEMENT_EAST

        public static final MovementFlags BLOCK_MOVEMENT_EAST
        Blocks movement to the east
      • BLOCK_MOVEMENT_SOUTH_EAST

        public static final MovementFlags BLOCK_MOVEMENT_SOUTH_EAST
        Blocks movement to the south-east
      • BLOCK_MOVEMENT_SOUTH

        public static final MovementFlags BLOCK_MOVEMENT_SOUTH
        Blocks movement to the south
      • BLOCK_MOVEMENT_SOUTH_WEST

        public static final MovementFlags BLOCK_MOVEMENT_SOUTH_WEST
        Blocks movement to the south-west
      • BLOCK_MOVEMENT_WEST

        public static final MovementFlags BLOCK_MOVEMENT_WEST
        Blocks movement to the west
      • BLOCK_MOVEMENT_OBJECT

        public static final MovementFlags BLOCK_MOVEMENT_OBJECT
        Blocks movement due to an object being present
      • BLOCK_MOVEMENT_FLOOR_DECORATION

        public static final MovementFlags BLOCK_MOVEMENT_FLOOR_DECORATION
        Blocks movement due to a floor decoration
      • BLOCK_MOVEMENT_FLOOR

        public static final MovementFlags BLOCK_MOVEMENT_FLOOR
        Blocks movement due to floor properties
      • BLOCK_MOVEMENT_FULL

        public static final MovementFlags BLOCK_MOVEMENT_FULL
        Blocks all movement (combination of multiple flags)
      • BLOCK_LINE_OF_SIGHT_NORTH

        public static final MovementFlags BLOCK_LINE_OF_SIGHT_NORTH
        Blocks line of sight to the north
      • BLOCK_LINE_OF_SIGHT_EAST

        public static final MovementFlags BLOCK_LINE_OF_SIGHT_EAST
        Blocks line of sight to the east
      • BLOCK_LINE_OF_SIGHT_SOUTH

        public static final MovementFlags BLOCK_LINE_OF_SIGHT_SOUTH
        Blocks line of sight to the south
      • BLOCK_LINE_OF_SIGHT_WEST

        public static final MovementFlags BLOCK_LINE_OF_SIGHT_WEST
        Blocks line of sight to the west
      • BLOCK_LINE_OF_SIGHT_FULL

        public static final MovementFlags BLOCK_LINE_OF_SIGHT_FULL
        Blocks all line of sight
    • Field Detail

      • NOT_WALKABLE

        public static final java.util.Set<MovementFlags> NOT_WALKABLE
        Flags that make a tile unwalkable
    • Method Detail

      • values

        public static MovementFlags[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MovementFlags c : MovementFlags.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MovementFlags valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getFlag

        public int getFlag()
        Gets the bit flag value
        Returns:
        The flag's bit value
      • getListFlags

        public static java.util.List<MovementFlags> getListFlags​(int collisionData)
        Returns a list of movement flags that are present in the collision data
        Parameters:
        collisionData - The collision data integer from which to extract flags
        Returns:
        A list of MovementFlags present in the collision data
      • getSetFlags

        public static java.util.Set<MovementFlags> getSetFlags​(int collisionData)
        Returns a set of movement flags that are present in the collision data
        Parameters:
        collisionData - The collision data integer from which to extract flags
        Returns:
        A set of MovementFlags present in the collision data
      • getSetFlags

        public static java.util.Set<MovementFlags> getSetFlags​(net.runelite.api.coords.WorldPoint worldPoint)
        Returns a set of movement flags for a specific world point
        Parameters:
        worldPoint - The world point to check
        Returns:
        A set of MovementFlags present at the world point, or an empty set if out of range
      • isWalkable

        public static boolean isWalkable​(net.runelite.api.coords.LocalPoint localPoint)
        Checks if a local point is walkable
        Parameters:
        localPoint - The local point to check
        Returns:
        true if the tile is walkable
      • isWalkable

        public static boolean isWalkable​(net.runelite.api.coords.WorldPoint worldPoint)
        Checks if a world point is walkable
        Parameters:
        worldPoint - The world point to check
        Returns:
        true if the world point is walkable
      • isBlocked

        public static boolean isBlocked​(net.runelite.api.coords.WorldPoint worldPoint,
                                        MovementFlags direction)
        Checks if movement is blocked in a specific direction
        Parameters:
        worldPoint - The world point to check from
        direction - The direction flag to check
        Returns:
        true if movement is blocked in the specified direction
      • getRawFlags

        public static int getRawFlags​(net.runelite.api.coords.WorldPoint worldPoint)
        Gets the raw collision flags at a world point
        Parameters:
        worldPoint - The world point to check
        Returns:
        The raw collision flags, or 0 if out of range