Interface NavigationPath
- All Superinterfaces:
Iterable<Position>, SpeedModifier
Represents a Path for an Entity
-
Field Summary
Fields inherited from interface SpeedModifier
DEFAULT_SPEED_MODIFIER -
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Advances this path.booleanWhether this Path contains this Navigation Node.default booleancontainsAll(Collection<? extends Position> coll) Whether this NavigationPath contains all of these Navigation Nodes.default booleancontainsAll(@Nullable Position... nodes) Whether this NavigationPath contains all of these Navigation Nodes.intReturns the index of this Navigation Node.booleanisDone()Whether this NavigationPath is complete.booleanisEmpty()Whether this NavigationPath is empty.intlastIndexOf(@Nullable Position o) Returns the last index of this Navigation Node.Position[]toArray()Converts this NavigationPath into an Array of Nodes.Methods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface SpeedModifier
getSpeedModifier, setSpeedModifier
-
Method Details
-
isDone
boolean isDone()Whether this NavigationPath is complete.- Returns:
- true if complete, else false
-
containsAll
Whether this NavigationPath contains all of these Navigation Nodes.- Parameters:
coll- Collection to test- Returns:
- true if contains, else false
-
contains
Whether this Path contains this Navigation Node.- Parameters:
node- Position- Returns:
- true if contains, else false
-
isEmpty
boolean isEmpty()Whether this NavigationPath is empty.- Returns:
- true if empty, else false
-
advance
Advances this path.- Throws:
IllegalArgumentException- ifisDone()is true
-
toArray
Position[] toArray()Converts this NavigationPath into an Array of Nodes.- Returns:
- Array of Position
-
indexOf
Returns the index of this Navigation Node.- Parameters:
o- Position to fetch- Returns:
- Index found
- See Also:
-
lastIndexOf
Returns the last index of this Navigation Node.- Parameters:
o- Position to fetch- Returns:
- Index found
- See Also:
-
containsAll
Whether this NavigationPath contains all of these Navigation Nodes.- Parameters:
nodes- Nodes to test- Returns:
- true if contains, else false
-