<commit_before>package model;

import gui.init.canvas.IReset;
import gui.turtle.IChangeImage;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

public class Turtle implements IChangeImage, IReset {
	
	public IntegerProperty move = new SimpleIntegerProperty();
	public DoubleProperty initX = new SimpleDoubleProperty();
	public DoubleProperty initY = new SimpleDoubleProperty();
	private ImageView image;
	private Image defaultImage = new Image(getClass().getClassLoader().getResourceAsStream("turtle.png"));
	private double x, y;
	private double direction;
	private int isPenDown, isVisible;
	
	public Turtle() {
		this.image = new ImageView(defaultImage);
		this.image.setFitHeight(50);
		this.image.setPreserveRatio(true);
		this.x = initX.get();
		this.y = initY.get();
		this.move.set(0);
		image.setX(x + initX.get() - image.getBoundsInLocal().getWidth()/2);
		image.setY(y + initY.get() - image.getBoundsInLocal().getHeight()/2);
		direction = 0;
		isPenDown = 1;
		isVisible = 1;
	}
	
	public Turtle(double x, double y) {
		this();
		setX(x);
		setY(y);
	}
	
	public Turtle(double x, double y, Image img) {
		this(x, y);
		setImage(img);
	}

	// getter methods:
	public ImageView getImage() {
		return image;
	}
	
	public double getX() {
		return x;
	}
	
	public double getY() {
		return y;
	}
	
	public double getDirection() {
		return direction;
	}
	
	public int getIsPenDown() {
		return isPenDown;
	}
	
	public int getIsVisible() {
		return isVisible;
	}
	
	// setter methods:
	@Override
	public void setImage(Image img) {
		this.image.setImage(img);
	}
	
	public void setImage(ImageView image) {
		this.image = image;
	}

	public void setImage(String s) {
		ImageView image = new ImageView(new Image(getClass().getClassLoader().getResourceAsStream("turtle.png")));
		this.image = image;
	}
	
	public void setX(double x) {
		this.x = x;
		image.setX(x + initX.get() - image.getBoundsInLocal().getWidth()/2);
	}
	
	public void setY(double y) {
		this.y = y;
		image.setY(y + initY.get() - image.getBoundsInLocal().getHeight()/2);
	}
	
	public void rotate(double angle) {
		image.setRotate(image.getRotate() + angle);
		direction = image.getRotate();
	}
	
	public void setPenDown() {
		isPenDown = 1;
	}
	
	public void setPenUp() {
		isPenDown = 0;
	}
	
	public void setVisible() {
		image.setVisible(true);
		isVisible = 1;
	}
	
	public void setInvisible() {
		image.setVisible(false);
		isVisible = 0;
	}

	@Override
	public void reset() {
		int save = isPenDown;
		setPenUp();
		setX(0);
		setY(0);
		rotate(- this.getDirection());
		if (save == 1) setPenDown();
	}
}
<commit_msg>Add id and isActive instances and related method to Turtle<commit_after>package model;

import gui.init.canvas.IReset;
import gui.turtle.IChangeImage;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

public class Turtle implements IChangeImage, IReset {
	
	public IntegerProperty move = new SimpleIntegerProperty();
	public DoubleProperty initX = new SimpleDoubleProperty();
	public DoubleProperty initY = new SimpleDoubleProperty();
	private ImageView image;
	private Image defaultImage = new Image(getClass().getClassLoader().getResourceAsStream("turtle.png"));
	private double x, y;
	private double direction;
	private int isPenDown, isVisible;
	private int id;
	private boolean isActive;
	
	public Turtle() {
		this.image = new ImageView(defaultImage);
		this.image.setFitHeight(50);
		this.image.setPreserveRatio(true);
		this.x = initX.get();
		this.y = initY.get();
		this.move.set(0);
		image.setX(x + initX.get() - image.getBoundsInLocal().getWidth()/2);
		image.setY(y + initY.get() - image.getBoundsInLocal().getHeight()/2);
		direction = 0;
		isPenDown = 1;
		isVisible = 1;
	}
	
	public Turtle(double x, double y) {
		this();
		setX(x);
		setY(y);
	}
	
	public Turtle(double x, double y, Image img) {
		this(x, y);
		setImage(img);
	}

	// getter methods:
	public ImageView getImage() {
		return image;
	}
	
	public double getX() {
		return x;
	}
	
	public double getY() {
		return y;
	}
	
	public double getDirection() {
		return direction;
	}
	
	public int getIsPenDown() {
		return isPenDown;
	}
	
	public int getIsVisible() {
		return isVisible;
	}
	
	public int getID() {
		return id;
	}
	
	public boolean getIsActive() {
		return isActive;
	}
	
	// setter methods:
	@Override
	public void setImage(Image img) {
		this.image.setImage(img);
	}
	
	public void setImage(ImageView image) {
		this.image = image;
	}

	public void setImage(String s) {
		ImageView image = new ImageView(new Image(getClass().getClassLoader().getResourceAsStream("turtle.png")));
		this.image = image;
	}
	
	public void setX(double x) {
		this.x = x;
		image.setX(x + initX.get() - image.getBoundsInLocal().getWidth()/2);
	}
	
	public void setY(double y) {
		this.y = y;
		image.setY(y + initY.get() - image.getBoundsInLocal().getHeight()/2);
	}
	
	public void rotate(double angle) {
		image.setRotate(image.getRotate() + angle);
		direction = image.getRotate();
	}
	
	public void setPenDown() {
		isPenDown = 1;
	}
	
	public void setPenUp() {
		isPenDown = 0;
	}
	
	public void setVisible() {
		image.setVisible(true);
		isVisible = 1;
	}
	
	public void setInvisible() {
		image.setVisible(false);
		isVisible = 0;
	}
	
	public void setID(int id) {
		this.id = id;
	}
	
	public void setIsActive(boolean isActive) {
		this.isActive = isActive;
	}

	@Override
	public void reset() {
		int save = isPenDown;
		setPenUp();
		setX(0);
		setY(0);
		rotate(- this.getDirection());
		if (save == 1) setPenDown();
	}
}

{'fraction_non_alphanumeric': 0.13058883077442213, 'fraction_numerical': 0.005736460266576683, 'mean_word_length': 3.9731543624161074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3586697', 'n_tokens_mistral': 2250, 'n_tokens_neox': 2038, 'n_words': 479}