using CodeStage.AntiCheat.ObscuredTypes;
using UnityEngine;

namespace Cute;

public class SavedataManager : MonoBehaviour, IManager
{
	public const string RESOURCE_VERSION_KEY = "RES_VER";

	public const string LANGUAGE_FIRST_SET = "LANG_FIRST_SET";

	public const string LANGUAGE_KEY = "LANG_SETTING";

	public const string LANGUAGE_SOUND_KEY = "LANG_SOUND_SETTING";

	public const string LANGUAGE_FONT_KEY = "LANG_FONT";

	public static string OMOTENASHI_COUNTRY_KEY = "OMOTE_COUNTRY";

	public static string LANGUAGE_CHANGE = "LANG_CHANGE";

	private void Start()
	{
		Toolbox.SavedataManager = this;
	}

	private void OnDestroy()
	{
	}

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

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

	public float GetFloat(string key, float defaultValue = 0f)
	{
		return ObscuredPrefs.GetFloat(key, defaultValue);
	}

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

	public int GetInt(string key, int defaultValue = 0)
	{
		return ObscuredPrefs.GetInt(key, defaultValue);
	}

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

	public string GetString(string key, string defaultValue = "")
	{
		return ObscuredPrefs.GetString(key, defaultValue);
	}

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

	public bool HasKey(string key)
	{
		return ObscuredPrefs.HasKey(key);
	}

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

	public void SetResourceVersion(string version)
	{
		SetString("RES_VER", version);
	}

	public string GetResourceVersion()
	{
		return GetString("RES_VER", "00000000");
	}
}
