import { Deserialize } from "../util/deserialize.model";
import { ServerSublevelModel } from "./serverSublevel.model";

export class ServerModel implements Deserialize {
  gridX: number;
  gridY: number;
  MachineIdTag: string;
  ip: string;
  name: string;
  port: number;
  gamePort: number;
  seamlessDataPort: number;
  isHomeServer: boolean;
  AdditionalCmdLineParams: string;
  OverrideShooterGameModeDefaultGameIni: object;
  floorZDist: number;
  utcOffset: number;
  transitionMinZ: number;
  GlobalBiomeSeamlessServerGridPreOffsetValues: string;
  GlobalBiomeSeamlessServerGridPreOffsetValuesOceanWater: string;
  OceanDinoDepthEntriesOverride: string;
  oceanFloatsamCratesOverride: string;
  treasureMapLootTablesOverride: string;
  oceanEpicSpawnEntriesOverrideTemplateName: string;
  NPCShipSpawnEntriesOverrideTemplateName: string;
  regionOverrides: string;
  waterColorR: number;
  waterColorG: number;
  waterColorB: number;
  skyStyleIndex: number;
  serverIslandPointsMultiplier: number;
  lastModified: string;
  lastImageOverride: string;
  islandLocked: boolean;
  discoLocked: boolean;
  pathsLocked: boolean;
  extraSublevels: string[];
  totalExtraSublevels: string[];
  islandInstances;
  discoZones;
  spawnRegions;
  serverTemplateName: string;

  sublevels: ServerSublevelModel[];

  deserialize(input: any): this {
    Object.assign(this, input);
    this.sublevels = this.sublevels.map(i => new ServerSublevelModel().deserialize(i));
    return this;
  }
}