using UnityEngine;

namespace mgaia.Utils.Persistence
{
	/// <summary>
	/// Interface para o arquivo de persistência padrão da Unity
	/// </summary>
	/// <owner>Victor</owner>
	public class DefaultUnityPersistenceFileInterface : IPersistenceFileInterface
	{
		public bool HasKey(string key)
		{
			return PlayerPrefs.HasKey(key);
		}

		public float GetFloat(string key, float defaultValue)
		{
			return PlayerPrefs.GetFloat(key, defaultValue);
		}

		public int GetInt32(string key, int defaultValue)
		{
			return PlayerPrefs.GetInt(key, defaultValue);
		}

		public string GetString(string key, string defaultValue)
		{
			return PlayerPrefs.GetString(key, defaultValue);
		}

		public void SetFloat(string key, float value)
		{
			PlayerPrefs.SetFloat(key, value);
		}

		public void SetInt32(string key, int value)
		{
			PlayerPrefs.SetInt(key, value);
		}

		public void SetString(string key, string value)
		{
			PlayerPrefs.SetString(key, value);
		}

		public void DeleteAll()
		{
			PlayerPrefs.DeleteAll();
		}

		public void DeleteKey(string key)
		{
			PlayerPrefs.DeleteKey(key);
		}

		public void Save()
		{
			PlayerPrefs.Save();
		}
	}
}