Package networking.response

Source Code of networking.response.ResponseBuyAnimal

package networking.response;

import metadata.Constants;
import utility.GamePacket;

/**
*
* @author Xuyuan
*/
public class ResponseBuyAnimal extends GameResponse {

    private int status;
    private int animalTypeID;
    private int amount;

    public ResponseBuyAnimal() {
        responseCode = Constants.SMSG_BUY_ANIMAL;
    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16((short) status);
        packet.addInt32(animalTypeID);
        packet.addInt32(amount);
        return packet.getBytes();
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setAnimalTypeID(int animalTypeID) {
        this.animalTypeID = animalTypeID;
    }

    public void setSpentAmount(int amount) {
        this.amount = amount;
    }
}
TOP

Related Classes of networking.response.ResponseBuyAnimal

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.