using SOTF_Struct.Data; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SOTF_Savegame_Editor.SOTFSave { public class GameStateSaveData { public class DataObject { public string GameState { get; set; } } public string Version { get; set; } public DataObject Data { get; set; } protected GameState? _data = null; public GameState? GameState { get { if (this._data == null) { System.Text.Json.JsonSerializerOptions options = new() { NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.AllowNamedFloatingPointLiterals, AllowTrailingCommas = true, IgnoreReadOnlyFields = true, IgnoreReadOnlyProperties = true }; this._data = System.Text.Json.JsonSerializer.Deserialize(this.Data.GameState.Replace("\"NaN\"", "0"), options); } return this._data; } } } }