import Item from "./item";
class HouseItem extends Item {
    public itemImage: string; // 
    public kind: string; // 商品种类
    // public own: boolean;
    public rect: {x: number, y: number, width: number, height: number}
    public current = false;
    public defaultId: number;
    constructor(obj: any) {
        super(obj);
        // if (obj.type == 1) {
        //     this.kind = 'FOOD';
        // } else if (obj.type == 2) {
        // }
        if ( obj.meta_value && obj.meta_value.kind) {
            this.kind = obj.meta_value.kind;
        }
        if (obj.meta_value && obj.meta_value.item) {
            this.itemImage = obj.meta_value.item;
        }
        // this.num = obj.amount;
        this.rect = obj.meta_value.rect;
        this.defaultId = obj.defaultId;
        // console.log(222, obj)
    }
}

export default HouseItem;