Code example for Deque

Methods: removeFirst

0
		waypoints.add(new MovementPoint(p.x(), p.y(), Direction.NONE));
	} 
	 
	public void finish() 
	{ 
		waypoints.removeFirst();
	} 
	 
	public void addToPath(Position position)
	{ 
		if (waypoints.size() == 0)
		{ 
			reset(); 
		} 
		 
		MovementPoint last = waypoints.peekLast();
		int deltaX = position.x() - last.x();
		int deltaY = position.y() - last.y();
		int max = Math.max(Math.abs(deltaX), Math.abs(deltaY));
		 
		for (int i = 0; i < max; i++)