// • ▌ ▄ ·.  ▄▄▄·  ▄▄ • ▪   ▄▄· ▄▄▄▄·  ▄▄▄·  ▐▄▄▄  ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀  █▪▀▀▀ ▀  ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀  ▀  ▀ ▀▀  █▪ ▀▀▀
//      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 TransferBuildingMsg extends ClientNetMsg {

    private int objectType;
    private int objectID;
    private int targetType;
    private int targetID;
    private int pad = 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 TransferBuildingMsg(AbstractConnection origin, ByteBufferReader reader) {
        super(Protocol.TRANSFERASSET, origin, reader);
    }

    /**
     * Deserializes the subclass specific items from the supplied NetMsgReader.
     */
    @Override
    protected void _deserialize(ByteBufferReader reader) {
        this.pad = reader.getInt();
        this.objectType = reader.getInt();
        this.objectID = reader.getInt();
        this.targetType = reader.getInt();
        this.targetID = reader.getInt();
    }

    /**
     * Serializes the subclass specific items to the supplied NetMsgWriter.
     */
    @Override
    protected void _serialize(ByteBufferWriter writer) {
        writer.putInt(this.pad);
        writer.putInt(this.objectType);
        writer.putInt(this.objectID);
        writer.putInt(this.targetType);
        writer.putInt(this.targetID);

    }

    public int getObjectType() {
        return objectType;
    }

    public void setObjectType(int value) {
        this.objectType = value;
    }

    public int getPad() {
        return pad;
    }

    public void setPad(int value) {
        this.pad = value;
    }

    public int getTargetType() {
        return targetType;
    }

    public void setTargetObject(int targetObject) {
        this.targetType = targetObject;
    }

    public int getTargetID() {
        return targetID;
    }

    public void setTargetID(int targetID) {
        this.targetID = targetID;
    }

    public int getObjectID() {
        return objectID;
    }

    public void setObjectID(int objectID) {
        this.objectID = objectID;
    }


}