This commit is contained in:
CortexCore
2023-08-11 23:57:37 +08:00
parent 936a94c84b
commit 75889ec34f
149 changed files with 6524 additions and 1043 deletions

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
namespace BITKit
{
/// <summary>
/// 持久化数据服务
/// </summary>
public interface IPersistentDataService
{
public void Register(IPersistentCallback callback);
public void Unregister(IPersistentCallback callback);
public void ManualSave();
public void ManualLoad();
public void ManualLoad(string json);
}
public interface IPersistentCallback
{
string Name { get; }
void Load(string json);
string Save();
}
public class PersistentDataService : IPersistentDataService
{
private readonly List<IPersistentCallback> callbacks = new();
public void Register(IPersistentCallback callback) => callbacks.Add(callback);
public void Unregister(IPersistentCallback callback) => callbacks.Remove(callback);
public void ManualSave()
{
throw new NotImplementedException();
}
public void ManualLoad()
{
throw new NotImplementedException();
}
public void ManualLoad(string json)
{
throw new NotImplementedException();
}
}
}