Package org.nlogo.prim.etc

Source Code of org.nlogo.prim.etc._shapes

// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo

package org.nlogo.prim.etc;

import org.nlogo.api.LogoListBuilder;
import org.nlogo.api.Shape;
import org.nlogo.api.Syntax;
import org.nlogo.nvm.Context;
import org.nlogo.nvm.Reporter;

import java.util.List;

public final strictfp class _shapes
    extends Reporter {
  @Override
  public Syntax syntax() {
    return Syntax.reporterSyntax(Syntax.ListType());
  }

  @Override
  public Object report(Context context) {
    List<Shape> shapes = world.turtleShapeList().getShapes();
    LogoListBuilder result = new LogoListBuilder();
    for (Shape shape : shapes) {
      result.add(shape.getName());
    }
    return result.toLogoList();
  }
}
TOP

Related Classes of org.nlogo.prim.etc._shapes

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.