Package rsb.wrappers
Class RSPath
java.lang.Object
rsb.methods.MethodProvider
rsb.wrappers.RSPath
- Direct Known Subclasses:
RSLocalPath
,RSTilePath
Represents a path to walk along in game.
- Author:
- GigiaJ
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Defines the path traversal options. -
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract RSTile
getEnd()
Gets the end tile of this path.abstract RSTile
getNext()
Gets the next immediately available vertex in this path.abstract RSTile
getStart()
Gets the start tile of this path.abstract boolean
isValid()
Checks whether this path can be traversed by the player.boolean
traverse()
Takes a step along this path if appropriate.abstract boolean
traverse
(EnumSet<RSPath.TraversalOption> options) Takes a step along this path if appropriate.
-
Constructor Details
-
RSPath
-
-
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).- Parameters:
options
- Walking style options.- Returns:
true
if this path is currently valid for the player; otherwisefalse
.
-
traverse
public boolean traverse()Takes a step along this path if appropriate. Specifies only TraversalOption.SPACE_ACTIONS.- Returns:
true
if this path is currently valid for the player; otherwisefalse
.- See Also:
-
isValid
public abstract 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.- Returns:
true
if the player can walk along this path; otherwisefalse
.
-
getNext
Gets the next immediately available vertex in this path.- Returns:
- The next walkable
RSTile
.
-
getStart
Gets the start tile of this path.- Returns:
- The start
RSTile
.
-
getEnd
Gets the end tile of this path.- Returns:
- The end
RSTile
.
-