Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Content.Shared.Storage.Components;
|
||||
/// you can only take off of the top of the bin.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(BinSystem))]
|
||||
public sealed class BinComponent : Component
|
||||
public sealed partial class BinComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The containers that contain the items held in the bin
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Storage.Components;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class DumpableDoAfterEvent : SimpleDoAfterEvent
|
||||
public sealed partial class DumpableDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// Added to entities contained within entity storage, for directed event purposes.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class InsideEntityStorageComponent : Component
|
||||
public sealed partial class InsideEntityStorageComponent : Component
|
||||
{
|
||||
public EntityUid Storage;
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ namespace Content.Shared.Storage.Components
|
||||
/// </code>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(SharedItemCounterSystem))]
|
||||
public sealed class ItemCounterComponent : Component
|
||||
public sealed partial class ItemCounterComponent : Component
|
||||
{
|
||||
[DataField("count", required: true)]
|
||||
public EntityWhitelist Count { get; set; } = default!;
|
||||
|
||||
[DataField("amount")]
|
||||
public int? MaxAmount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default IconLayer stack.
|
||||
/// </summary>
|
||||
|
||||
@@ -54,9 +54,9 @@ namespace Content.Shared.Storage.Components
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(SharedItemMapperSystem))]
|
||||
public sealed class ItemMapperComponent : Component
|
||||
public sealed partial class ItemMapperComponent : Component
|
||||
{
|
||||
[DataField("mapLayers")] public readonly Dictionary<string, SharedMapLayerData> MapLayers = new();
|
||||
[DataField("mapLayers")] public Dictionary<string, SharedMapLayerData> MapLayers = new();
|
||||
|
||||
[DataField("sprite")] public ResPath? RSIPath;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Storage.Components;
|
||||
|
||||
[NetworkedComponent]
|
||||
public abstract class SharedEntityStorageComponent : Component
|
||||
public abstract partial class SharedEntityStorageComponent : Component
|
||||
{
|
||||
public readonly float MaxSize = 1.0f; // maximum width or height of an entity allowed inside the storage.
|
||||
|
||||
@@ -57,7 +57,7 @@ public abstract class SharedEntityStorageComponent : Component
|
||||
|
||||
//The collision groups checked, so that items are depositied or grabbed from inside walls.
|
||||
[DataField("enteringOffsetCollisionFlags")]
|
||||
public readonly CollisionGroup EnteringOffsetCollisionFlags = CollisionGroup.Impassable | CollisionGroup.MidImpassable;
|
||||
public CollisionGroup EnteringOffsetCollisionFlags = CollisionGroup.Impassable | CollisionGroup.MidImpassable;
|
||||
|
||||
/// <summary>
|
||||
/// How close you have to be to the "entering" spot to be able to enter
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Shared.Storage.Components
|
||||
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public sealed class SharedMapLayerData
|
||||
public sealed partial class SharedMapLayerData
|
||||
{
|
||||
public string Layer = string.Empty;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Shared.Storage.Components;
|
||||
/// Change sprite depending on a storage fill percent.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class StorageFillVisualizerComponent : Component
|
||||
public sealed partial class StorageFillVisualizerComponent : Component
|
||||
{
|
||||
[DataField("maxFillLevels", required: true)]
|
||||
public int MaxFillLevels;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Shared.Storage;
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public struct EntitySpawnEntry
|
||||
public partial struct EntitySpawnEntry
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("id", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
|
||||
@@ -4,6 +4,6 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Storage.EntitySystems;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BluespaceLockerDoAfterEvent : SimpleDoAfterEvent
|
||||
public sealed partial class BluespaceLockerDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Storage;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AreaPickupDoAfterEvent : DoAfterEvent
|
||||
public sealed partial class AreaPickupDoAfterEvent : DoAfterEvent
|
||||
{
|
||||
[DataField("entities", required: true)]
|
||||
public readonly IReadOnlyList<EntityUid> Entities = default!;
|
||||
public IReadOnlyList<EntityUid> Entities = default!;
|
||||
|
||||
private AreaPickupDoAfterEvent()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Storage
|
||||
{
|
||||
[NetworkedComponent()]
|
||||
public abstract class SharedStorageComponent : Component
|
||||
public abstract partial class SharedStorageComponent : Component
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class StorageBoundUserInterfaceState : BoundUserInterfaceState
|
||||
|
||||
Reference in New Issue
Block a user