Validate prototype ids in c# fields (#18224)

This commit is contained in:
Leon Friedrich
2023-07-30 05:34:51 +12:00
committed by GitHub
parent d4a85afb88
commit 385b587cfc
21 changed files with 116 additions and 74 deletions

View File

@@ -31,7 +31,7 @@ public sealed class ConstructionPrototype : IPrototype
/// <summary>
/// The <see cref="ConstructionGraphPrototype"/> this construction will be using.
/// </summary>
[DataField("graph", customTypeSerializer:typeof(PrototypeIdSerializer<ConstructionGraphPrototype>))]
[DataField("graph", customTypeSerializer:typeof(PrototypeIdSerializer<ConstructionGraphPrototype>), required: true)]
public string Graph = string.Empty;
/// <summary>
@@ -85,7 +85,7 @@ public sealed class ConstructionPrototype : IPrototype
/// Construction to replace this construction with when the current one is 'flipped'
/// </summary>
[DataField("mirror", customTypeSerializer:typeof(PrototypeIdSerializer<ConstructionPrototype>))]
public string Mirror = string.Empty;
public string? Mirror;
public IReadOnlyList<IConstructionCondition> Conditions => _conditions;
public IReadOnlyList<SpriteSpecifier> Layers => _layers ?? new List<SpriteSpecifier>{Icon};