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


package engine.jobs;

import engine.gameManager.PowersManager;
import engine.job.AbstractScheduleJob;
import engine.net.client.msg.PerformActionMsg;
import engine.objects.AbstractWorldObject;
import engine.objects.PlayerCharacter;
import engine.wpakpowers.WpakPowerManager;

public class WpakUsePowerJob extends AbstractScheduleJob {

    private final PlayerCharacter pc;
    private final PerformActionMsg msg;
    private AbstractWorldObject target;

    public WpakUsePowerJob(PlayerCharacter pc, PerformActionMsg msg, AbstractWorldObject tar) {
        super();
        this.pc = pc;
        this.msg = msg;
        this.target = tar;
    }

    @Override
    protected void doJob() {
        WpakPowerManager.finishUsePower(this.msg, this.pc,this.target);
    }

    @Override
    protected void _cancelJob() {
        //cast stopped early, reset recycle timer
        PowersManager.finishRecycleTime(this.msg, this.pc, true);
    }
}
