return Collections.unmodifiableMap(getTasks());
}
public void pauseScript(final int id) {
final LoopTask s = getTasks().get(id);
s.setPaused(!s.isPaused());
if (s instanceof Script) {
if (s.isPaused()) {
((Script) s).onPause();
} else {
((Script) s).onResume();
}
}
if (s.isPaused()) {
for (final ScriptListener l : listeners) {
l.scriptPaused(this);
}
} else {
for (final ScriptListener l : listeners) {
l.scriptResumed(this);
}
}
for (final Map.Entry<Integer, LoopTask> lt : getTasks().entrySet()) {
lt.getValue().setPaused(s.isPaused());
}
}