diff --git a/source/LootDumpProcessor/Model/GroupPosition.cs b/source/LootDumpProcessor/Model/GroupPosition.cs index 3bb0343..354f4f0 100644 --- a/source/LootDumpProcessor/Model/GroupPosition.cs +++ b/source/LootDumpProcessor/Model/GroupPosition.cs @@ -1,11 +1,13 @@ +using System.Text.Json.Serialization; + namespace LootDumpProcessor.Model; public class GroupPosition : ICloneable { - public string Name { get; set; } - public int Weight { get; set; } - public Vector3 Position { get; set; } - public Vector3 Rotation { get; set; } + [JsonPropertyName("Name")] public string Name { get; set; } + [JsonPropertyName("Weight")] public int Weight { get; set; } + [JsonPropertyName("Position")] public Vector3 Position { get; set; } + [JsonPropertyName("Rotation")] public Vector3 Rotation { get; set; } public object Clone() => new GroupPosition { diff --git a/source/LootDumpProcessor/Model/Template.cs b/source/LootDumpProcessor/Model/Template.cs index bcd066b..60aeec3 100644 --- a/source/LootDumpProcessor/Model/Template.cs +++ b/source/LootDumpProcessor/Model/Template.cs @@ -7,24 +7,24 @@ namespace LootDumpProcessor.Model; public class Template : IKeyable, ICloneable { - [JsonIgnore] public string internalId { get; } - public string Id { get; set; } - public bool IsContainer { get; set; } + [JsonIgnore] public string InternalId { get; } + [JsonPropertyName("Id")] public string Id { get; set; } + [JsonPropertyName("IsContainer")] public bool IsContainer { get; set; } public bool UseGravity { get; set; } public bool RandomRotation { get; set; } - public Vector3 Position { get; set; } - public Vector3 Rotation { get; set; } - public bool IsGroupPosition { get; set; } - public List GroupPositions { get; set; } - public bool IsAlwaysSpawn { get; set; } - public string Root { get; set; } - public List Items { get; set; } + [JsonPropertyName("Position")] public Vector3 Position { get; set; } + [JsonPropertyName("Rotation")] public Vector3 Rotation { get; set; } + [JsonPropertyName("IsGroupPosition")] public bool IsGroupPosition { get; set; } + [JsonPropertyName("GroupPositions")] public List GroupPositions { get; set; } + [JsonPropertyName("IsAlwaysSpawn")] public bool IsAlwaysSpawn { get; set; } + [JsonPropertyName("Root")] public string Root { get; set; } + [JsonPropertyName("Items")] public List Items { get; set; } public Template(string internalId, string id, bool isContainer, bool useGravity, bool randomRotation, Vector3 position, Vector3 rotation, bool isGroupPosition, List groupPositions, bool isAlwaysSpawn, string root, List items) { - this.internalId = internalId; + this.InternalId = internalId; Id = id; IsContainer = isContainer; UseGravity = useGravity; @@ -49,11 +49,11 @@ public class Template : IKeyable, ICloneable public override int GetHashCode() => Id != null ? Id.GetHashCode() : 0; - public IKey GetKey() => new FlatUniqueKey([internalId]); + public IKey GetKey() => new FlatUniqueKey([InternalId]); public object Clone() => new Template ( - internalId, + InternalId, Id, IsContainer, UseGravity, diff --git a/source/LootDumpProcessor/Model/Upd.cs b/source/LootDumpProcessor/Model/Upd.cs index 3bc427f..7e9b545 100644 --- a/source/LootDumpProcessor/Model/Upd.cs +++ b/source/LootDumpProcessor/Model/Upd.cs @@ -1,5 +1,10 @@ +using System.Text.Json.Serialization; + namespace LootDumpProcessor.Model; public readonly record struct Upd( - object? StackObjectsCount, FireMode FireMode, Foldable Foldable, Repairable Repairable + [property: JsonPropertyName("StackObjectsCount")] object? StackObjectsCount, + [property: JsonPropertyName("FireMode")] FireMode? FireMode, + [property: JsonPropertyName("Foldable")] Foldable? Foldable, + [property: JsonPropertyName("Repairable")] Repairable? Repairable ); \ No newline at end of file