import javax.vecmath.Point3d;


/**
 * This class is a packet of state information for the Interpreter "turtle".
 * (called by: Lsystem.java, Interpreter.java)
 * 
 * @author Scott Teresi, April 1999, www.teresi.us
 */



public class State {

  public Point3d curPos;          // current cursor position
  public double angle;            // current direction the turtle is pointing
  public double angleInc;         // angle increment value
  public double lineLength;       // length of line segment drawn by turtle
  public boolean swapDirections;  // swap the meaning of turn-right/turn-left?


  public State () {
    // initialize state to defaults
    setState (new Point3d(0d, 0d, 0d), 0.0, 1.0, 10.0, false);
  }


  public State (Point3d pt, double a, double ai, double l, boolean s) {
    setState(pt, a, ai, l, s);
  }


  public State (State s) {
    setState (s.curPos, s.angle, s.angleInc, s.lineLength, s.swapDirections);
  }


  public void setState (Point3d pt, double a, double ai, double l, boolean s) {
    curPos = pt;
    angle = a;
    angleInc = ai;
    lineLength = l;
    swapDirections = s;
  }

}
