package inn.ocsf.bee.freigeld.core.model;

public enum CoinValue {
    one(1, 364),
    two(2, one.amount * 2),
    three(3, one.amount * 3),
    five(5, one.amount * 5),
    ten(10, one.amount * 10),
    quarter(25, one.amount * 25),
    half(50, one.amount * 50),
    full(100, one.amount * 100),
    bi(200, one.amount * 200),
    mega(500, one.amount * 500),
    internal(1000, one.amount * 1000),
    myinternal(2000, one.amount * 2000),
    sointernal(5000, one.amount * 5000),
    biginternal(10000, one.amount * 10000);

    public static final Long MAX_ERA = one.amount;

    private final int quantity;
    private final long amount;

    CoinValue(int quantity, long amount) {
        this.quantity = quantity;
        this.amount = amount;
    }

    public int getQuantity() {
        return quantity;
    }

    public long getAmount() {
        return amount;
    }

    public long getDelta() {
        return amount / MAX_ERA;
    }

    public long getCurrent(Integer era) {
        return amount - (era * getDelta());
    }
}
