Refactor serialization copying to use source generators (#19412)

This commit is contained in:
DrSmugleaf
2023-08-22 18:14:33 -07:00
committed by GitHub
parent 08b43990ab
commit a88e747a0b
1737 changed files with 2532 additions and 2521 deletions

View File

@@ -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
{
}

View File

@@ -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

View File

@@ -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
{
}

View File

@@ -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.

View File

@@ -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;

View File

@@ -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;

View File

@@ -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!;
}
}

View File

@@ -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?

View File

@@ -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;

View File

@@ -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;