Interface NavigationPath
- All Superinterfaces:
Iterable<Position>
,SpeedModifier
Represents a Path for an Entity
-
Field Summary
Fields inherited from interface me.gamercoder215.mobchip.ai.SpeedModifier
DEFAULT_SPEED_MODIFIER
-
Method Summary
Modifier and TypeMethodDescriptionvoid
advance()
Advances this path.boolean
Whether this Path contains this Navigation Node.default boolean
containsAll
(Collection<? extends Position> coll) Whether this NavigationPath contains all of these Navigation Nodes.default boolean
containsAll
(@Nullable Position... nodes) Whether this NavigationPath contains all of these Navigation Nodes.int
Returns the index of this Navigation Node.boolean
isDone()
Whether this NavigationPath is complete.boolean
isEmpty()
Whether this NavigationPath is empty.int
Returns the last index of this Navigation Node.Position[]
toArray()
Converts this NavigationPath into an Array of Nodes.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface me.gamercoder215.mobchip.ai.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
-