import { NetManager } from '../../libs/tw/manager/NetManager';
import { DataManager } from '../../libs/tw/manager/DataManager';
import Panel from "../views/Panel";
import GameConst from '../GameConst';
import PanelCtrl from '../ctrls/panelCtrl';

export default class CampPanel extends Panel {

    public bg: eui.Image;
    public closeBtn: eui.Button;
    public sureBtn: eui.Button;
    public costTxt: eui.Label;


    private camp: number;
    private scene: any;

    start(data) {
        if (!data) {
            return;
        }
        if (data.camp) {
            this.camp = data.camp;
        }
        if (data.scene) {
            this.scene = data.scene;
        }

        if (this.costTxt) {
            this.costTxt.text = DataManager.ins.getInfoData.status.text;
        }
        switch (data.camp) {
            case 2:// 狗
                this.bg.source = `dogTipBg_png`;
                break;
            case 1:// 猫
                this.bg.source = `catTipBg_png`;
                break;
        }
    }

    initEvents() {
        super.initEvents();
        this.sureBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_sureBtn, this);
    }

    removeEvents() {
        super.removeEvents();
        this.sureBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_sureBtn, this);
    }

    onTap_sureBtn(e) {



    }

    get skinKey() { return 'Camp' }
}