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

[RequireComponent(typeof (NotificationManager))]
public class GameManager : MonoBehaviour
{

    public static GameManager Instance
    {
        get
        {
            if(m_instance == null)
            {
                m_instance = new GameObject("GameManager").AddComponent<GameManager>();
            }
            return m_instance;
        }
    }

    public static NotificationManager Notifications
    {
        get
        {
            if(m_notifications == null)
            {
                m_notifications = m_instance.GetComponent<NotificationManager>();
            }
            return m_notifications;
        }
    }


    private static GameManager m_instance = null;
    private static NotificationManager m_notifications = null;

    void Awake()
    {
        if((m_instance) && (m_instance.GetInstanceID() != GetInstanceID()))
        {
            Destroy(gameObject);
        }
        else
        {
            m_instance = this;
            DontDestroyOnLoad(gameObject);
        }
    }

    //TODO add the rest of the game manager as development progresses.
}<commit_msg>GameManger Now Knows When Player Is Dead<commit_after>﻿using UnityEngine;
using System.Collections;

[RequireComponent(typeof (NotificationManager))]
public class GameManager : MonoBehaviour, IListener
{

    public static GameManager Instance
    {
        get
        {
            if(m_instance == null)
            {
                m_instance = new GameObject("GameManager").AddComponent<GameManager>();
            }
            return m_instance;
        }
    }

    public static NotificationManager Notifications
    {
        get
        {
            if(m_notifications == null)
            {
                m_notifications = m_instance.GetComponent<NotificationManager>();
            }
            return m_notifications;
        }
    }


    private static GameManager m_instance = null;
    private static NotificationManager m_notifications = null;
    private int numberOfPlayersDead = 0;
    private bool allPlayersDead = false;

    void Awake()
    {
        if((m_instance) && (m_instance.GetInstanceID() != GetInstanceID()))
        {
            Destroy(gameObject);
        }
        else
        {
            m_instance = this;
            DontDestroyOnLoad(gameObject);
        }
        GameManager.Notifications.AddListener(this, MessageTypes.PLAYER_DEATH);
    }

    //TODO add the rest of the game manager as development progresses.

    public void CheckIfAllPlayersAreDead()
    {

    }

    public void OnReceived(Message message)
    {
        if(message.GetMessageType() == MessageTypes.PLAYER_DEATH)
        {
            numberOfPlayersDead++;
            if(numberOfPlayersDead == 1)
            {
                allPlayersDead = true;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.07948628948281847, 'fraction_numerical': 0.0006942034015966678, 'mean_word_length': 1.850642927794263, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1869826', 'n_tokens_mistral': 763, 'n_tokens_neox': 727, 'n_words': 159}