@@ -69,6 +69,58 @@ public interface DamageStep {
6969 */
7070 void setSkipped (boolean skipped );
7171
72+ /**
73+ * Sets whether this step is skipped.
74+ * This has no effect if the step has already finished.
75+ *
76+ * @see #isSkipped()
77+ */
78+ default void trySetSkipped (boolean skipped ) {
79+ if (this .damageAfterSelf ().isEmpty ()) {
80+ this .setSkipped (skipped );
81+ }
82+ }
83+
84+ /**
85+ * Sets whether the children before this step are skipped.
86+ * This has no effect on steps already finished.
87+ *
88+ * @see #isSkipped()
89+ */
90+ default void trySetChildrenBeforeSkipped (boolean skipped ) {
91+ if (this .damageBeforeSelf ().isEmpty ()) {
92+ for (DamageStep child : this .childrenBefore ()) {
93+ child .trySetSkipped (skipped );
94+ }
95+ }
96+ }
97+
98+ /**
99+ * Sets whether the children after this step are skipped.
100+ * This has no effect on steps already finished.
101+ *
102+ * @see #isSkipped()
103+ */
104+ default void trySetChildrenAfterSkipped (boolean skipped ) {
105+ if (this .damageAfterChildren ().isEmpty ()) {
106+ for (DamageStep child : this .childrenAfter ()) {
107+ child .trySetSkipped (skipped );
108+ }
109+ }
110+ }
111+
112+ /**
113+ * Sets whether this step and its children are skipped.
114+ * This has no effect on steps already finished.
115+ *
116+ * @see #isSkipped()
117+ */
118+ default void trySetAllSkipped (boolean skipped ) {
119+ this .trySetChildrenBeforeSkipped (skipped );
120+ this .trySetSkipped (skipped );
121+ this .trySetChildrenAfterSkipped (skipped );
122+ }
123+
72124 /**
73125 * Skips this step.
74126 *
0 commit comments