| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using SOTF_Struct.Data;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.Json.Serialization;
- using System.Text.Json;
- namespace SOTF_Savegame_Editor.SOTFSave {
- public class SaveData {
- public class DataObject {
- public string HeldOnlyItems { get; set; }
- public string VillagesAndCaves { get; set; }
- public string VailWorldSim { get; set; }
- public string NpcItemInstances { get; set; }
- }
- public string Version { get; set; }
- public DataObject Data { get; set; }
- protected SaveData_HeldOnlyItems? _data1 = null;
- protected SaveData_VillagesAndCaves? _data2 = null;
- protected SaveData_VailWorldSim? _data3 = null;
- protected SaveData_NpcItemInstances? _data4 = null;
- public SaveData_HeldOnlyItems? HeldOnlyItems {
- get {
- if (this._data1 == null) {
- JsonSerializerOptions options = new() {
- NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.AllowNamedFloatingPointLiterals,
- AllowTrailingCommas = true,
- IgnoreReadOnlyFields = true,
- IgnoreReadOnlyProperties = true,
- UnknownTypeHandling = JsonUnknownTypeHandling.JsonNode
- };
- this._data1 = System.Text.Json.JsonSerializer.Deserialize<SaveData_HeldOnlyItems>(this.Data.HeldOnlyItems.Replace("\"NaN\"", "0"), options);
- }
- return this._data1;
- }
- }
- public SaveData_VillagesAndCaves? VillagesAndCaves {
- get {
- if (this._data2 == null) {
- JsonSerializerOptions options = new() {
- NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.AllowNamedFloatingPointLiterals,
- AllowTrailingCommas = true,
- IgnoreReadOnlyFields = true,
- IgnoreReadOnlyProperties = true,
- UnknownTypeHandling = JsonUnknownTypeHandling.JsonNode
- };
- this._data2 = System.Text.Json.JsonSerializer.Deserialize<SaveData_VillagesAndCaves>(this.Data.VillagesAndCaves.Replace("\"NaN\"", "0"), options);
- }
- return this._data2;
- }
- }
- public SaveData_VailWorldSim? VailWorldSim {
- get {
- if (this._data3 == null) {
- JsonSerializerOptions options = new() {
- NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.AllowNamedFloatingPointLiterals,
- AllowTrailingCommas = true,
- IgnoreReadOnlyFields = true,
- IgnoreReadOnlyProperties = true,
- UnknownTypeHandling = JsonUnknownTypeHandling.JsonNode
- };
- this._data3 = System.Text.Json.JsonSerializer.Deserialize<SaveData_VailWorldSim>(this.Data.VailWorldSim.Replace("\"NaN\"", "0"), options);
- }
- return this._data3;
- }
- }
- public SaveData_NpcItemInstances? NpcItemInstances {
- get {
- if (this._data4 == null) {
- JsonSerializerOptions options = new() {
- NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.AllowNamedFloatingPointLiterals,
- AllowTrailingCommas = true,
- IgnoreReadOnlyFields = true,
- IgnoreReadOnlyProperties = true,
- UnknownTypeHandling = JsonUnknownTypeHandling.JsonNode
- };
- this._data4 = System.Text.Json.JsonSerializer.Deserialize<SaveData_NpcItemInstances>(this.Data.NpcItemInstances.Replace("\"NaN\"", "0"), options);
- }
- return this._data4;
- }
- }
- }
- }
|