refactor(save-system): 移除旧存档基础设施 DeepRepair、IData 与 LoadIndex
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
using System.Collections;
|
||||
using AibisDream.Framework;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace AibisDream.SaveSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// 深度维修子系统的旧 IData 注册表(基于 <see cref="DataContainer"/>)。
|
||||
/// <para>
|
||||
/// FixSystem / Eye / Chip 等仍通过此处 RegisterData;尚未纳入新 <see cref="SaveSnapshot.deepRepair"/>。
|
||||
/// P5 评估后迁移或废弃;与 <see cref="YarnVariableStorage"/>、快照 I/O 分离。
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static class DeepRepairDataRegistry
|
||||
{
|
||||
private static readonly DataContainer Container = new();
|
||||
|
||||
public static void RegisterData<T>(T data) where T : IData
|
||||
{
|
||||
Container.Register(data);
|
||||
}
|
||||
|
||||
public static void UnregisterData<T>() where T : class, IData
|
||||
{
|
||||
Container.Unregister<T>();
|
||||
}
|
||||
|
||||
/// <summary>旧格式存档 systemData 段还原;按 LoadIndex 顺序执行各 IData.Load()。</summary>
|
||||
public static IEnumerator LoadByJson(JObject dataJson)
|
||||
{
|
||||
if (dataJson == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
yield return Container.LoadByJson(dataJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba4cbc590c8177045b16b8a02db31121
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace AibisDream.SaveSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// 深度维修是否纳入新快照、以何种粒度纳入(P5 逐个定案)。
|
||||
/// </summary>
|
||||
public enum DeepRepairSavePolicy
|
||||
{
|
||||
/// <summary>完整阶段终点状态写入 deepRepair.sections。</summary>
|
||||
Supported,
|
||||
|
||||
/// <summary>只存简化后的关键字段。</summary>
|
||||
Simplified,
|
||||
|
||||
/// <summary>不存;读档回到进入该维修前的可存点。</summary>
|
||||
Dropped
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="SaveSnapshot.deepRepair"/> 占位段。
|
||||
/// P1 捕获时不写入;读档时缺省或 sections 为空则不报错。
|
||||
/// 正式实现后替代/收敛 <see cref="DeepRepairDataRegistry"/> 的旧 IData 路径。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class DeepRepairSnapshot
|
||||
{
|
||||
public DeepRepairSavePolicy policy = DeepRepairSavePolicy.Dropped;
|
||||
|
||||
/// <summary>按维修模块 id 分子段,具体 key 在 P5 定义。</summary>
|
||||
public Dictionary<string, JObject> sections = new();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ee71c8af7b93d64aa87335a011eccf5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user