feat: 优化存档管理,增强链状态获取逻辑,添加 ISaveable 接口支持

This commit is contained in:
2026-05-20 16:37:32 +08:00
parent acb36d750f
commit 04aec4cc8e
4 changed files with 51 additions and 35 deletions

View File

@@ -195,7 +195,12 @@ namespace BaseGames.Core.Save
public void SetChainCompleted(string chainId)
{ _current ??= new SaveData(); _current.EventChains.ChainStates[chainId] = "Completed"; }
public IEnumerable<string> GetCompletedChains()
=> _current?.EventChains.ChainStates.Keys ?? Enumerable.Empty<string>();
{
if (_current?.EventChains?.ChainStates == null) return System.Linq.Enumerable.Empty<string>();
return _current.EventChains.ChainStates
.Where(kv => kv.Value == "Completed")
.Select(kv => kv.Key);
}
public bool IsFirstClear(string challengeId)
{