1package com.runehive.game.world.pathfinding.path;
3import com.runehive.game.world.entity.mob.movement.Movement;
4import com.runehive.game.world.position.Position;
16 private final Deque<Position>
moves;
33 return moves.getFirst();
42 return moves.peekLast();
69 return moves.pollFirst();
74 while (!
moves.isEmpty()) {
76 if (next ==
null)
break;
Handles the movement for the player.
void finish()
Removes the first waypoint which is only used for calculating directions.
void reset()
Resets the walking queue so it contains no more steps.
void addStep(int x, int y)
Adds a single step to the walking queue, filling in the points to the previous point in the queue if ...
final Deque< Position > moves
The deque of all the moves the path has.
void addSteps(final Movement movement)
Position getOrigin()
Gets the starting location of the path.
Path(Deque< Position > moves)
Creates a new Path.
boolean isPossible()
Gets the condition if the path is possible.
Deque< Position > getMoves()
Gets all moves of the Path.
Position getDestination()
Gets the ending location of the path.
Position poll()
Removing one of the last(but first in the queue) walking points.
Represents a single tile on the game world.
int getY()
Gets the absolute y coordinate.
int getX()
Gets the absolute x coordinate.