Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class DoorBolted : IGraphCondition
|
||||
public sealed partial class DoorBolted : IGraphCondition
|
||||
{
|
||||
[DataField("value")]
|
||||
public bool Value { get; private set; } = true;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class AllConditions : IGraphCondition
|
||||
public sealed partial class AllConditions : IGraphCondition
|
||||
{
|
||||
[DataField("conditions")]
|
||||
public IGraphCondition[] Conditions { get; } = Array.Empty<IGraphCondition>();
|
||||
public IGraphCondition[] Conditions { get; private set; } = Array.Empty<IGraphCondition>();
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.Construction.Conditions
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class AllWiresCut : IGraphCondition
|
||||
public sealed partial class AllWiresCut : IGraphCondition
|
||||
{
|
||||
[DataField("value")] public bool Value { get; private set; } = true;
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class AnyConditions : IGraphCondition
|
||||
public sealed partial class AnyConditions : IGraphCondition
|
||||
{
|
||||
[DataField("conditions")]
|
||||
public IGraphCondition[] Conditions { get; } = Array.Empty<IGraphCondition>();
|
||||
public IGraphCondition[] Conditions { get; private set; } = Array.Empty<IGraphCondition>();
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Construction.Conditions
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class ComponentInTile : IGraphCondition
|
||||
public sealed partial class ComponentInTile : IGraphCondition
|
||||
{
|
||||
/// <summary>
|
||||
/// If true, any entity on the tile must have the component.
|
||||
@@ -22,13 +22,13 @@ namespace Content.Server.Construction.Conditions
|
||||
public bool HasEntity { get; private set; }
|
||||
|
||||
[DataField("examineText")]
|
||||
public string? ExamineText { get; }
|
||||
public string? ExamineText { get; private set; }
|
||||
|
||||
[DataField("guideText")]
|
||||
public string? GuideText { get; }
|
||||
public string? GuideText { get; private set; }
|
||||
|
||||
[DataField("guideIcon")]
|
||||
public SpriteSpecifier? GuideIcon { get; }
|
||||
public SpriteSpecifier? GuideIcon { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The component name in question.
|
||||
|
||||
@@ -9,19 +9,19 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class ContainerEmpty : IGraphCondition
|
||||
public sealed partial class ContainerEmpty : IGraphCondition
|
||||
{
|
||||
[DataField("container")]
|
||||
public string Container { get; } = string.Empty;
|
||||
public string Container { get; private set; } = string.Empty;
|
||||
|
||||
[DataField("examineText")]
|
||||
public string? ExamineText { get; }
|
||||
public string? ExamineText { get; private set; }
|
||||
|
||||
[DataField("guideStep")]
|
||||
public string? GuideText { get; }
|
||||
public string? GuideText { get; private set; }
|
||||
|
||||
[DataField("guideIcon")]
|
||||
public SpriteSpecifier? GuideIcon { get; }
|
||||
public SpriteSpecifier? GuideIcon { get; private set; }
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
|
||||
@@ -9,12 +9,12 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class ContainerNotEmpty : IGraphCondition
|
||||
public sealed partial class ContainerNotEmpty : IGraphCondition
|
||||
{
|
||||
[DataField("container")] public string Container { get; private set; } = string.Empty;
|
||||
[DataField("examineText")] public string? ExamineText { get; }
|
||||
[DataField("guideText")] public string? GuideText { get; }
|
||||
[DataField("guideIcon")] public SpriteSpecifier? GuideIcon { get; }
|
||||
[DataField("examineText")] public string? ExamineText { get; private set; }
|
||||
[DataField("guideText")] public string? GuideText { get; private set; }
|
||||
[DataField("guideIcon")] public SpriteSpecifier? GuideIcon { get; private set; }
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class DoorWelded : IGraphCondition
|
||||
public sealed partial class DoorWelded : IGraphCondition
|
||||
{
|
||||
[DataField("welded")]
|
||||
public bool Welded { get; private set; } = true;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class EntityAnchored : IGraphCondition
|
||||
public sealed partial class EntityAnchored : IGraphCondition
|
||||
{
|
||||
[DataField("anchored")] public bool Anchored { get; private set; } = true;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class Locked : IGraphCondition
|
||||
public sealed partial class Locked : IGraphCondition
|
||||
{
|
||||
[DataField("locked")]
|
||||
public bool IsLocked { get; private set; } = true;
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace Content.Server.Construction.Conditions
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class MachineFrameComplete : IGraphCondition
|
||||
public sealed partial class MachineFrameComplete : IGraphCondition
|
||||
{
|
||||
[DataField("guideIconBoard")]
|
||||
public SpriteSpecifier? GuideIconBoard { get; }
|
||||
public SpriteSpecifier? GuideIconBoard { get; private set; }
|
||||
|
||||
[DataField("guideIconParts")]
|
||||
public SpriteSpecifier? GuideIconPart { get; }
|
||||
public SpriteSpecifier? GuideIconPart { get; private set; }
|
||||
|
||||
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class StorageWelded : IGraphCondition
|
||||
public sealed partial class StorageWelded : IGraphCondition
|
||||
{
|
||||
[DataField("welded")]
|
||||
public bool Welded { get; private set; } = true;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class ToiletLidClosed : IGraphCondition
|
||||
public sealed partial class ToiletLidClosed : IGraphCondition
|
||||
{
|
||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class WirePanel : IGraphCondition
|
||||
public sealed partial class WirePanel : IGraphCondition
|
||||
{
|
||||
[DataField("open")] public bool Open { get; private set; } = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user