package lingtao.net.util;

import lingtao.net.bean.Product;

import java.util.List;

public class AngClothUtil {

    public static List<Product> getPrice(Double area, int count, List<Product> priceList, String[] craft) {
        area = area * count;
        Product pro = null;
        double basePrice = 0;
        double price = 0;
        double mince = 45;
        if (area <= 1) {
            basePrice = 60;
        } else if (area <= 2) {
            basePrice = 55;
        } else if (area <= 3) {
            basePrice = 50;
        } else if (area <= 4) {
            basePrice = 45;
        } else if (area <= 5) {
            basePrice = 40;
        } else if (area <= 10) {
            basePrice = 36;
        } else {
            basePrice = 33;
        }
        price = Math.ceil(basePrice * area);
        pro = new Product();
        pro.setCount(count);
        pro.setPrice(Math.max(price, mince));
        priceList.add(pro);
        return priceList;
    }
}
