Package rs.kreme.ksbot.api.game.pathing
Enum MovementFlags
- java.lang.Object
-
- java.lang.Enum<MovementFlags>
-
- rs.kreme.ksbot.api.game.pathing.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 Summary
Enum Constants Enum Constant Description BLOCK_LINE_OF_SIGHT_EASTBlocks line of sight to the eastBLOCK_LINE_OF_SIGHT_FULLBlocks all line of sightBLOCK_LINE_OF_SIGHT_NORTHBlocks line of sight to the northBLOCK_LINE_OF_SIGHT_SOUTHBlocks line of sight to the southBLOCK_LINE_OF_SIGHT_WESTBlocks line of sight to the westBLOCK_MOVEMENT_EASTBlocks movement to the eastBLOCK_MOVEMENT_FLOORBlocks movement due to floor propertiesBLOCK_MOVEMENT_FLOOR_DECORATIONBlocks movement due to a floor decorationBLOCK_MOVEMENT_FULLBlocks all movement (combination of multiple flags)BLOCK_MOVEMENT_NORTHBlocks movement to the northBLOCK_MOVEMENT_NORTH_EASTBlocks movement to the north-eastBLOCK_MOVEMENT_NORTH_WESTBlocks movement to the north-westBLOCK_MOVEMENT_OBJECTBlocks movement due to an object being presentBLOCK_MOVEMENT_SOUTHBlocks movement to the southBLOCK_MOVEMENT_SOUTH_EASTBlocks movement to the south-eastBLOCK_MOVEMENT_SOUTH_WESTBlocks movement to the south-westBLOCK_MOVEMENT_WESTBlocks movement to the west
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<MovementFlags>NOT_WALKABLEFlags that make a tile unwalkable
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetFlag()Gets the bit flag valuestatic java.util.List<MovementFlags>getListFlags(int collisionData)Returns a list of movement flags that are present in the collision datastatic intgetRawFlags(net.runelite.api.coords.WorldPoint worldPoint)Gets the raw collision flags at a world pointstatic java.util.Set<MovementFlags>getSetFlags(int collisionData)Returns a set of movement flags that are present in the collision datastatic java.util.Set<MovementFlags>getSetFlags(net.runelite.api.coords.WorldPoint worldPoint)Returns a set of movement flags for a specific world pointstatic booleanisBlocked(net.runelite.api.coords.WorldPoint worldPoint, MovementFlags direction)Checks if movement is blocked in a specific directionstatic booleanisWalkable(net.runelite.api.coords.LocalPoint localPoint)Checks if a local point is walkablestatic booleanisWalkable(net.runelite.api.coords.WorldPoint worldPoint)Checks if a world point is walkablestatic MovementFlagsvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MovementFlags[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 namejava.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 fromdirection- 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
-
-