public static void CreateWorld(string worldName, IWorldSaveFormat format) { World world = new World(worldName, format); format.SetWorld(world); world.Format.WorldData.Create(world); Server.Instance.Worlds.Add(worldName, world); }
public static void LoadWorld(string worldName, IWorldSaveFormat format) { if (World.Exists(worldName)) { World world = new World(worldName, format); format.SetWorld(world); world.Format.WorldData.Load(world); Server.Instance.Worlds.Add(worldName, world); } else { CreateWorld(worldName); } }
private World(string worldName, IWorldSaveFormat format) { this.Name = worldName; this.Format = format; string generatorName = Server.Instance.ServerProperty.WorldGenerator.ToUpper(); this.Generator = GeneratorManager.GetGenerator(generatorName); if (this.Generator == null) { this.Generator = GeneratorManager.GetGenerator("FLAT"); } //this.Generator = GeneratorManager.GetGenerator("INFINITE"); }