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


import net.northking.cctp.upperComputer.driver.ios.packet.ICommandData;

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

public class ScreenInfoData implements ICommandData {
    private double width;
    private double height;
    private byte orientation;
    private double scale;

    @Override
    public void buildFromInput(DataInput dataInput) throws IOException {
        width = dataInput.readDouble();
        height = dataInput.readDouble();
        orientation = dataInput.readByte();
        scale = dataInput.readDouble();
    }

    @Override
    public void encodeToOutput(DataOutput dataOutput) throws IOException {
        dataOutput.writeDouble(width);
        dataOutput.writeDouble(height);
        dataOutput.write(orientation);
        dataOutput.writeDouble(scale);
    }

    public double getWidth() {
        return width;
    }

    public double getHeight() {
        return height;
    }

    public byte getOrientation() {
        return orientation;
    }

    public double getScale() {
        return scale;
    }

    @Override
    public String toString() {
        return "ScreenInfo{" +
                "width=" + width +
                ", height=" + height +
                ", orientation=" + orientation +
                ", scale=" + scale +
                '}';
    }
}
