public void Undo() { BeatmapAction lastActive = beatmapActions.LastOrDefault(x => x.Active); if (lastActive == null) { return; } Debug.Log($"Undid a {lastActive.GetType().Name}."); BeatmapActionParams param = new BeatmapActionParams(this); lastActive.Undo(param); lastActive.Active = false; }
public void Undo() { if (!beatmapActions.Any()) { return; } BeatmapAction lastActive = beatmapActions.LastOrDefault(x => x.Active); if (lastActive == null) { return; } Debug.Log($"Undid a {lastActive?.GetType()?.Name ?? "UNKNOWN"}. ({lastActive?.Comment ?? "Unknown comment."})"); BeatmapActionParams param = new BeatmapActionParams(this); lastActive.Undo(param); lastActive.Active = false; }