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

public class GameController : MonoBehaviour {

	public GameObject towerBaseWrap;
	public GameObject originalTowerBase;
	public GameObject gameField;
	private GameObject[,] towerBases;
	private int gameFieldWidth = 0;
	private int gameFieldHeight = 0;
	private Color wayColor;

	void Start () {
		this.wayColor = Color.Lerp(Color.red, Color.green, 0F);
		this.gameFieldWidth = (int)(gameField.transform.localScale.x);
		this.gameFieldHeight = (int)(gameField.transform.localScale.z);
		this.towerBases = new GameObject[this.gameFieldWidth, this.gameFieldHeight];
		this.initGamePlatform ();
		this.drawWaypoint ();
	}

	void initGamePlatform() {
		for (int x = 0; x < this.gameFieldWidth; x++) {
			for (int z = 0; z < this.gameFieldHeight; z++) {
				GameObject newTowerBase = Instantiate (originalTowerBase);
				newTowerBase.GetComponent<TowerBaseController>().setBuildable(true); 
				newTowerBase.transform.position = new Vector3 (originalTowerBase.transform.position.x + x, 0.1f, originalTowerBase.transform.position.z - z);
				this.towerBases [x, z] = newTowerBase;
				newTowerBase.transform.SetParent (towerBaseWrap.transform);
			}
		}

		Destroy (originalTowerBase);
			
	}

	void drawWaypoint() {
		for (int x = 0; x < this.gameFieldWidth; x++) {
			GameObject baseZ = this.towerBases [x, 5];
			baseZ.GetComponent<Renderer> ().material.color = wayColor;
			baseZ.GetComponent<TowerBaseController>().setBuildable(false);
		}
	}
}<commit_msg>Save waypoints in array, provide get method<commit_after>﻿using UnityEngine;
using System.Collections;

public class GameController : MonoBehaviour {

	public GameObject towerBaseWrap;
	public GameObject originalTowerBase;
	public GameObject gameField;

	private GameObject[,] towerBases;
	private GameObject[] waypoints;

	private int gameFieldWidth = 0;
	private int gameFieldHeight = 0;
	private Color wayColor;

	void Start () {
		this.wayColor = Color.Lerp(Color.red, Color.green, 0F);
		this.gameFieldWidth = (int)(gameField.transform.localScale.x);
		this.gameFieldHeight = (int)(gameField.transform.localScale.z);
		this.towerBases = new GameObject[this.gameFieldWidth, this.gameFieldHeight];
		this.waypoints = new GameObject[this.gameFieldWidth];

		this.initGamePlatform ();
		this.drawWaypoint ();
	}

	void initGamePlatform() {
		for (int x = 0; x < this.gameFieldWidth; x++) {
			for (int z = 0; z < this.gameFieldHeight; z++) {
				GameObject newTowerBase = Instantiate (originalTowerBase);
				newTowerBase.GetComponent<TowerBaseController>().setBuildable(true); 
				newTowerBase.transform.position = new Vector3 (originalTowerBase.transform.position.x + x, 0.1f, originalTowerBase.transform.position.z - z);
				this.towerBases [x, z] = newTowerBase;
				newTowerBase.transform.SetParent (towerBaseWrap.transform);
			}
		}

		Destroy (originalTowerBase);
			
	}

	void drawWaypoint() {
		for (int x = 0; x < this.gameFieldWidth; x++) {
			GameObject baseZ = this.towerBases [x, 5];
			baseZ.GetComponent<Renderer> ().material.color = wayColor;
			baseZ.GetComponent<TowerBaseController>().setBuildable(false);
			this.waypoints[x] = baseZ;
		}
	}

	public GameObject[] getWaypoints() {
		return this.waypoints;
	}
}
{'fraction_non_alphanumeric': 0.11911357340720222, 'fraction_numerical': 0.006155740227762389, 'mean_word_length': 4.742049469964664, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, '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': '499163', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1054, 'n_words': 223}