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


package engine.devcmd.cmds;

import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager;
import engine.objects.*;

public class RegionCmd extends AbstractDevCmd {

    public RegionCmd() {
        super("region");
    }

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

        String newline = "\r\n ";
        String output;
        output = "Target Region Information:" + newline;

        Building building = BuildingManager.getBuildingAtLocation(((AbstractCharacter) target).loc);
        if (building == null) {
            this.throwbackInfo(pc, "No Building At This Location.");
        }
        Regions region = ((AbstractCharacter) target).region;
        if (region == null) {
            this.throwbackInfo(pc, "No Region Found.");
            return;
        }

        if (region != null) {
            output += "Player Info: " + ((AbstractCharacter) target).getName() + newline;
            output += "Region Building: " + building.getName() + newline;
            output += "Region Height: " + region.lerpY((AbstractCharacter) target) + newline;
            output += "is Stairs: " + region.isStairs() + newline;
            output += "is Outside: " + region.isOutside();
            this.throwbackInfo(pc, output);
        }

    }

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

    @Override
    protected String _getUsageString() {
        return "' /setBuildingCollidables add/remove 'add creates a collision line.' needs 4 integers. startX, endX, startY, endY";

    }

}
