refactor(backend): simplify cargo kind loading
This commit is contained in:
@@ -114,10 +114,8 @@ public sealed class ItemDefinition
|
||||
public required string Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string Type { get; set; } = "material";
|
||||
public string CargoKind { get; set; } = string.Empty;
|
||||
[JsonIgnore]
|
||||
public StorageKind? CargoStorageKind { get; set; }
|
||||
public StorageKind? CargoKind { get; set; }
|
||||
public float Volume { get; set; } = 1f;
|
||||
public int Version { get; set; }
|
||||
public string FactoryName { get; set; } = string.Empty;
|
||||
@@ -130,7 +128,8 @@ public sealed class ItemDefinition
|
||||
[JsonPropertyName("transport")]
|
||||
public string Transport
|
||||
{
|
||||
set => CargoKind = value;
|
||||
get => CargoKind?.ToDataValue() ?? string.Empty;
|
||||
set => CargoKind = value.ToNullableStorageKind();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,9 +337,14 @@ public sealed class ShipDefinition
|
||||
public float FtlSpeed { get; set; }
|
||||
public float SpoolTime { get; set; }
|
||||
public float CargoCapacity { get; set; }
|
||||
public string? CargoKind { get; set; }
|
||||
[JsonIgnore]
|
||||
public StorageKind? CargoStorageKind { get; set; }
|
||||
public StorageKind? CargoKind { get; set; }
|
||||
[JsonPropertyName("cargoKind")]
|
||||
public string? SerializedCargoKind
|
||||
{
|
||||
get => CargoKind?.ToDataValue();
|
||||
set => CargoKind = value.ToNullableStorageKind();
|
||||
}
|
||||
public required string Color { get; set; }
|
||||
public required string HullColor { get; set; }
|
||||
public float Size { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user