<commit_before>﻿/**
* Copyright 2015 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using IBM.Watson.DeveloperCloud.Logging;
using UnityEngine;


namespace IBM.Watson.DeveloperCloud.Utilities
{
	/// <summary>
	/// General application related event handlers and some configurations
	/// </summary>
	public class AppController : MonoBehaviour {

		#region Private Members
		private static AppController mp_instance = null;
		private bool m_isAnimationPaused = false;

		//Client Related variables
		private string m_ClientName;
		private Texture m_ClientLogoTexture;
		#endregion

		#region Public Members

		public static AppController instance
		{
			get{
				if (mp_instance == null) {
					Log.Error ("AppController", "There is no instance for AppController so creating one.");
					GameObject gameObject = new GameObject ();
					gameObject.name = "_AppController";
					mp_instance = gameObject.AddComponent<AppController> ();
				}
				
				return mp_instance;
			}
		}

		/// <summary>
		/// Gets the name of the client.
		/// </summary>
		/// <value>The name of the client.</value>
		public string ClientName{
			get{
				if (Config.Instance.ConfigLoaded) {
					if(string.IsNullOrEmpty(m_ClientName))
						m_ClientName = Config.Instance.GetVariableValue (Constants.String.KEY_CONFIG_CLIENT_NAME);
					
					return m_ClientName;
				}
				else
					return null;
			}
		}

		/// <summary>
		/// Gets a value indicating is custom client.
		/// </summary>
		/// <value><c>true</c> if is custom client; otherwise, <c>false</c>.</value>
		public static bool IsCustomClient{
			get{
				return !string.IsNullOrEmpty (instance.ClientName);
			}
		}

		/// <summary>
		/// Gets the client logo texture.<commit_msg>* Client name can be accessible on AppController<commit_after>﻿/**
* Copyright 2015 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using IBM.Watson.DeveloperCloud.Logging;
using UnityEngine;


namespace IBM.Watson.DeveloperCloud.Utilities
{
	/// <summary>
	/// General application related event handlers and some configurations
	/// </summary>
	public class AppController : MonoBehaviour {

		#region Private Members
		private static AppController mp_instance = null;
		private bool m_isAnimationPaused = false;

		//Client Related variables
		private string m_ClientName;
		private Texture m_ClientLogoTexture;
		#endregion

		#region Public Members

		public static AppController instance
		{
			get{
				if (mp_instance == null) {
					Log.Error ("AppController", "There is no instance for AppController so creating one.");
					GameObject gameObject = new GameObject ();
					gameObject.name = "_AppController";
					mp_instance = gameObject.AddComponent<AppController> ();
				}
				
				return mp_instance;
			}
		}

		/// <summary>
		/// Gets the name of the client.
		/// </summary>
		/// <value>The name of the client.</value>
		public string ClientName{
			get{
				if (Config.Instance.ConfigLoaded) {
					if(string.IsNullOrEmpty(m_ClientName))
						m_ClientName = Config.Instance.GetVariableValue (Constants.String.KEY_CONFIG_CLIENT_NAME);
					
					return m_ClientName;
				}
				else
					return null;
			}
            set{
                m_ClientName = value;
            }
		}

		/// <summary>
		/// Gets a value indicating is custom client.
		/// </summary>
		/// <value><c>true</c> if is custom client; otherwise, <c>false</c>.</value>
		public static bool IsCustomClient{
			get{
				return !string.IsNullOrEmpty (instance.ClientName);
			}
		}

		/// <summary>
		/// Gets the client logo texture.
{'fraction_non_alphanumeric': 0.09917534722222222, 'fraction_numerical': 0.003472222222222222, 'mean_word_length': 3.1938125568698816, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503128', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1273, 'n_words': 445}