
const { LevelHomeArtistItemStyle } = require('../utils/GameEnum')
const Api = require('../net/Api');
const DWTool = require('../utils/DWTool');
const AlertManager = require('../utils/AlertManager');

cc.Class({
    extends: cc.Component,

    properties: {
       
        addBtn: cc.Button,

        artistNode: cc.Node,

        headSprite: cc.Sprite,
    },

    // LIFE-CYCLE CALLBACKS:
    init(style = LevelHomeArtistItemStyle.Add) {
        this.setStyle(style);
    },

    onLoad () {
    },

    setStyle(style) {

        if (this.style === style) {
            return;
        }
        switch (style) {
            case LevelHomeArtistItemStyle.Add:
                this.addBtn.node.active = true;
                this.artistNode.active = false;
                break;
            case LevelHomeArtistItemStyle.Artist:
                this.addBtn.node.active = false;
                this.artistNode.active = true;
                break;
            default:
                break;
        }
    },

    addArtist() {
        AlertManager.showArtistResident();
    },

    // update (dt) {},
});
