Package rsb.wrappers

Class RSTilePath


public class RSTilePath extends RSPath
A path consisting of a list of tile waypoints.
Author:
GigiaJ
  • Constructor Details

  • Method Details

    • traverse

      public boolean traverse(EnumSet<RSPath.TraversalOption> options)
      Takes a step along this path if appropriate. If the path cannot be traversed due to the player being too far from its vertices or already at the end vertex, false will be returned. In all other cases, true will be returned, but an action will not necessarily be performed (based on the given options).
      Specified by:
      traverse in class RSPath
      Parameters:
      options - Walking style options.
      Returns:
      true if this path is currently valid for the player; otherwise false.
    • isValid

      public boolean isValid()
      Checks whether this path can be traversed by the player. This will be the case provided that the player near to one of its vertices, but not already standing on the end vertex.
      Specified by:
      isValid in class RSPath
      Returns:
      true if the player can walk along this path; otherwise false.
    • getNext

      public RSTile getNext()
      Gets the next immediately available vertex in this path.
      Specified by:
      getNext in class RSPath
      Returns:
      The next walkable RSTile.
    • getStart

      public RSTile getStart()
      Gets the start tile of this path.
      Specified by:
      getStart in class RSPath
      Returns:
      The start RSTile.
    • getEnd

      public RSTile getEnd()
      Gets the end tile of this path.
      Specified by:
      getEnd in class RSPath
      Returns:
      The end RSTile.
    • randomize

      public RSTilePath randomize(int maxX, int maxY)
      Randomize this path. The original path is stored so this method may be called multiple times without the waypoints drifting far from their original locations.
      Parameters:
      maxX - The max deviation on the X axis
      maxY - The max deviation on the Y axis
      Returns:
      This path.
    • reverse

      public RSTilePath reverse()
      Reverses this path.
      Returns:
      This path.
    • toArray

      public RSTile[] toArray()
      Returns an array containing all of the vertices in this path.
      Returns:
      an array containing all of the vertices in this path.