public sealed class WaterCarveCommandRegenerating the terrain's reserved water layer, as one undo entry.
Remarks
The whole layer, because that is what non-destructive means — [§ D5](../../docs/plan/35-water.md#d5-carving-is-a-reserved-edit-layer-and-the-machinery-exists). Moving a body restores the ground it left and cuts the ground it arrived at in one operation, because the layer is deltas over ground it never touched.
⚠ The undo is a regeneration from the old body list, not a stored copy of the layer. A layer's deltas are sparse chunks over a whole terrain, and copying them per entry would put a heightfield's worth of memory on the undo stack for every drag of a width handle. Regenerating is deterministic — that is what "regenerated wholesale" is for — so the cheap thing and the correct thing are the same thing here.
Fields and properties (1)
public string NameWhat this is called in the undo history, as a person would say it.
Methods (3)
public WaterCarveCommand(Terrain terrain, IReadOnlyList<(WaterBody Body, WaterCarveProfile Profile)> before, IReadOnlyList<(WaterBody Body, WaterCarveProfile Profile)> after)Regenerating the terrain's reserved water layer, as one undo entry.
public void Do(EditorContext context)Applies the change.
public void Undo(EditorContext context)Puts back exactly what Do changed.