OSDN Git Service

W.I.P. Heightmap, needs handling for permeable blocks
[automap/automap.git] / Automap / Data / ColumnMeta.cs
index f571df0..bdba0f7 100644 (file)
@@ -90,8 +90,7 @@ namespace Automap
                public ushort[,] HeightMap;//Needs to be 'flattened' for Protocol-Buffer serialization
 
                [ProtoMember(13)]
-               private ushort[] _flattened_HeightMap;
-
+               private ushort[] _flattened_HeightMap;                  
 
                /// <summary>
                /// Column Presense Bitmap
@@ -131,6 +130,18 @@ namespace Automap
                        this.YMax = mapChunk.YMax;
                }
 
+               internal void ResetMetadata(int mapSizeY )
+               {
+               if (this.ColumnPresense == null) { this.ColumnPresense = new BitArray((mapSizeY / this.ChunkSize), false); }            
+
+               //Start fresh...
+               HeightMap = new ushort[ChunkSize, ChunkSize]; 
+               RockRatio = new Dictionary<int, uint>(this.RockRatio.Count);
+               AirBlocks = 0;
+               NonAirBlocks = 0;
+               YMax = 0;
+               }
+
                [ProtoBeforeSerialization]
                private void PrepareData()
                {