This commit is contained in:
2025-12-14 13:54:48 +08:00
parent 23cfbfd017
commit 2b4cdee214
3 changed files with 443 additions and 11 deletions

View File

@@ -79,6 +79,23 @@ namespace WulaFallenEmpire.EventSystem.AI
}
}
public void ClearHistory(string eventDefName)
{
_cache.Remove(eventDefName);
string path = GetFilePath(eventDefName);
try
{
if (File.Exists(path))
{
File.Delete(path);
}
}
catch (Exception ex)
{
Log.Error($"[WulaFallenEmpire] Failed to clear AI history at {path}: {ex}");
}
}
public override void ExposeData()
{
base.ExposeData();
@@ -229,4 +246,4 @@ namespace WulaFallenEmpire.EventSystem.AI
return s.Replace("\\r", "\r").Replace("\\n", "\n").Replace("\\\"", "\"").Replace("\\\\", "\\");
}
}
}
}