639b0b7f59
Add native IK-style capture processing, Artifact Inventory, explicit promotion and single-result review. Confirm the three live OCR corrections in the eval corpus and preserve extraction/value separation.
25 lines
682 B
C#
25 lines
682 B
C#
using System.Text.Json;
|
|
|
|
namespace GenshinAssistant.InputHelper;
|
|
|
|
internal static class NativeScannerFiles
|
|
{
|
|
private static readonly JsonSerializerOptions PrettyJson = new(JsonSerializerDefaults.Web)
|
|
{
|
|
WriteIndented = true,
|
|
};
|
|
|
|
private static readonly JsonSerializerOptions LineJson = new(JsonSerializerDefaults.Web);
|
|
|
|
public static void WriteJson(string path, object payload)
|
|
{
|
|
File.WriteAllText(path, JsonSerializer.Serialize(payload, PrettyJson));
|
|
}
|
|
|
|
public static void AppendJsonLine(StreamWriter writer, object payload)
|
|
{
|
|
writer.WriteLine(JsonSerializer.Serialize(payload, LineJson));
|
|
writer.Flush();
|
|
}
|
|
}
|