// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo
package org.nlogo.prim.etc;
import org.nlogo.agent.AgentSet;
import org.nlogo.api.LogoException;
import org.nlogo.api.Syntax;
import org.nlogo.nvm.Command;
import org.nlogo.nvm.Context;
public final strictfp class _withoutinterruption
extends Command
implements org.nlogo.nvm.CustomAssembled {
@Override
public Syntax syntax() {
return Syntax.commandSyntax
(new int[]{Syntax.CommandBlockType()});
}
@Override
public String toString() {
return super.toString() + ":+" + offset;
}
@Override
public void perform(final Context context)
throws LogoException {
perform_1(context);
}
public void perform_1(final Context context)
throws LogoException {
AgentSet agentset =
new org.nlogo.agent.ArrayAgentSet
(context.agent.getAgentClass(), 1, false, world);
agentset.add(context.agent);
context.runExclusiveJob(agentset, next);
context.ip = offset;
}
public void assemble(org.nlogo.nvm.AssemblerAssistant a) {
a.add(this);
a.block();
a.done();
a.resume();
}
}