Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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");
        }