Example #1
0
        /// <summary>
        /// Called when the world object is constructed to initialize data.
        /// </summary>
        protected void Awake()
        {
            var world = new World(ChunkSize, ID);

            m_WorldContainer = new WorldContainer(world, this);
            m_WorldSaver     = new WorldSaver(world);

            m_ChunkCreator     = new ChunkCreator(this);
            m_ChunkMeshBuilder = new ChunkMeshBuilder(this);
        }
Example #2
0
        /// <summary>
        /// Creates a new world container for the given world.
        /// </summary>
        /// <param name="world">The world.</param>
        /// <param name="world">The world.</param>
        internal WorldContainer(WorldProperties worldProperties)
        {
            World     = new World(worldProperties.ChunkSize, worldProperties.ID);
            BlockList = new ServerBlockList();

            EventQueue = new EventQueue();

            ChunkLoader = new ChunkLoader();
            ChunkLoader.AddChunkLoadHandler(new WorldLoader(World.ID));
            ChunkLoader.AddChunkLoadHandler(worldProperties.WorldGenerator);

            WorldSaver = new WorldSaver(World.ID);

            RemeshHandler = new RemeshHandler();
            RemeshHandler.AddDistributor(new StandardDistributor(World.ChunkSize, BlockList));
        }
Example #3
0
 /// <summary>
 /// Saves all modified chunks in this world.
 /// </summary>
 public void SaveWorld() => WorldSaver.SaveWorld(this);