Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Content.Server.Destructible.Thresholds.Triggers
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public sealed class AndTrigger : IThresholdTrigger
|
||||
public sealed partial class AndTrigger : IThresholdTrigger
|
||||
{
|
||||
[DataField("triggers")]
|
||||
public List<IThresholdTrigger> Triggers { get; set; } = new();
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Destructible.Thresholds.Triggers
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public sealed class DamageGroupTrigger : IThresholdTrigger
|
||||
public sealed partial class DamageGroupTrigger : IThresholdTrigger
|
||||
{
|
||||
[DataField("damageGroup", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<DamageGroupPrototype>))]
|
||||
public string DamageGroup { get; set; } = default!;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Destructible.Thresholds.Triggers
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public sealed class DamageTrigger : IThresholdTrigger
|
||||
public sealed partial class DamageTrigger : IThresholdTrigger
|
||||
{
|
||||
/// <summary>
|
||||
/// The amount of damage at which this threshold will trigger.
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Destructible.Thresholds.Triggers
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public sealed class DamageTypeTrigger : IThresholdTrigger
|
||||
public sealed partial class DamageTypeTrigger : IThresholdTrigger
|
||||
{
|
||||
[DataField("damageType", required:true, customTypeSerializer: typeof(PrototypeIdSerializer<DamageTypePrototype>))]
|
||||
public string DamageType { get; set; } = default!;
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace Content.Server.Destructible.Thresholds.Triggers
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataDefinition]
|
||||
public sealed class OrTrigger : IThresholdTrigger
|
||||
public sealed partial class OrTrigger : IThresholdTrigger
|
||||
{
|
||||
[DataField("triggers")]
|
||||
public List<IThresholdTrigger> Triggers { get; } = new();
|
||||
public List<IThresholdTrigger> Triggers { get; private set; } = new();
|
||||
|
||||
public bool Reached(DamageableComponent damageable, DestructibleSystem system)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user