public void SaveAnvilChunkTest() { int width = 32; int depth = 32; int regionX = 5; int regionZ = 24; AnvilWorldProvider anvil = new AnvilWorldProvider(@"D:\Development\Worlds\KingsLanding\"); anvil.Initialize(); Stopwatch sw = new Stopwatch(); sw.Start(); for (int x = 0; x < 32; x++) { for (int z = 0; z < 32; z++) { int cx = (width*regionX) + x; int cz = (depth*regionZ) + z; ChunkCoordinates coordinates = new ChunkCoordinates(cx, cz); ChunkColumn chunk = anvil.GenerateChunkColumn(coordinates); Assert.NotNull(chunk); } } Console.WriteLine("Read {0} chunks in {1}ms", anvil.NumberOfCachedChunks(), sw.ElapsedMilliseconds); sw.Restart(); anvil.SaveChunks(); Console.WriteLine("Saved {0} chunks in {1}ms", anvil.NumberOfCachedChunks(), sw.ElapsedMilliseconds); for (int x = 0; x < 32; x++) { for (int z = 0; z < 32; z++) { int cx = (width*regionX) + x; int cz = (depth*regionZ) + z; ChunkCoordinates coordinates = new ChunkCoordinates(cx, cz); anvil.GenerateChunkColumn(coordinates); } } }
public void SaveOneAnvilChunkTest() { int width = 32; int depth = 32; int cx = (width*4) + 3; int cz = (depth*25) + 0; AnvilWorldProvider anvil = new AnvilWorldProvider(@"D:\Development\Worlds\KingsLanding\"); anvil.Initialize(); ChunkCoordinates coordinates = new ChunkCoordinates(cx, cz); ChunkColumn chunk = anvil.GenerateChunkColumn(coordinates); Assert.NotNull(chunk); Stopwatch sw = new Stopwatch(); sw.Start(); anvil.SaveChunks(); Assert.Less(sw.ElapsedMilliseconds, 1); }