import i18n from "../../../../i18n/i18n";
import { __SceneData } from "../../../data/sdata/SManage";

const {ccclass, property} = cc._decorator;

@ccclass
export default class WorldMapItem extends cc.Component {

    @property(cc.Label)
    mName: cc.Label = null;

    @property(cc.Sprite)
    mIcon: cc.Sprite = null;

    public sceneData:__SceneData;

    public callback:(item:WorldMapItem)=>void;

    onLoad(){
    }
    public setScene(sceneData:__SceneData){
        this.sceneData = sceneData;
        this.mName.string = i18n.t(sceneData.name);
    }
    public setCallback(callback:(item:WorldMapItem)=>void){
        this.callback = callback;
    }
    public onclick(){
        this.callback(this);
    }

}
