36 lines
819 B
TypeScript
36 lines
819 B
TypeScript
/*
|
|
* @Author: WoNiu
|
|
* @Date: 2024-03-27 15:20:29
|
|
* @LastEditTime: 2024-03-28 21:15:43
|
|
* @LastEditors: WoNiu
|
|
* @Description:
|
|
*/
|
|
import { MapTileType, MapTileTypes } from "./MapTileType";
|
|
import { MapTitleModel } from "./MapTitleModel";
|
|
|
|
/**
|
|
* @description: 地图数据的单例
|
|
*/
|
|
export class MapTitleDatelSingleton {
|
|
private static readonly _instance: MapTitleDatelSingleton =
|
|
new MapTitleDatelSingleton();
|
|
|
|
//* 地块nodeMap
|
|
mapModMap: Map<MapTileType, MapTitleModel> = new Map<
|
|
MapTileType,
|
|
MapTitleModel
|
|
>();
|
|
|
|
private constructor() {
|
|
|
|
MapTileTypes.forEach((type) => {
|
|
const mod = new MapTitleModel(type);
|
|
this.mapModMap.set(type, mod);
|
|
});
|
|
}
|
|
|
|
public static getInstance(): MapTitleDatelSingleton {
|
|
return MapTitleDatelSingleton._instance;
|
|
}
|
|
}
|