public void GenerateWorld(GenerationSettings settings, BackgroundWorker worker = null) { GenerationData genData = generator.Generate(settings, worker); worldData = new WorldData(genData); worldData.SetName(settings.name); }
private void DeserializeWorldHeader(WorldData worldData) { worldData.SetName(reader.ReadString()); int width = reader.ReadInt32(); int height = reader.ReadInt32(); int spawnX = reader.ReadInt32(); int spawnY = reader.ReadInt32(); WorldHeader header = new WorldHeader(); header.width = width; header.height = height; header.spawnArea = new Rectangle(spawnX, spawnY, Config.SPAWN_AREA_SIZE, Config.SPAWN_AREA_SIZE); worldData.SetHeader(header); }