Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Content.Server.Damage.Components;
|
||||
/// Should the entity take damage / be stunned if colliding at a speed above MinimumSpeed?
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(DamageOnHighSpeedImpactSystem))]
|
||||
public sealed class DamageOnHighSpeedImpactComponent : Component
|
||||
public sealed partial class DamageOnHighSpeedImpactComponent : Component
|
||||
{
|
||||
[DataField("minimumSpeed"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MinimumSpeed = 20f;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Content.Shared.Damage;
|
||||
namespace Content.Server.Damage.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class DamageOnHitComponent : Component
|
||||
public sealed partial class DamageOnHitComponent : Component
|
||||
{
|
||||
[DataField("ignoreResistances")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -3,7 +3,7 @@ using Content.Shared.Damage;
|
||||
namespace Content.Server.Damage.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class DamageOnLandComponent : Component
|
||||
public sealed partial class DamageOnLandComponent : Component
|
||||
{
|
||||
[DataField("ignoreResistances")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -5,18 +5,18 @@ using Robust.Shared.Utility;
|
||||
namespace Content.Server.Damage.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class DamageOnToolInteractComponent : Component
|
||||
public sealed partial class DamageOnToolInteractComponent : Component
|
||||
{
|
||||
[DataField("tools")]
|
||||
public PrototypeFlags<ToolQualityPrototype> Tools { get; } = new ();
|
||||
public PrototypeFlags<ToolQualityPrototype> Tools { get; private set; } = new ();
|
||||
|
||||
// TODO: Remove this snowflake stuff, make damage per-tool quality perhaps?
|
||||
[DataField("weldingDamage")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier? WeldingDamage { get; }
|
||||
public DamageSpecifier? WeldingDamage { get; private set; }
|
||||
|
||||
[DataField("defaultDamage")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier? DefaultDamage { get; }
|
||||
public DamageSpecifier? DefaultDamage { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Content.Server.Damage.Components
|
||||
{
|
||||
[Access(typeof(DamageOtherOnHitSystem))]
|
||||
[RegisterComponent]
|
||||
public sealed class DamageOtherOnHitComponent : Component
|
||||
public sealed partial class DamageOtherOnHitComponent : Component
|
||||
{
|
||||
[DataField("ignoreResistances")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Content.Server.Damage.Components;
|
||||
|
||||
[RegisterComponent, Access(typeof(DamagePopupSystem))]
|
||||
public sealed class DamagePopupComponent : Component
|
||||
public sealed partial class DamagePopupComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum that will be used to determine the type of damage popup displayed.
|
||||
|
||||
@@ -3,7 +3,7 @@ using Content.Shared.Damage;
|
||||
namespace Content.Server.Damage.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class DamageUserOnTriggerComponent : Component
|
||||
public sealed partial class DamageUserOnTriggerComponent : Component
|
||||
{
|
||||
[DataField("ignoreResistances")] public bool IgnoreResistances;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Damage.Components;
|
||||
/// This component shows entity damage severity when it is examined by player.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ExaminableDamageComponent : Component
|
||||
public sealed partial class ExaminableDamageComponent : Component
|
||||
{
|
||||
[DataField("messages", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<ExaminableDamagePrototype>))]
|
||||
public string? MessagesProtoId;
|
||||
|
||||
Reference in New Issue
Block a user