return Syntax.commandSyntax(right, "-T--", true);
}
@Override
public void perform(final Context context) throws LogoException {
Turtle turtle = (Turtle) context.agent;
Double newx = argEvalDouble(context, 0);
Double newy = argEvalDouble(context, 1);
try {
double xvalue = newx.doubleValue();
double yvalue = newy.doubleValue();
double x = turtle.shortestPathX(xvalue);
double y = turtle.shortestPathY(yvalue);
if (x != xvalue) {
newx = Double.valueOf(x);
}
if (y != yvalue) {
newy = Double.valueOf(y);
}
turtle.xandycor(newx, newy);
} catch (org.nlogo.api.AgentException e) {
throw new EngineException(context, this,
I18N.errorsJ().getN("org.nlogo.prim.etc._setxy.pointOutsideWorld",
newx.doubleValue(), newy.doubleValue()));
}