const Api = require('../net/Api');

cc.Class({
    extends: cc.Component,

    properties: {
        questItem: {
            default: null,
            type: cc.Node,
        },
        questWrap: {
            tooltip: '每日任务容器',
            default: null,
            type: cc.Node
        },
        actGifts: {
            tooltip: '活跃度奖励节点',
            default: [],
            type: [cc.Node]
        },
        actGiftSprite: {
            tooltip: '活跃度奖励素材',
            default: [],
            type: [cc.SpriteFrame]
        },
        actProgress: {
            tooltip: '每日活跃度进度',
            default: null,
            type: cc.Node
        }
    },


    onLoad () {

    },

    init (quest) {
        this.quest = quest

        let initSize = Math.floor(Math.random() * 8) + 4

        for(let i = 0; i < initSize; i++) {
            let item = cc.instantiate(this.questItem)
            this.questWrap.addChild(item)
            item.getComponent('QuestDailyItem').init(i % 3)
        }
    },

    start () {

    }
});
