class Item {
    public id: number;//id
    public type: number;//商品类型
    public name: string;//商品名称
    public icon: string;//商品图片--可用type生成
    public growthValue: number;//生长值
    public cost: number;//费用
    public cover: string;
    public discount: number;//折扣
    public num: number;//拥有数量
    public levelLimite: number;//等级限制
    constructor(obj: any) {
        this.id = obj.id;
        this.type = obj.type;
        this.name = obj.name;
        this.icon = obj.icon;
        this.growthValue = obj.growthValue;
        this.cost = obj.cost;
        this.cover = obj.cover;
        this.discount = obj.discount || 1;
        this.num = obj.amount;
        this.levelLimite = obj.levelLimite;
    }
}

export default Item;