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


package engine.net.client.msg;


import engine.net.AbstractConnection;
import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter;
import engine.net.Protocol;

public class RefineMsg extends ClientNetMsg {

    private int npcType;
    public int npcID;
    private int unknown01;
    public int type;
    public int token;
    private int unknown02;

    /**
     * This is the general purpose constructor.
     */
    public RefineMsg() {
        super(Protocol.ARCUNTRAINABILITY);
    }

    public RefineMsg(int npcType, int npcID, int type, int token) {
        super(Protocol.ARCUNTRAINABILITY);
        this.npcType = npcType;
        this.npcID = npcID;
        this.unknown01 = 1;
        this.type = type;
        this.token = token;
        this.unknown02 = 0;
    }

    /**
     * This constructor is used by NetMsgFactory. It attempts to deserialize the
     * ByteBuffer into a message. If a BufferUnderflow occurs (based on reading
     * past the limit) then this constructor Throws that Exception to the
     * caller.
     */
    public RefineMsg(AbstractConnection origin, ByteBufferReader reader) {
        super(Protocol.ARCUNTRAINABILITY, origin, reader);
    }

    /**
     * Serializes the subclass specific items to the supplied NetMsgWriter.
     */
    @Override
    protected void _serialize(ByteBufferWriter writer) {
        writer.putInt(this.npcType);
        writer.putInt(this.npcID);
        writer.putInt(this.unknown01);
        writer.putInt(this.type);
        writer.putInt(this.token);
        writer.putInt(this.unknown02);
    }

    /**
     * Deserializes the subclass specific items from the supplied NetMsgReader.
     */
    @Override
    protected void _deserialize(ByteBufferReader reader) {
        this.npcType = reader.getInt();
        this.npcID = reader.getInt();
        this.unknown01 = reader.getInt();
        this.type = reader.getInt();
        this.token = reader.getInt();
        this.unknown02 = reader.getInt();
    }

    public int getNpcType() {
        return this.npcType;
    }

    public int getNpcID() {
        return this.npcID;
    }

    public int getUnknown01() {
        return this.unknown01;
    }

    public void setUnknown01(int value) {
        this.unknown01 = value;
    }

    public int getType() {
        return this.type;
    }

    public void setType(int value) {
        this.type = value;
    }

    public int getToken() {
        return this.token;
    }

    public void setToken(int value) {
        this.token = value;
    }

    public int getUnknown02() {
        return this.unknown02;
    }

    public void setUnknown02(int value) {
        this.unknown02 = value;
    }
}
