package net.northking.cctp.upperComputer.driver.ios.command.data;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class PressAndDragUiNodeData extends DragUiNodeData {
    public double pressDuration;

    public double speed;

    public double holdDuration;

    public void setPressDuration(double pressDuration) {
        this.pressDuration = pressDuration;
    }

    public double getPressDuration() {
        return pressDuration;
    }

    public void setSpeed(double speed) {
        this.speed = speed;
    }

    public double getSpeed() {
        return speed;
    }

    public void setHoldDuration(double holdDuration) {
        this.holdDuration = holdDuration;
    }

    public double getHoldDuration() {
        return holdDuration;
    }

    @Override
    public void buildFromInput(DataInput dataInput) throws IOException {
        super.buildFromInput(dataInput);
        pressDuration = dataInput.readDouble();
        speed = dataInput.readDouble();
        holdDuration = dataInput.readDouble();
    }

    @Override
    public void encodeToOutput(DataOutput dataOutput) throws IOException {
        super.encodeToOutput(dataOutput);
        dataOutput.writeDouble(pressDuration);
        dataOutput.writeDouble(speed);
        dataOutput.writeDouble(holdDuration);
    }
}
