@Override
public void drawTradingPathLine(ShortPoint2D start, ShortPoint2D[] waypoints, boolean draw) {
ShortPoint2D lastWaypoint = start;
float progress = 0;
for (ShortPoint2D currentWaypoint : waypoints) {
if (currentWaypoint == null) {
continue;
}
float fixedProgress = progress;
MapLine.stream(lastWaypoint, currentWaypoint)
.filterBounds(width, height)
.forEach((x, y) -> {
if (draw) {
mapObjectsManager.addBuildingWorkAreaObject(x, y, fixedProgress);
} else {
mapObjectsManager.removeMapObjectType(x, y, EMapObjectType.WORKAREA_MARK);
}
});
lastWaypoint = currentWaypoint;
progress += 1f / (waypoints.length - 1);
}
}