Ejemplo n.º 1
0
        public void GenerateWorld(GenerationSettings settings, BackgroundWorker worker = null)
        {
            GenerationData genData = generator.Generate(settings, worker);

            worldData = new WorldData(genData);
            worldData.SetName(settings.name);
        }
Ejemplo n.º 2
0
        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);
        }