// 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: cc.Component,

    properties: {
        // foo: {
        //     // ATTRIBUTES:
        //     default: null,        // The default value will be used only when the component attaching
        //                           // to a node for the first time
        //     type: cc.SpriteFrame, // optional, default is typeof default
        //     serializable: true,   // optional, default is true
        // },
        // bar: {
        //     get () {
        //         return this._bar;
        //     },
        //     set (value) {
        //         this._bar = value;
        //     }
        // },
        star: {
            default: null,
            type: cc.AudioClip
        },
        按住: {
            default: null,
            type: cc.AudioClip
        },
        按钮: {
            default: null,
            type: cc.AudioClip
        },
        撒花: {
            default: null,
            type: cc.AudioClip
        },
        放大: {
            default: null,
            type: cc.AudioClip
        },

        letterA: {
            default: null,
            type: cc.AudioClip
        },
        letterB: {
            default: null,
            type: cc.AudioClip
        },
        letterC: {
            default: null,
            type: cc.AudioClip
        },
        letterD: {
            default: null,
            type: cc.AudioClip
        },
        letterE: {
            default: null,
            type: cc.AudioClip
        },
        letterF: {
            default: null,
            type: cc.AudioClip
        },
        letterG: {
            default: null,
            type: cc.AudioClip
        },
        letterH: {
            default: null,
            type: cc.AudioClip
        },
        letterI: {
            default: null,
            type: cc.AudioClip
        },
        letterJ: {
            default: null,
            type: cc.AudioClip
        },
        letterK: {
            default: null,
            type: cc.AudioClip
        },
        letterL: {
            default: null,
            type: cc.AudioClip
        },
        letterM: {
            default: null,
            type: cc.AudioClip
        },
        letterN: {
            default: null,
            type: cc.AudioClip
        },
        letterO: {
            default: null,
            type: cc.AudioClip
        },
        letterP: {
            default: null,
            type: cc.AudioClip
        },
        letterQ: {
            default: null,
            type: cc.AudioClip
        },
        letterR: {
            default: null,
            type: cc.AudioClip
        },
        letterS: {
            default: null,
            type: cc.AudioClip
        },
        letterT: {
            default: null,
            type: cc.AudioClip
        },
        letterU: {
            default: null,
            type: cc.AudioClip
        },
        letterV: {
            default: null,
            type: cc.AudioClip
        },
        letterW: {
            default: null,
            type: cc.AudioClip
        },
        letterX: {
            default: null,
            type: cc.AudioClip
        },
        letterY: {
            default: null,
            type: cc.AudioClip
        },
        letterZ: {
            default: null,
            type: cc.AudioClip
        },

        wordA: {
            default: null,
            type: cc.AudioClip
        },
        wordB: {
            default: null,
            type: cc.AudioClip
        },
        wordC: {
            default: null,
            type: cc.AudioClip
        },
        wordD: {
            default: null,
            type: cc.AudioClip
        },
        wordE: {
            default: null,
            type: cc.AudioClip
        },
        wordF: {
            default: null,
            type: cc.AudioClip
        },
        wordG: {
            default: null,
            type: cc.AudioClip
        },
        wordH: {
            default: null,
            type: cc.AudioClip
        },
        wordI: {
            default: null,
            type: cc.AudioClip
        },
        wordJ: {
            default: null,
            type: cc.AudioClip
        },
        wordK: {
            default: null,
            type: cc.AudioClip
        },
        wordL: {
            default: null,
            type: cc.AudioClip
        },
        wordM: {
            default: null,
            type: cc.AudioClip
        },
        wordN: {
            default: null,
            type: cc.AudioClip
        },
        wordO: {
            default: null,
            type: cc.AudioClip
        },
        wordP: {
            default: null,
            type: cc.AudioClip
        },
        wordQ: {
            default: null,
            type: cc.AudioClip
        },
        wordR: {
            default: null,
            type: cc.AudioClip
        },
        wordS: {
            default: null,
            type: cc.AudioClip
        },
        wordT: {
            default: null,
            type: cc.AudioClip
        },
        wordU: {
            default: null,
            type: cc.AudioClip
        },
        wordV: {
            default: null,
            type: cc.AudioClip
        },
        wordW: {
            default: null,
            type: cc.AudioClip
        },
        wordX: {
            default: null,
            type: cc.AudioClip
        },
        wordY: {
            default: null,
            type: cc.AudioClip
        },
        wordZ: {
            default: null,
            type: cc.AudioClip
        },
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start() {

    },

    playEffect(name, loop = false, volume = 1) {
        return new Promise((resolve, reject) => {
            const audioID = cc.audioEngine.play(this[name], loop, volume);
            cc.audioEngine.setFinishCallback(audioID, resolve);
        })
    }
    // update (dt) {},
});
