<commit_before>﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using UnityEngine.SceneManagement;

public class GameController : MonoBehaviour
{
	public static GameController I;

	public PlayerView Player;
	public float RoundTime{get;private set;}

	public Transform PlayerStartPosition;

	public bool PlayerDead{get;private set;}

	private int state = 0;

	void Awake() 
	{
		I = this;
        RoundTime = 10.0f;
		PlayerDead = false;

		Player.OnDeathEvent += OnPlayerDeath;
	}

	private void OnPlayerDeath ()
	{
		PlayerDead = true;
		RemoveExcessStuff ();
	}
		
	void Start()
	{
		StartCoroutine (StateCoroutine ());
	}

	void Update()
	{
		if (Input.GetKeyDown (KeyCode.R))
			SceneManager.LoadScene (SceneManager.GetActiveScene ().name);
	}

    public void StartRound()
    {
        state = 1;
    }

	IEnumerator StateCoroutine()
	{
		while (true) 
		{
			Player.SetInputEnabled (false);
			if (PlayerStartPosition) Player.transform.position = PlayerStartPosition.position;

			//setup state
			if (state == 0) 
			{
				//randomize three starting skills
				List<SkillID> skills = new List<SkillID>();
			
				for (int i = 0; i < 3; i++) 
				{
					SkillID skill;

					do {
						skill = SkillzDatabase.I.GetRandomSkillID();
					} while (skills.Contains(skill));

					skills.Add (skill);
				}
			
				Player.SkillSystem.ReplaceSkill(0, skills[0]);
				Player.SkillSystem.ReplaceSkill(1, skills[1]);
				Player.SkillSystem.ReplaceSkill(2, skills[2]);

				GUIController.I.ShowSlotMachinePanel ();
				while (GUIController.I.SlotMachineVisible) yield return null;

				//wait until game starts , countdown<commit_msg>Quick fix<commit_after>﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using UnityEngine.SceneManagement;

public class GameController : MonoBehaviour
{
	public static GameController I;

	public PlayerView Player;
	public float RoundTime{get;private set;}

	public Transform PlayerStartPosition;

	public bool PlayerDead{get;private set;}

	private int state = 0;

	void Awake() 
	{
		I = this;
        RoundTime = 10.0f;
		PlayerDead = false;

		Player.OnDeathEvent += OnPlayerDeath;
	}

	private void OnPlayerDeath ()
	{
		PlayerDead = true;
		RemoveExcessStuff ();
	}
		
	void Start()
	{
		StartCoroutine (StateCoroutine ());
	}

	void Update()
	{
		if (Input.GetKeyDown (KeyCode.R))
			SceneManager.LoadScene (SceneManager.GetActiveScene ().name);
	}

    public void StartRound()
    {
        state = 1;
    }

	IEnumerator StateCoroutine()
	{
		while (true) 
		{
			Player.SetInputEnabled (false);
			if (PlayerStartPosition) Player.transform.position = PlayerStartPosition.position;

			//setup state
			if (state == 0) 
			{
				//randomize three starting skills
				List<SkillID> skills = new List<SkillID>();
			
				for (int i = 0; i < 3; i++) 
				{
					SkillID skill;

					do {
						skill = SkillzDatabase.I.GetRandomSkillID();
					} while (skills.Contains(skill));

					skills.Add (skill);
				}
			
				Player.SkillSystem.ReplaceSkill(0, skills[0]);
				Player.SkillSystem.ReplaceSkill(1, skills[1]);
				Player.SkillSystem.ReplaceSkill(2, skills[2]);

				//GUIController.I.ShowSlotMachinePanel ();
				while (GUIController.I.SlotMachineVisible) yield return null;

				//wait until game starts , countdown
{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.008318478906714201, 'mean_word_length': 3.3841145833333335, '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': '5385517', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1082, 'n_words': 250}