/** * @file MapModelComp.ts * @description 地图数据模型组件(ECS 纯数据层) * * 职责: * 1. 存储地图相关的 **静态配置数据**(编号、资源路径等)。 * 2. 作为 GameMap 实体的数据层,由 ECS 自动注册和管理。 * 3. 不包含任何视图逻辑,纯粹作为数据容器供视图层读取。 * * 关键属性: * - id:地图编号,标识当前加载的关卡。 * - resPrefab:地图显示预制体的资源路径,由 GameMap.load() 异步加载。 * * 注释掉的代码说明: * - resConfigMap / resDeliveryMap:计划中的地图配置和传送点数据路径(已废弃)。 * - getResContentMiniMap / getResContentSlices / getResContentData: * 瓦片地图相关的资源路径生成方法(当前版本不使用瓦片地图)。 * * 依赖: * - ecs(ECS 框架)—— 通过 @ecs.register 注册为 ECS 组件 */ /* * @Author: dgflash * @Date: 2022-08-04 15:08:34 * @LastEditors: dgflash * @LastEditTime: 2022-08-04 15:23:20 */ import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; /** * MapModelComp —— 地图数据模型 * * 存储地图编号和预制体路径等静态配置。 * 由 GameMap 实体在 init() 阶段自动挂载。 */ @ecs.register('MapModel') export class MapModelComp extends ecs.Comp { /** 初始地图编号(当前固定为 1) */ id: number = 1; // /** 地图数据配置路径(已废弃) */ // resConfigMap: string = "config/map/map"; // /** 地图转场点数据配置路径(已废弃) */ // resDeliveryMap: string = "config/map/map_delivery"; /** 地图显示预制体资源路径(由 GameMap.load() 加载) */ resPrefab: string = "game/map/map_rpg"; // /** 获取小地图纹理资源路径(已废弃) */ // getResContentMiniMap(mapName: string): string { // return `content/map/${mapName}/${mapName}/miniMap/texture`; // }; // /** 获取地图瓦片资源路径(已废弃) */ // getResContentSlices(bgName: string, key: string): string { // return `content/map/${bgName}/${bgName}/slices/${key}/texture`; // }; // /** 获取地图数据资源路径(已废弃) */ // getResContentData(mapName: string): string { // return `content/map/${mapName}/${mapName}`; // }; /** ECS 组件移除时的释放钩子(当前无需清理) */ reset() { } }