// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.npc.navigation;

import com.hypixel.hytale.server.npc.movement.controllers.MotionController;
import javax.annotation.Nonnull;
import com.hypixel.hytale.logger.HytaleLogger;

public class AStarDebugWithTarget extends AStarDebugBase
{
    protected final AStarWithTarget aStarWithTarget;
    
    public AStarDebugWithTarget(final AStarWithTarget aStarWithTarget, @Nonnull final HytaleLogger logger) {
        super(aStarWithTarget, logger);
        this.aStarWithTarget = aStarWithTarget;
    }
    
    @Override
    protected int getDumpMapRegionZ(final int def) {
        return AStarBase.zFromIndex(this.aStarWithTarget.getTargetPositionIndex());
    }
    
    @Override
    protected int getDumpMapRegionX(final int def) {
        return AStarBase.xFromIndex(this.aStarWithTarget.getTargetPositionIndex());
    }
    
    @Override
    protected void drawMapFinish(@Nonnull final StringBuilder[] map, final int minX, final int minZ) {
        super.drawMapFinish(map, minX, minZ);
        this.plot(this.aStarWithTarget.getTargetPositionIndex(), '\u03a9', map, minX, minZ);
    }
    
    @Nonnull
    @Override
    protected String getExtraLogString(final MotionController controller) {
        return String.format("end=%s dist=%s", AStarBase.positionIndexToString(this.aStarWithTarget.getTargetPositionIndex()), this.aStarWithTarget.getEvaluator().estimateToGoal(this.aStarWithTarget, this.aStarWithTarget.getStartPosition(), controller));
    }
}
