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

@@ -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;

View File

@@ -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);

View File

@@ -33,6 +33,6 @@ public abstract class SharedKitchenSpikeSystem : EntitySystem
}
[Serializable, NetSerializable]
public sealed class SpikeDoAfterEvent : SimpleDoAfterEvent
public sealed partial class SpikeDoAfterEvent : SimpleDoAfterEvent
{
}

View File

@@ -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
{
}
}