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

public class GameSetup : MonoBehaviour {

	public static List<GameObject> happyFriends = new List<GameObject>();
	public static List<GameObject> angryFriends = new List<GameObject>();

	public int lifesLost = 0;

	private Camera mainCam;


	void Start () {

		GameObject.FindGameObjectWithTag (PlayerControl.PLAYER_TAG).GetComponent<Health>().OnDeath += PlayerDeathHandler;

		FriendScript[] friends = GameObject.FindObjectsOfType<FriendScript> ();
		for(int i = 0; i < friends.Length; i++){
			friends[i].ChangeState += onFriendStateChange;
			onFriendStateChange(friends[i].gameObject, friends[i].state);
		}

	}

	void PlayerDeathHandler(){
		lifesLost ++;
		Debug.Log ("Lifes lost: " + lifesLost);
	}

	void onFriendStateChange(GameObject friend, FriendState state){
		if (state == FriendState.happy) {
			if(happyFriends.IndexOf(friend) == -1)
				happyFriends.Add(friend);
			angryFriends.Remove(friend);
		} else if (state == FriendState.angry || state == FriendState.veryAngry) {
			if(angryFriends.IndexOf(friend) == -1)
				angryFriends.Add(friend);
			happyFriends.Remove(friend);
		}
		Debug.Log ("happy friends: " + happyFriends.Count + " angry friends: " + angryFriends.Count);
	}

}<commit_msg>add gui labels for counts<commit_after>﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class GameSetup : MonoBehaviour {

	public static List<GameObject> happyFriends = new List<GameObject>();
	public static List<GameObject> angryFriends = new List<GameObject>();

	public int lifesLost = 0;

	private Camera mainCam;


	void Start () {

		GameObject.FindGameObjectWithTag (PlayerControl.PLAYER_TAG).GetComponent<Health>().OnDeath += PlayerDeathHandler;

		FriendScript[] friends = GameObject.FindObjectsOfType<FriendScript> ();
		for(int i = 0; i < friends.Length; i++){
			friends[i].ChangeState += onFriendStateChange;
			onFriendStateChange(friends[i].gameObject, friends[i].state);
		}

	}

	void OnGUI(){
		GUI.Label (new Rect (10, 10, 200, 50), "Happy friends: " + happyFriends.Count);
		GUI.Label (new Rect (10, 22, 200, 50), "Lifes lost: " + lifesLost);
	}

	void PlayerDeathHandler(){
		lifesLost ++;
		Debug.Log ("Lifes lost: " + lifesLost);
	}

	void onFriendStateChange(GameObject friend, FriendState state){
		if (state == FriendState.happy) {
			if(happyFriends.IndexOf(friend) == -1)
				happyFriends.Add(friend);
			angryFriends.Remove(friend);
		} else if (state == FriendState.angry || state == FriendState.veryAngry) {
			if(angryFriends.IndexOf(friend) == -1)
				angryFriends.Add(friend);
			happyFriends.Remove(friend);
		}
		Debug.Log ("happy friends: " + happyFriends.Count + " angry friends: " + angryFriends.Count);
	}

}
{'fraction_non_alphanumeric': 0.13426423200859292, 'fraction_numerical': 0.009308986752595776, 'mean_word_length': 4.94468085106383, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '6582904', 'n_tokens_mistral': 1013, 'n_tokens_neox': 879, 'n_words': 192}