Package networking.response

Source Code of networking.response.ResponseUpdateWaterSource

package networking.response;

import metadata.Constants;
import utility.GamePacket;

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

    private short waterSourceID;
    private short zoneID;
    private short waterAmount;
    private short targetWaterAmount;
    private short targetTime;

    public ResponseUpdateWaterSource() {
        responseCode = Constants.SMSG_UPDATE_WATER_SOURCE;
    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(waterSourceID);
        packet.addShort16(zoneID);
        packet.addShort16(waterAmount);
        packet.addShort16(targetWaterAmount);
        packet.addShort16(targetTime);
        return packet.getBytes();
    }

    public void setTargetWaterAmount(short targetWaterAmount) {
        this.targetWaterAmount = targetWaterAmount;
    }

    public void setWaterAmount(short waterAmount) {
        this.waterAmount = waterAmount;
    }

    public void setWaterSourceID(short waterSourceID) {
        this.waterSourceID = waterSourceID;
    }

    public void setZoneID(short zoneID) {
        this.zoneID = zoneID;
    }

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

Related Classes of networking.response.ResponseUpdateWaterSource

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.