// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: require("BaseItemConstroller"),

    properties: {

    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        this._super();
        this.receiveinfo();
    },

    start() {

    },
    creatoritem() {

    },
    // update (dt) {},
    item_prefab() {
        cc.loader.loadResDir("prefab/Items/Belt", cc.Prefab, (err, beltArr) => {
            // ...
            console.log("belt预设：", beltArr.length);


        });
        cc.loader.loadResDir("prefab/Items/Gloves", cc.Prefab, (err, glovesArr) => {
            // ...
            console.log("gloves预设：", glovesArr.length);
        });
        cc.loader.loadResDir("prefab/Items/Belt", cc.Prefab, (err, helmArr) => {
            // ...
            console.log("helm预设：", helmArr.length);
        });
        cc.loader.loadResDir("prefab/Items/Belt", cc.Prefab, (err, necklaceArr) => {
            // ...
            console.log("necklace预设：", necklaceArr.length);
        });
        cc.loader.loadResDir("prefab/Items/Belt", cc.Prefab, (err, shoeArr) => {
            // ...
            console.log("shoe预设：", shoeArr.length);
        });
        cc.loader.loadResDir("prefab/Items/Belt", cc.Prefab, (err, kneeletArr) => {
            // ...
            console.log("kneelet预设：", kneeletArr.length);
        });
        cc.loader.loadResDir("prefab/Items/Belt", cc.Prefab, (err, topDownLoadArr) => {
            // ...
            console.log("topDownLoad预设：", topDownLoadArr.length);
        });
        cc.loader.loadResDir("prefab/Items/Belt", cc.Prefab, (err, wrist_supportArr) => {
            // ...
            console.log("Wrist_support预设：", wrist_supportArr.length);
        });
    },
    receiveinfo() {

        this.node.on("ItemInfo", (item_name, item_grade, item_master_type, item_master_value, item_Attached_num) => { //生成物品
            console.log("物品信息：", item_name, item_grade, item_master_type, item_master_value, item_Attached_num)
        }, this);
    },

    //物品 名字 等级 类型 品级 主属性 主属性数值 副属性 副属性数值
    // creator_Item(name, grade, itemtype, gradetype, mastertype, mastervalue, Attachedtype, Attachedvalue) {
    //     name;
    //     grade;
    //     itemtype;
    //     gradetype;
    //     mastertype;
    //     mastervalue;
    //     Attachedtype;
    //     Attachedvalue;

    // },

});