1
0
mirror of synced 2024-11-28 09:20:53 +01:00
OpenTaiko/TJAPlayer3/Common/CSavableT.cs

44 lines
793 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace TJAPlayer3
{
class CSavableT<T> where T : new()
{
public virtual string _fn
{
get;
protected set;
}
public void tDBInitSavable()
{
if (!File.Exists(_fn))
tSaveFile();
tLoadFile();
}
public T data = new T();
#region [private]
private void tSaveFile()
{
ConfigManager.SaveConfig(data, _fn);
}
private void tLoadFile()
{
data = ConfigManager.GetConfig<T>(_fn);
}
#endregion
}
}