// • ▌ ▄ ·.  ▄▄▄·  ▄▄ • ▪   ▄▄· ▄▄▄▄·  ▄▄▄·  ▐▄▄▄  ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀  █▪▀▀▀ ▀  ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀  ▀  ▀ ▀▀  █▪ ▀▀▀
//      Magicbane Emulator Project © 2013 - 2022
//                www.magicbane.com


package engine.devcmd.cmds;

import engine.InterestManagement.HeightMap;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ZoneManager;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
import engine.objects.Zone;

public class GetHeightCmd extends AbstractDevCmd {

    public GetHeightCmd() {
        super("getHeight");
        this.addCmdString("height");
    }

    @Override
    protected void _doCmd(PlayerCharacter playerCharacter, String[] words,
                          AbstractGameObject target) {


        Zone currentZone;
        Zone parentZone;

        currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc());
        parentZone = HeightMap.getNextZoneWithTerrain(currentZone.getParent());

        float currentHeight = HeightMap.getWorldHeight(currentZone, playerCharacter.getLoc());
        float parentHeight = HeightMap.getWorldHeight(parentZone, playerCharacter.getLoc());

        this.throwbackInfo(playerCharacter, "Zone : " + currentZone.getName());
        this.throwbackInfo(playerCharacter, "Altitude : " + currentHeight);
        this.throwbackInfo(playerCharacter, "Parent : " + currentZone.getName());
        this.throwbackInfo(playerCharacter, "Altitude : " + parentHeight);
        this.throwbackInfo(playerCharacter, "Character Height: " + playerCharacter.getCharacterHeight());
    }

    @Override
    protected String _getHelpString() {
        return "Temporarily Changes SubRace";
    }

    @Override
    protected String _getUsageString() {
        return "' /subrace mobBaseID";
    }

}