Package org.rspeer.game.position
Class Position
- java.lang.Object
-
- org.rspeer.game.position.Position
-
- All Implemented Interfaces:
SceneNode
- Direct Known Subclasses:
AbsolutePosition
,RelativePosition
public class Position extends Object implements SceneNode
Represents aPosition
relative to the game world
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.rspeer.game.adapter.type.SceneNode
SceneNode.Query<Q extends SceneNode.Query<Q>>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(int x, int y, int level)
boolean
equals(Object obj)
static Position
from(int x, int y)
static Position
from(int x, int y, int level)
static Position
fromAbsolute(int x, int y, int level)
Position
fromInstance()
static Position
fromRelative(int x, int y, int level)
static Position
fromScript(int regionX, int regionY, int insetX, int insetY, int level)
Constructs a Position using jagex's inhouse position system.Chunk
getChunk()
IntPair
getChunkOffset()
int
getChunkX()
int
getChunkY()
int
getFloorLevel()
List<Position>
getInstancePositions()
Position
getPosition()
int
getRegionId()
int
getRegionX()
int
getRegionXInset()
int
getRegionY()
int
getRegionYInset()
int
getX()
int
getY()
int
hashCode()
boolean
isInScene()
boolean
isInstanced()
Position
rotate(int rotation)
static Position
rotate(int x, int y, int level, int rotation)
Position
toPrecise()
Position
toScene()
String
toString()
Position
toWorld()
Position
translate(int x, int y)
Position
translate(Direction d)
static Position
unpack(int packed)
boolean
within(Area area)
-
Methods inherited from interface org.rspeer.game.adapter.type.SceneNode
distance, distance, distance, distance, getArea, getEntityPositionHeight, getEntityPositionWidth, isInFieldOfViewOf, isInFieldOfViewOf
-
-
-
-
Field Detail
-
NIL
public static final Position NIL
-
-
Constructor Detail
-
Position
@Deprecated public Position(int x, int y, int level)
Deprecated.- See Also:
from(int, int, int)
-
Position
@Deprecated public Position(int x, int y)
Deprecated.- See Also:
from(int, int)
-
-
Method Detail
-
from
public static Position from(int x, int y, int level)
-
from
public static Position from(int x, int y)
-
fromRelative
public static Position fromRelative(int x, int y, int level)
-
fromAbsolute
public static Position fromAbsolute(int x, int y, int level)
-
fromScript
public static Position fromScript(int regionX, int regionY, int insetX, int insetY, int level)
Constructs a Position using jagex's inhouse position system.- Returns:
- A Position comprised of regionX, regionY, insetX, insetY and floor level.
-
unpack
public static Position unpack(int packed)
-
rotate
public static Position rotate(int x, int y, int level, int rotation)
-
getRegionX
public int getRegionX()
-
getRegionY
public int getRegionY()
-
getRegionXInset
public int getRegionXInset()
-
getRegionYInset
public int getRegionYInset()
-
getRegionId
public int getRegionId()
-
getChunkX
public int getChunkX()
-
getChunkY
public int getChunkY()
-
getChunk
public Chunk getChunk()
-
getChunkOffset
public IntPair getChunkOffset()
-
getFloorLevel
public int getFloorLevel()
- Specified by:
getFloorLevel
in interfaceSceneNode
-
translate
public Position translate(int x, int y)
-
toWorld
public Position toWorld()
-
toScene
public Position toScene()
-
toPrecise
public Position toPrecise()
-
fromInstance
public Position fromInstance()
-
isInstanced
public boolean isInstanced()
-
getPosition
public Position getPosition()
- Specified by:
getPosition
in interfaceSceneNode
-
equals
public boolean equals(int x, int y, int level)
-
isInScene
public boolean isInScene()
-
rotate
public Position rotate(int rotation)
-
within
public boolean within(Area area)
-
-