import i18n from "../../i18n/i18n";
import { Zone } from "../Area";

const {ccclass, property} = cc._decorator;

@ccclass
export default class ZoneItem extends cc.Component {

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

    public zone:Zone;
    public callback:(item:ZoneItem)=>void;
    onLoad () {
        this.mZoneName.string = i18n.t(this.zone.name);
    }

    public setCallback(callback:(item:ZoneItem)=>void){
        this.callback = callback;
    }

    public onclick(){
        this.callback(this);
    }
}
