Beispiel #1
0
        public void DamageChunk(Coordinates2D coords)
        {
            var x = coords.X / Width - (coords.X < 0 ? 1 : 0);
            var z = coords.Z / Depth - (coords.Z < 0 ? 1 : 0);

            DirtyChunks.Add(new Coordinates2D(coords.X - x * 32, coords.Z - z * 32));
        }
Beispiel #2
0
 /// <summary>
 ///  Sets the chunk at the specified local position to the given value.
 /// </summary>
 public void SetChunk(Coordinates2D position, IChunk chunk)
 {
     Chunks[position] = chunk;
     chunk.IsModified = true;
     DirtyChunks.Add(position);
     chunk.ParentRegion = this;
 }
Beispiel #3
0
        public void DamageChunk(Coordinates2D coords)
        {
            int x = coords.X / Region.Width - ((coords.X < 0) ? 1 : 0);
            int z = coords.Z / Region.Depth - ((coords.Z < 0) ? 1 : 0);

            DirtyChunks.Add(new Coordinates2D(coords.X - x * 32, coords.Z - z * 32));
        }
Beispiel #4
0
        public void GenerateChunk(Coordinates2D position)
        {
            var globalPosition = Position * new Coordinates2D(Width, Depth) + position;
            var chunk          = World.ChunkProvider.GenerateChunk(World, globalPosition);

            chunk.IsModified   = true;
            chunk.Coordinates  = globalPosition;
            chunk.ParentRegion = this;
            DirtyChunks.Add(position);
            Chunks[position] = chunk;
            World.OnChunkGenerated(new ChunkLoadedEventArgs(chunk));
        }