Package rsb.wrappers
Class RSTilePath
java.lang.Object
rsb.methods.MethodProvider
rsb.wrappers.RSPath
rsb.wrappers.RSTilePath
A path consisting of a list of tile waypoints.
- Author:
- GigiaJ
-
Nested Class Summary
Nested classes/interfaces inherited from class rsb.wrappers.RSPath
RSPath.TraversalOption
-
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEnd()
Gets the end tile of this path.getNext()
Gets the next immediately available vertex in this path.getStart()
Gets the start tile of this path.boolean
isValid()
Checks whether this path can be traversed by the player.randomize
(int maxX, int maxY) Randomize this path.reverse()
Reverses this path.RSTile[]
toArray()
Returns an array containing all of the vertices in this path.boolean
traverse
(EnumSet<RSPath.TraversalOption> options) Takes a step along this path if appropriate.
-
Constructor Details
-
RSTilePath
-
-
Method Details
-
traverse
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). -
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. -
getNext
Gets the next immediately available vertex in this path. -
getStart
Gets the start tile of this path. -
getEnd
Gets the end tile of this path. -
randomize
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 axismaxY
- The max deviation on the Y axis- Returns:
- This path.
-
reverse
Reverses this path.- Returns:
- This path.
-
toArray
Returns an array containing all of the vertices in this path.- Returns:
- an array containing all of the vertices in this path.
-