Refactor serialization copying to use source generators (#19412)

This commit is contained in:
DrSmugleaf
2023-08-22 18:14:33 -07:00
committed by GitHub
parent 08b43990ab
commit a88e747a0b
1737 changed files with 2532 additions and 2521 deletions

View File

@@ -14,10 +14,10 @@ namespace Content.Shared.Construction.Prototypes
[ViewVariables]
[IdDataField]
public string ID { get; } = default!;
public string ID { get; private set; } = default!;
[DataField("start")]
public string? Start { get; }
public string? Start { get; private set; }
[DataField("graph", priority: 0)]
private List<ConstructionGraphNode> _graph = new();

View File

@@ -70,7 +70,7 @@ public sealed class ConstructionPrototype : IPrototype
[ViewVariables]
[IdDataField]
public string ID { get; } = default!;
public string ID { get; private set; } = default!;
[DataField("placementMode")]
public string PlacementMode = "PlaceFree";

View File

@@ -12,17 +12,17 @@ public sealed class MachinePartPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
public string ID { get; } = default!;
public string ID { get; private set; } = default!;
/// <summary>
/// A human-readable name for the machine part type.
/// </summary>
[DataField("name")]
public readonly string Name = string.Empty;
public string Name = string.Empty;
/// <summary>
/// A stock part entity based on the machine part.
/// </summary>
[DataField("stockPartPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>), required: true)]
public readonly string StockPartPrototype = string.Empty;
public string StockPartPrototype = string.Empty;
}