Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Content.Shared.Damage.Components;
|
||||
/// Tracks whether an entity has ANY stamina damage for update purposes only.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ActiveStaminaComponent : Component
|
||||
public sealed partial class ActiveStaminaComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.GameStates;
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
[NetworkedComponent, RegisterComponent]
|
||||
public sealed class DamageContactsComponent : Component
|
||||
public sealed partial class DamageContactsComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The damage done each second to those touching this entity
|
||||
|
||||
@@ -3,6 +3,6 @@ using Robust.Shared.GameStates;
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class DamageExaminableComponent : Component
|
||||
public sealed partial class DamageExaminableComponent : Component
|
||||
{
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Shared.Damage
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent()]
|
||||
[Access(typeof(DamageableSystem), Other = AccessPermissions.ReadExecute)]
|
||||
public sealed class DamageableComponent : Component
|
||||
public sealed partial class DamageableComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// This <see cref="DamageContainerPrototype"/> specifies what damage types are supported by this component.
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
[NetworkedComponent, RegisterComponent]
|
||||
public sealed class DamagedByContactComponent : Component
|
||||
public sealed partial class DamagedByContactComponent : Component
|
||||
{
|
||||
[DataField("nextSecond", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan NextSecond = TimeSpan.Zero;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.GameStates;
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedGodmodeSystem))]
|
||||
public sealed class GodmodeComponent : Component
|
||||
public sealed partial class GodmodeComponent : Component
|
||||
{
|
||||
[DataField("wasMovedByPressure")]
|
||||
public bool WasMovedByPressure;
|
||||
|
||||
@@ -6,12 +6,12 @@ namespace Content.Shared.Damage.Components
|
||||
// TODO It'd be nice if this could be a destructible threshold, but on the other hand,
|
||||
// that doesn't really work with events at all, and
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class SlowOnDamageComponent : Component
|
||||
public sealed partial class SlowOnDamageComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Damage -> movespeed dictionary. This is -damage-, not -health-.
|
||||
/// </summary>
|
||||
[DataField("speedModifierThresholds", required: true)]
|
||||
public readonly Dictionary<FixedPoint2, float> SpeedModifierThresholds = default!;
|
||||
public Dictionary<FixedPoint2, float> SpeedModifierThresholds = default!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Damage.Components;
|
||||
/// Add to an entity to paralyze it whenever it reaches critical amounts of Stamina DamageType.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class StaminaComponent : Component
|
||||
public sealed partial class StaminaComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Have we reached peak stamina damage and been paralyzed?
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Shared.Damage.Components;
|
||||
/// Applies stamina damage when colliding with an entity.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class StaminaDamageOnCollideComponent : Component
|
||||
public sealed partial class StaminaDamageOnCollideComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("damage")]
|
||||
public float Damage = 55f;
|
||||
|
||||
@@ -3,7 +3,7 @@ using Robust.Shared.Audio;
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class StaminaDamageOnHitComponent : Component
|
||||
public sealed partial class StaminaDamageOnHitComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("damage")]
|
||||
public float Damage = 30f;
|
||||
|
||||
Reference in New Issue
Block a user