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


package engine.devcmd.cmds;

import engine.Enum;
import engine.Enum.BuildingGroup;
import engine.Enum.GameObjectType;
import engine.Enum.TargetColor;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager;
import engine.gameManager.PowersManager;
import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable;
import engine.objects.*;
import engine.powers.EffectsBase;
import engine.server.MBServerStatics;
import engine.util.StringUtils;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap;


/**
 * @author
 */
public class PrintEffectsCmd extends AbstractDevCmd {

    public PrintEffectsCmd() {
        super("printeffects");
    }

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

        if(!target.getObjectType().equals(GameObjectType.PlayerCharacter)) {
            throwbackInfo(pc, "Target Must PlayerCharacter");
            return;
        }
        String newline = "\r\n ";
        String output = "Effects for Player:" + newline;

        AbstractCharacter absTar = (AbstractCharacter) target;

        for(String key : absTar.effects.keySet()){
            Effect eff = absTar.effects.get(key);
            if(eff.getJobContainer() != null) {
                output += "[" + key + "] " + eff.getName() + " (" + eff.getTrains() + ") " + eff.getJobContainer().timeToExecutionLeft() * 0.001f + newline;
            }else{
                output += eff.getName() + " (" + eff.getTrains() + ") " + "PERMANENT" + newline;
            }
        }

        throwbackInfo(pc, output);
    }

    @Override
    protected String _getHelpString() {
        return "Gets information on an Object.";
    }

    @Override
    protected String _getUsageString() {
        return "' /info targetID'";
    }

}
