Validate prototype ids in c# fields (#18224)
This commit is contained in:
@@ -676,9 +676,9 @@ namespace Content.Shared.Chemistry.Components
|
||||
[DataDefinition]
|
||||
public readonly struct ReagentQuantity: IComparable<ReagentQuantity>
|
||||
{
|
||||
[DataField("ReagentId", customTypeSerializer:typeof(PrototypeIdSerializer<ReagentPrototype>))]
|
||||
[DataField("ReagentId", customTypeSerializer:typeof(PrototypeIdSerializer<ReagentPrototype>), required:true)]
|
||||
public readonly string ReagentId;
|
||||
[DataField("Quantity")]
|
||||
[DataField("Quantity", required:true)]
|
||||
public readonly FixedPoint2 Quantity;
|
||||
|
||||
public ReagentQuantity(string reagentId, FixedPoint2 quantity)
|
||||
@@ -687,6 +687,10 @@ namespace Content.Shared.Chemistry.Components
|
||||
Quantity = quantity;
|
||||
}
|
||||
|
||||
public ReagentQuantity() : this(string.Empty, default)
|
||||
{
|
||||
}
|
||||
|
||||
[ExcludeFromCodeCoverage]
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user