import { Deserialize } from "../../app/models/util/deserialize.model"; import { IslandInstanceModel } from "../../app/models/atlasData/island-instance.model"; export class IslandDataModel implements Deserialize { name: string; x: number; y: number; imagePath: string; landscapeMaterialOverride: number; sublevelNames: string[]; spawnerOverrides: object; extraSublevels: string[]; treasureMapSpawnPoints: string[]; wildPirateCampSpawnPoints: string[]; minTreasureQuality: number; maxTreasureQuality: number; useNpcVolumesForTreasures: boolean; useLevelBoundsForTreasures: boolean; prioritizeVolumesForTreasures: boolean; islandTreasureBottleSupplyCrateOverrides: string; islandPoints: number; singleSpawnPointX: number; singleSpawnPointY: number; singleSpawnPointZ: number; // De-parsed from the name islandType: string; islandShape: string; climate: string; variant: string; private _climateLookup = { CH: "High Desert", CL: "Low Desert", CP: "Polar", EE: "Equatorial", ET: "Eastern Temperate", PO: "Polar", TR: "Tropical", WF: "West Temperate", WR: "West Tropical", WT: "West Temperate", WU: "West Tundra", ER: "East Tropical", EU: "East Tundra", BO: "Tropical", CU: "Central Tundra" }; private _variantLookup = { E: 'Freeport', PVE: 'Event' }; deserialize(input: any): this { Object.assign(this, input); const parsedName = this.name.split('_'); this.islandType = parsedName[0]; this.islandShape = parsedName[1]; this.climate = this._climateLookup[parsedName[2]]; this.variant = parsedName[3] === undefined ? 'Original' : this._variantLookup[parsedName[3]] === undefined ? parsedName[3] : this._variantLookup[parsedName[3]]; return this; } customDisplayName(): string { return `${this.islandType} (${this.islandShape}) - ${this.climate} (${this.variant})` } }