Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Content.Server.Objectives.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class DieCondition : IObjectiveCondition
|
||||
public sealed partial class DieCondition : IObjectiveCondition
|
||||
{
|
||||
private Mind.Mind? _mind;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Objectives.Conditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class EscapeShuttleCondition : IObjectiveCondition
|
||||
public sealed partial class EscapeShuttleCondition : IObjectiveCondition
|
||||
{
|
||||
private Mind.Mind? _mind;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Linq;
|
||||
namespace Content.Server.Objectives.Conditions;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class KillRandomHeadCondition : KillPersonCondition
|
||||
public sealed partial class KillRandomHeadCondition : KillPersonCondition
|
||||
{
|
||||
public override IObjectiveCondition GetAssigned(Mind.Mind mind)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.Random;
|
||||
namespace Content.Server.Objectives.Conditions;
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class KillRandomPersonCondition : KillPersonCondition
|
||||
public sealed partial class KillRandomPersonCondition : KillPersonCondition
|
||||
{
|
||||
public override IObjectiveCondition GetAssigned(Mind.Mind mind)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using Content.Server.Mind;
|
||||
namespace Content.Server.Objectives.Conditions
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed class RandomTraitorAliveCondition : IObjectiveCondition
|
||||
public sealed partial class RandomTraitorAliveCondition : IObjectiveCondition
|
||||
{
|
||||
private Mind.Mind? _target;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ using Content.Server.Roles;
|
||||
namespace Content.Server.Objectives.Conditions
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed class RandomTraitorProgressCondition : IObjectiveCondition
|
||||
public sealed partial class RandomTraitorProgressCondition : IObjectiveCondition
|
||||
{
|
||||
private Mind.Mind? _target;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Objectives.Conditions
|
||||
// Oh god my eyes
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class StealCondition : IObjectiveCondition, ISerializationHooks
|
||||
public sealed partial class StealCondition : IObjectiveCondition, ISerializationHooks
|
||||
{
|
||||
private Mind.Mind? _mind;
|
||||
[DataField("prototype")] private string _prototypeId = string.Empty;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Objectives
|
||||
{
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
[DataField("issuer")] public string Issuer { get; private set; } = "Unknown";
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
namespace Content.Server.Objectives.Requirements
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed class IncompatibleConditionsRequirement : IObjectiveRequirement
|
||||
public sealed partial class IncompatibleConditionsRequirement : IObjectiveRequirement
|
||||
{
|
||||
[DataField("conditions")]
|
||||
private readonly List<string> _incompatibleConditions = new();
|
||||
private List<string> _incompatibleConditions = new();
|
||||
|
||||
public bool CanBeAssigned(Mind.Mind mind)
|
||||
{
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
namespace Content.Server.Objectives.Requirements
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed class IncompatibleObjectivesRequirement : IObjectiveRequirement
|
||||
public sealed partial class IncompatibleObjectivesRequirement : IObjectiveRequirement
|
||||
{
|
||||
[DataField("objectives")]
|
||||
private readonly List<string> _incompatibleObjectives = new();
|
||||
private List<string> _incompatibleObjectives = new();
|
||||
|
||||
public bool CanBeAssigned(Mind.Mind mind)
|
||||
{
|
||||
|
||||
@@ -4,10 +4,10 @@ using Content.Server.GameTicking.Rules;
|
||||
namespace Content.Server.Objectives.Requirements
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed class MultipleTraitorsRequirement : IObjectiveRequirement
|
||||
public sealed partial class MultipleTraitorsRequirement : IObjectiveRequirement
|
||||
{
|
||||
[DataField("traitors")]
|
||||
private readonly int _requiredTraitors = 2;
|
||||
private int _requiredTraitors = 2;
|
||||
|
||||
public bool CanBeAssigned(Mind.Mind mind)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.Objectives.Requirements
|
||||
{
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class NotRoleRequirement : IObjectiveRequirement
|
||||
public sealed partial class NotRoleRequirement : IObjectiveRequirement
|
||||
{
|
||||
[DataField("roleId", customTypeSerializer:typeof(PrototypeIdSerializer<JobPrototype>), required:true)]
|
||||
private string _roleId = default!;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Objectives.Requirements
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class TraitorRequirement : IObjectiveRequirement
|
||||
public sealed partial class TraitorRequirement : IObjectiveRequirement
|
||||
{
|
||||
public bool CanBeAssigned(Mind.Mind mind)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user