public static void UpdateNatureCube(this IZone zone, Area area, Action <NatureCube> updater) { var cube = new NatureCube(zone, area); cube.Check(); var snapshot = cube.Clone(); snapshot.Check(); updater(snapshot); snapshot.Check(); if (cube.Equals(snapshot)) { return; } snapshot.Commit(); var builder = Beam.NewBuilder().WithType(BeamType.nature_effect).WithDuration(8000); Task.Delay(40).ContinueWith(t => zone.CreateBeam(builder.WithPosition(area.GetRandomPosition()))); Task.Delay(1500).ContinueWith(t => zone.CreateBeam(builder.WithPosition(area.GetRandomPosition()))); Task.Delay(2500).ContinueWith(t => zone.CreateBeams(2, () => builder.WithPosition(area.GetRandomPosition()))); }