Package networking.response

Source Code of networking.response.ResponseUpdatePlantBiomass

package networking.response;

import metadata.Constants;
import utility.GamePacket;

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

    private short plantID;
    private short biomass;
    private short targetBiomass;
    private short targetTime;

    public ResponseUpdatePlantBiomass() {
        responseCode = Constants.SMSG_UPDATE_PLANT_BIOMASS;
    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(plantID);
        packet.addShort16(biomass);
        packet.addShort16(targetBiomass);
        packet.addShort16(targetTime);

        return packet.getBytes();
    }

    public void setPlantID(short plantID) {
        this.plantID = plantID;
    }

    public void setBiomass(int biomass) {
        this.biomass = (short) biomass;
    }

    public void setTargetBiomass(int targetBiomass) {
        this.targetBiomass = (short) targetBiomass;
    }

    public void setTargetTime(int targetTime) {
        this.targetTime = (short) targetTime;
    }
}
TOP

Related Classes of networking.response.ResponseUpdatePlantBiomass

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.