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]; } }
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); }