import { TD } from "../../../../../App";
import { TbGEntity } from "../../../../../config/data/schema";
import GAttributeBase from "../GAttributeBase";

//默认属性
export default class GDefaultAttribute extends GAttributeBase{

    update() { }

    set(info:TbGEntity.TAttributeValue[]){
        this.attributes = {};

        //获取全部属性信息
        TD.TbGAttribute.getDataList().forEach(attr => {
            //默认 0
            this.attributes[attr.id] = 0;
        });

        info.forEach(item => this.attributes[item.id] += item.value);
        
        return this;
    }

}