Package com.kraken.api.service.map
Class WorldPointService
- java.lang.Object
-
- com.kraken.api.service.map.WorldPointService
-
public class WorldPointService extends java.lang.ObjectA utility class for compressing and decompressing WorldPoint objects into and from integers.
-
-
Constructor Summary
Constructors Constructor Description WorldPointService()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intdx(int packed, int offset)Offsets the compressed WorldPoint by the given amounts in each dimension.static intdxy(int packed, int offsetX, int offsetY)Offsets the compressed WorldPoint by the given amounts in each dimension.static intdy(int packed, int offset)Offsets the compressed WorldPoint by the given amounts in each dimension.static net.runelite.api.coords.WorldPointfromPacked(int packed)Decompresses a compressed WorldPoint integer back into a WorldPoint.static bytegetPackedPlane(int packed)Extracts the plane from a compressed WorldPoint integer.static shortgetPackedX(int packed)Extracts the X coordinate from a compressed WorldPoint integer.static shortgetPackedY(int packed)Extracts the Y coordinate from a compressed WorldPoint integer.static intpack(int x, int y, int z)Compresses x, y, z coordinates into a single integer.static intpack(net.runelite.api.coords.WorldPoint wp)Compresses a WorldPoint into a single integer.static net.runelite.api.coords.WorldPointunpack(int packed)Overloaded method wrappingfromPacked.
-
-
-
Method Detail
-
pack
public static int pack(net.runelite.api.coords.WorldPoint wp)
Compresses a WorldPoint into a single integer.- Parameters:
wp- the WorldPoint to compress- Returns:
- the compressed WorldPoint
-
pack
public static int pack(int x, int y, int z)Compresses x, y, z coordinates into a single integer.- Parameters:
x- the x coordinate (0 - 16383)y- the y coordinate (0 - 32767)z- the z coordinate (0 - 7)- Returns:
- the compressed coordinates
-
fromPacked
public static net.runelite.api.coords.WorldPoint fromPacked(int packed)
Decompresses a compressed WorldPoint integer back into a WorldPoint.- Parameters:
packed- the packed WorldPoint- Returns:
- the unpacked WorldPoint
-
unpack
public static net.runelite.api.coords.WorldPoint unpack(int packed)
Overloaded method wrappingfromPacked.- Parameters:
packed- The compressed WorldPoint- Returns:
- the unpacked WorldPoint
-
getPackedX
public static short getPackedX(int packed)
Extracts the X coordinate from a compressed WorldPoint integer.- Parameters:
packed- the compressed WorldPoint- Returns:
- the X coordinate
-
getPackedY
public static short getPackedY(int packed)
Extracts the Y coordinate from a compressed WorldPoint integer.- Parameters:
packed- the compressed WorldPoint- Returns:
- the Y coordinate
-
getPackedPlane
public static byte getPackedPlane(int packed)
Extracts the plane from a compressed WorldPoint integer.- Parameters:
packed- the compressed WorldPoint- Returns:
- the plane
-
dx
public static int dx(int packed, int offset)Offsets the compressed WorldPoint by the given amounts in each dimension.- Parameters:
packed- the compressed WorldPointoffset- the amount to offset in the X direction- Returns:
- the new compressed WorldPoint
-
dy
public static int dy(int packed, int offset)Offsets the compressed WorldPoint by the given amounts in each dimension.- Parameters:
packed- the compressed WorldPointoffset- the amount to offset in the Y direction- Returns:
- the new compressed WorldPoint
-
dxy
public static int dxy(int packed, int offsetX, int offsetY)Offsets the compressed WorldPoint by the given amounts in each dimension.- Parameters:
packed- the compressed WorldPointoffsetX- the amount to offset in the X directionoffsetY- the amount to offset in the Y direction- Returns:
- the new compressed WorldPoint
-
-