<commit_before>﻿using UnityEngine;
using System.Collections;

public class MetallKeferController : MonoBehaviour {

	private GameController gameController;
	private GameObject[] baseBuildable;
	private GameObject nextWaypiont;
    private float health;
	private int currentWaypointIndex = 0;
	private int movementSpeed = 2;

	void Start () {
        this.health = 100;
		this.gameController = GameObject.FindObjectOfType<GameController>();
		this.nextWaypiont = this.gameController.getWaypoints () [this.currentWaypointIndex];
		this.setInitialPosition ();
	}
	
	void Update() {
		this.moveToNextWaypoint ();
	}

	void SetNextWaypoint() {
		if (this.currentWaypointIndex < this.gameController.getWaypoints ().Length - 1) {
			this.currentWaypointIndex += 1;
			this.nextWaypiont = this.gameController.getWaypoints () [this.currentWaypointIndex];
			this.nextWaypiont.GetComponent<Renderer> ().material.color = this.getRandomColor();
		}
	}

	private Color getRandomColor() {
		Color newColor = new Color( Random.value, Random.value, Random.value, 1.0f );
		return newColor;
	}

	private void setInitialPosition() {
		this.transform.position = this.nextWaypiont.transform.position;
	}

	private void moveToNextWaypoint() {
		float step = movementSpeed * Time.deltaTime;
		this.transform.LookAt (this.nextWaypiont.transform);
		this.transform.position = Vector3.MoveTowards(transform.position, this.nextWaypiont.transform.position, step);
		if (this.transform.position.Equals( this.nextWaypiont.transform.position )) {
			this.SetNextWaypoint ();
		}
	}

    public void TakeDamage(float damage) {
        health -= damage;
    }
}
<commit_msg>Add smooth rotation for MetallKefer<commit_after>﻿using UnityEngine;
using System.Collections;

public class MetallKeferController : MonoBehaviour {

	private GameController gameController;
	private GameObject[] baseBuildable;
	private GameObject nextWaypiont;
    private float health;
	private int currentWaypointIndex = 0;
	private int movementSpeed = 2;

	void Start () {
        this.health = 100;
		this.gameController = GameObject.FindObjectOfType<GameController>();
		this.nextWaypiont = this.gameController.getWaypoints () [this.currentWaypointIndex];
		this.setInitialPosition ();
	}
	
	void Update() {
		this.moveToNextWaypoint ();
	}

	void SetNextWaypoint() {
		if (this.currentWaypointIndex < this.gameController.getWaypoints ().Length - 1) {
			this.currentWaypointIndex += 1;
			this.nextWaypiont = this.gameController.getWaypoints () [this.currentWaypointIndex];
			this.nextWaypiont.GetComponent<Renderer> ().material.color = this.getRandomColor();
		}
	}

	private Color getRandomColor() {
		Color newColor = new Color( Random.value, Random.value, Random.value, 1.0f );
		return newColor;
	}

	private void setInitialPosition() {
		this.transform.position = this.nextWaypiont.transform.position;
	}

	private void moveToNextWaypoint() {
		float step = movementSpeed * Time.deltaTime;

		var targetRotation = Quaternion.LookRotation(this.nextWaypiont.transform.position - transform.position);
		transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, 5 * Time.deltaTime);

		//this.transform.LookAt (this.nextWaypiont.transform);
		this.transform.position = Vector3.MoveTowards(transform.position, this.nextWaypiont.transform.position, step);

		if (this.transform.position.Equals( this.nextWaypiont.transform.position )) {
			this.SetNextWaypoint ();
		}
	}

    public void TakeDamage(float damage) {
        health -= damage;
    }
}

{'fraction_non_alphanumeric': 0.10782361308677098, 'fraction_numerical': 0.005974395448079659, 'mean_word_length': 4.680129240710824, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '4318027', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1064, 'n_words': 207}