/* * @Author: WoNiu * @Date: 2024-03-16 16:34:19 * @LastEditTime: 2024-03-28 21:09:58 * @LastEditors: WoNiu * @Description: 地图地块的行为控制器 */ import { _decorator, Component, } from "cc"; import { MapTileData, MapTileType } from "./MapTileType"; const { ccclass } = _decorator; @ccclass("MapTileController") export class MapTileController extends Component { /// 地块数据 private _tileData: MapTileData; get tileData(){ return this._tileData; }; /// 地块类型 private _tileType: MapTileType; set tileType(newType: MapTileType){ this._tileType = newType; this._tileData = MapTileData.getData(newType as MapTileType); }; get tileType(){ return this._tileType; }; /// 地块占领状态(是谁占领的,) private occupState: string; /// 占领等级 private occupyLevel: 0 | 1 | 2 | 3; /// 决斗场等级 private fightLevel: 2 | 4 | 8; /// 进入选择地下城状态,海上列车选择,决斗场选择 start() { const location = this._tileData.location; this.node.setPosition(location.x,location.y); } update(deltaTime: number) {} }