mirror of
https://github.com/sp-tarkov/loot-dump-processor.git
synced 2025-02-13 03:30:45 -05:00
Added JSON property name attributes and fixed nullable handling in models
This commit is contained in:
parent
5d2c0d04b1
commit
65724da100
@ -1,11 +1,13 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace LootDumpProcessor.Model;
|
namespace LootDumpProcessor.Model;
|
||||||
|
|
||||||
public class GroupPosition : ICloneable
|
public class GroupPosition : ICloneable
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
[JsonPropertyName("Name")] public string Name { get; set; }
|
||||||
public int Weight { get; set; }
|
[JsonPropertyName("Weight")] public int Weight { get; set; }
|
||||||
public Vector3 Position { get; set; }
|
[JsonPropertyName("Position")] public Vector3 Position { get; set; }
|
||||||
public Vector3 Rotation { get; set; }
|
[JsonPropertyName("Rotation")] public Vector3 Rotation { get; set; }
|
||||||
|
|
||||||
public object Clone() => new GroupPosition
|
public object Clone() => new GroupPosition
|
||||||
{
|
{
|
||||||
|
@ -7,24 +7,24 @@ namespace LootDumpProcessor.Model;
|
|||||||
|
|
||||||
public class Template : IKeyable, ICloneable
|
public class Template : IKeyable, ICloneable
|
||||||
{
|
{
|
||||||
[JsonIgnore] public string internalId { get; }
|
[JsonIgnore] public string InternalId { get; }
|
||||||
public string Id { get; set; }
|
[JsonPropertyName("Id")] public string Id { get; set; }
|
||||||
public bool IsContainer { get; set; }
|
[JsonPropertyName("IsContainer")] public bool IsContainer { get; set; }
|
||||||
public bool UseGravity { get; set; }
|
public bool UseGravity { get; set; }
|
||||||
public bool RandomRotation { get; set; }
|
public bool RandomRotation { get; set; }
|
||||||
public Vector3 Position { get; set; }
|
[JsonPropertyName("Position")] public Vector3 Position { get; set; }
|
||||||
public Vector3 Rotation { get; set; }
|
[JsonPropertyName("Rotation")] public Vector3 Rotation { get; set; }
|
||||||
public bool IsGroupPosition { get; set; }
|
[JsonPropertyName("IsGroupPosition")] public bool IsGroupPosition { get; set; }
|
||||||
public List<GroupPosition> GroupPositions { get; set; }
|
[JsonPropertyName("GroupPositions")] public List<GroupPosition> GroupPositions { get; set; }
|
||||||
public bool IsAlwaysSpawn { get; set; }
|
[JsonPropertyName("IsAlwaysSpawn")] public bool IsAlwaysSpawn { get; set; }
|
||||||
public string Root { get; set; }
|
[JsonPropertyName("Root")] public string Root { get; set; }
|
||||||
public List<Item> Items { get; set; }
|
[JsonPropertyName("Items")] public List<Item> Items { get; set; }
|
||||||
|
|
||||||
public Template(string internalId, string id, bool isContainer, bool useGravity, bool randomRotation,
|
public Template(string internalId, string id, bool isContainer, bool useGravity, bool randomRotation,
|
||||||
Vector3 position, Vector3 rotation, bool isGroupPosition, List<GroupPosition> groupPositions,
|
Vector3 position, Vector3 rotation, bool isGroupPosition, List<GroupPosition> groupPositions,
|
||||||
bool isAlwaysSpawn, string root, List<Item> items)
|
bool isAlwaysSpawn, string root, List<Item> items)
|
||||||
{
|
{
|
||||||
this.internalId = internalId;
|
this.InternalId = internalId;
|
||||||
Id = id;
|
Id = id;
|
||||||
IsContainer = isContainer;
|
IsContainer = isContainer;
|
||||||
UseGravity = useGravity;
|
UseGravity = useGravity;
|
||||||
@ -49,11 +49,11 @@ public class Template : IKeyable, ICloneable
|
|||||||
|
|
||||||
public override int GetHashCode() => Id != null ? Id.GetHashCode() : 0;
|
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
|
public object Clone() => new Template
|
||||||
(
|
(
|
||||||
internalId,
|
InternalId,
|
||||||
Id,
|
Id,
|
||||||
IsContainer,
|
IsContainer,
|
||||||
UseGravity,
|
UseGravity,
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace LootDumpProcessor.Model;
|
namespace LootDumpProcessor.Model;
|
||||||
|
|
||||||
public readonly record struct Upd(
|
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
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user