package com.unibuy.smartdevice.structure;

public class CashSetStructure {
    private boolean billF1000;
    private boolean billE500;
    private boolean billD100;

    private boolean coinF50;
    private boolean coinE10;
    private boolean coinD5;
    private boolean coinC1;

    public CashSetStructure(boolean billF1000, boolean billE500, boolean billD100, boolean coinF50, boolean coinE10, boolean coinD5, boolean coinC1) {
        this.billF1000 = billF1000;
        this.billE500 = billE500;
        this.billD100 = billD100;
        this.coinF50 = coinF50;
        this.coinE10 = coinE10;
        this.coinD5 = coinD5;
        this.coinC1 = coinC1;
    }

    public boolean isBillF1000() {
        return billF1000;
    }

    public void setBillF1000(boolean billF1000) {
        this.billF1000 = billF1000;
    }

    public boolean isBillE500() {
        return billE500;
    }

    public void setBillE500(boolean billE500) {
        this.billE500 = billE500;
    }

    public boolean isBillD100() {
        return billD100;
    }

    public void setBillD100(boolean billD100) {
        this.billD100 = billD100;
    }

    public boolean isCoinF50() {
        return coinF50;
    }

    public void setCoinF50(boolean coinF50) {
        this.coinF50 = coinF50;
    }

    public boolean isCoinE10() {
        return coinE10;
    }

    public void setCoinE10(boolean coinE10) {
        this.coinE10 = coinE10;
    }

    public boolean isCoinD5() {
        return coinD5;
    }

    public void setCoinD5(boolean coinD5) {
        this.coinD5 = coinD5;
    }

    public boolean isCoinC1() {
        return coinC1;
    }

    public void setCoinC1(boolean coinC1) {
        this.coinC1 = coinC1;
    }

    public byte getByteByCoin1() {
        return 0x00;
    }

    public byte getByteByCoin2() {
        int u = 0;
        if (isCoinC1()) {
            u |= 1;
        };
        if (isCoinD5()) {
            u |= 2;
        }
        if (isCoinE10()) {
            u |= 4;
        }
        if (isCoinF50()) {
            u |= 8;
        }

        return (byte) u;
    }

    public byte getByteByBill1() {
        return 0x00;
    }

    public byte getByteByBill2() {
        int u = 0;

        if (isBillD100()) {
            u |= 1;
        }
        u |= 2;
        if (isBillE500()) {
            u |= 4;
        }
        if (isBillF1000()) {
            u |= 8;
        }

        return (byte) u;
    }
}
