Class Coordinate

java.lang.Object
net.botwithus.rs3.game.Coordinate
All Implemented Interfaces:
Locatable

public final class Coordinate extends Object implements Locatable
An immutable representation of a position in the RuneScape world
  • Field Details

  • Constructor Details

    • Coordinate

      public Coordinate(int x, int y, int z)
    • Coordinate

      public Coordinate(Coordinate pos)
  • Method Details

    • copy

      public static Coordinate copy(Coordinate pos)
      Copies the coords of one position into a new position
      Parameters:
      pos - The position to copy
      Returns:
      The copied position
    • getX

      public int getX()
    • getY

      public int getY()
    • getZ

      public int getZ()
    • getRegionX

      public int getRegionX()
    • getRegionY

      public int getRegionY()
    • getRegionId

      public int getRegionId()
    • getXInRegion

      public int getXInRegion()
    • getYInRegion

      public int getYInRegion()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getArea

      public Area getArea()
      Description copied from interface: Locatable
      Gets the area that the entity occupies on the world graph
      Specified by:
      getArea in interface Locatable
      Returns:
      The area of the entity, or null if it cannot be determined or is no longer on the world graph.
    • getCoordinate

      public Coordinate getCoordinate()
      Description copied from interface: Locatable
      Returns the position of the entity on the world graph.
      Specified by:
      getCoordinate in interface Locatable
      Returns:
      The position of the entity, or null if it cannot be determined or is no longer on the world graph.
    • toPoint

      public Point toPoint()
    • isWestOf

      public boolean isWestOf(Locatable loc)
    • isEastOf

      public boolean isEastOf(Locatable loc)
    • isNorthOf

      public boolean isNorthOf(Locatable loc)
    • isSouthOf

      public boolean isSouthOf(Locatable loc)
    • derive

      public Coordinate derive(int xOffset, int yOffset, int planeOffset)
    • isWalkable

      public boolean isWalkable()