<commit_before>package Statements;

import java.util.List;

import view.ViewAbstract;
import Constants.Constants;
import Model.ModelTurtle;
import Model.Pen;
import Model.TurtleManager;

public abstract class Walking extends ActionCommand{
	protected double myAngle;
	private List<String> myColors;
	
	public Walking(List<Statement> statements, ViewAbstract view,
			TurtleManager turtleManager, List<String> colors) {
		super(statements, view, turtleManager);
		myColors = colors;
	}

	@Override
	public double execute() {
		double executeResult = myStatements.get(0).execute();
		System.out.println("size of active turtles: " + myTurtleManager.getActiveTurtleIDs().size());
		for(Integer ID: myTurtleManager.getActiveTurtleIDs()){
			ModelTurtle currentTurtle = myTurtleManager.getTurtle(ID);
			currentTurtle.moveTurtle(executeResult, myAngle);
			System.out.println("X is "+currentTurtle.getX()+" Y is "+currentTurtle.getY());
			if(!currentTurtle.isDrawing()){
				myView.moveShape(currentTurtle.getX(), currentTurtle.getY(), currentTurtle.getID());
			} else {
				Pen curPen = currentTurtle.getPen();
				myView.drawShape(currentTurtle.getX(), currentTurtle.getY(),
						currentTurtle.getID(), myColors.get(curPen.getColorIndex()),
						curPen.getThickness(), curPen.getPenStroke());
			}
		}
		return executeResult;
	}
}<commit_msg>Added lambda function in walking command<commit_after>package Statements;

import java.util.List;

import view.ViewAbstract;
import Model.ModelTurtle;
import Model.Pen;
import Model.TurtleManager;

public abstract class Walking extends ActionCommand{
	protected double myAngle;
	private List<String> myColors;
	
	public Walking(List<Statement> statements, ViewAbstract view,
			TurtleManager turtleManager, List<String> colors) {
		super(statements, view, turtleManager);
		myColors = colors;
	}

	@Override
	public double execute() {
		double executeResult = myStatements.get(0).execute();
		System.out.println("size of active turtles: " + myTurtleManager.getActiveTurtleIDs().size());
		for(Integer ID: myTurtleManager.getActiveTurtleIDs()){
			ModelTurtle currentTurtle = myTurtleManager.getTurtle(ID);
			currentTurtle.moveTurtle(executeResult, myAngle);
			System.out.println("X is "+currentTurtle.getX()+" Y is "+currentTurtle.getY());
		}
		myTurtleManager.doToActiveTurtles(e -> updateView(e));
		return executeResult;
	}
	
	public void updateView(ModelTurtle t){
		if(!t.isDrawing()){
			myView.moveShape(t.getX(), t.getY(), t.getID());
		} else {
			myView.drawShape(t.getX(), t.getY(),
					t.getID(), myColors.get(t.getPen().getColorIndex()),
					t.getPen().getThickness(), t.getPen().getPenStroke());
		}
	}
	
}
{'fraction_non_alphanumeric': 0.12973378327709037, 'fraction_numerical': 0.0007499062617172854, 'mean_word_length': 5.475728155339806, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1179170', 'n_tokens_mistral': 977, 'n_tokens_neox': 843, 'n_words': 170}