public void SetBottomMargin(HeightmapMargin margin)
 {
     AssertMarginHasProperLength(margin, WorkingWidth);
     for (int i = 0; i < Width; i++)
     {
         _array[i, 0] = margin.MarginValues[i];
     }
 }
 public void SetLeftMargin(HeightmapMargin margin)
 {
     AssertMarginHasProperLength(margin, WorkingHeight);
     for (int i = 0; i < Height; i++)
     {
         _array[0, i] = margin.MarginValues[i];
     }
 }
 public HeightmapMarginWithInfo(HeightmapMargin heightmapMargin, MarginPosition position, int lodFactor)
 {
     _heightmapMargin = heightmapMargin;
     _position        = position;
     _lodFactor       = lodFactor;
 }
 private void AssertMarginHasProperLength(HeightmapMargin margin, int workingLength)
 {
     Preconditions.Assert(margin.WorkingLength == workingLength,
                          "Cant set margin. It has wrong length. Old working length " + workingLength + " new working length " + margin.WorkingLength);
 }