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
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()
{
}
+ internal void ClearMetadata( )
+ {
+ this.HeightMap = null;
+ this.RockRatio = null;
+ this._flattened_HeightMap = null;
+ }
internal ColumnMeta Reload(ICoreClientAPI clientAPI)
{
{
for (int i = 0, maxItemsCount = this.Items.Count; i < maxItemsCount; i++) {
ColumnMeta entry = this.Items[i];
- entry.HeightMap = null;
- entry.RockRatio = null;//Also regenerated when any chunk in a column is changed...
+ entry.ClearMetadata( );
}
}