re-implemented Delayed Action

This commit is contained in:
Stephan Richter
2020-11-01 16:06:46 +01:00
parent 7eabaf9449
commit a89d522ea2
4 changed files with 79 additions and 99 deletions

View File

@@ -60,19 +60,10 @@ public class ConditionalAction extends Action {
@Override
public boolean fire(Context context) throws IOException {
for (Condition condition : conditions) {
if (condition.fulfilledBy(context) != condition.inverted) return fireActions(context);
if (condition.fulfilledBy(context) != condition.inverted) return actions.fire(context);
}
return false;
}
private boolean fireActions(Context context) {
for (Action action : actions) try {
action.fire(context);
} catch (IOException e) {
LOG.warn("Was not able to fire {}",action);
}
return true;
}
@Override
public JSONObject json() {