Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Content.Shared.Kitchen.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(SharedKitchenSpikeSystem))]
|
||||
public sealed class KitchenSpikeComponent : Component
|
||||
public sealed partial class KitchenSpikeComponent : Component
|
||||
{
|
||||
[DataField("delay")]
|
||||
public float SpikeDelay = 7.0f;
|
||||
|
||||
@@ -14,22 +14,22 @@ namespace Content.Shared.Kitchen
|
||||
{
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
[DataField("name")]
|
||||
private string _name = string.Empty;
|
||||
|
||||
[DataField("reagents", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<FixedPoint2, ReagentPrototype>))]
|
||||
private readonly Dictionary<string, FixedPoint2> _ingsReagents = new();
|
||||
private Dictionary<string, FixedPoint2> _ingsReagents = new();
|
||||
|
||||
[DataField("solids", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<FixedPoint2, EntityPrototype>))]
|
||||
private readonly Dictionary<string, FixedPoint2> _ingsSolids = new ();
|
||||
private Dictionary<string, FixedPoint2> _ingsSolids = new ();
|
||||
|
||||
[DataField("result", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string Result { get; } = string.Empty;
|
||||
public string Result { get; private set; } = string.Empty;
|
||||
|
||||
[DataField("time")]
|
||||
public uint CookTime { get; } = 5;
|
||||
public uint CookTime { get; private set; } = 5;
|
||||
|
||||
public string Name => Loc.GetString(_name);
|
||||
|
||||
|
||||
@@ -33,6 +33,6 @@ public abstract class SharedKitchenSpikeSystem : EntitySystem
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class SpikeDoAfterEvent : SimpleDoAfterEvent
|
||||
public sealed partial class SpikeDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Kitchen;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class SharpDoAfterEvent : SimpleDoAfterEvent
|
||||
public sealed partial class SharpDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user