Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user