package parsenodes.turtlenodes;

import parse.NodeInformation;
import parsenodes.NodeTurtle;
import parserInformation.ParserInformation;

public class NodeLeft extends NodeTurtle {

    public NodeLeft (NodeInformation nodeInformation,
                     ParserInformation parserInformation) throws Exception {
        super(nodeInformation, parserInformation, 1);
    }

    @Override
    protected double turtleEvaluate () {
        double degrees = myChildrenValues.get(0);
        double shortDegrees = (degrees % TOTAL_DEGREES + TOTAL_DEGREES) % TOTAL_DEGREES;
        nextState.setAngle(nextState.getAngle() + shortDegrees);
        return degrees;
    }

}
