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

@@ -6,7 +6,7 @@ namespace Content.Client.Light.Components;
[RegisterComponent]
[NetworkedComponent]
public sealed class EmergencyLightComponent : SharedEmergencyLightComponent
public sealed partial class EmergencyLightComponent : SharedEmergencyLightComponent
{
}

View File

@@ -8,7 +8,7 @@ namespace Content.Client.Light.Components;
/// Component that represents a handheld expendable light which can be activated and eventually dies over time.
/// </summary>
[RegisterComponent]
public sealed class ExpendableLightComponent : SharedExpendableLightComponent
public sealed partial class ExpendableLightComponent : SharedExpendableLightComponent
{
/// <summary>
/// The icon state used by expendable lights when the they have been completely expended.

View File

@@ -16,7 +16,7 @@ namespace Content.Client.Light.Components
/// </summary>
[Serializable]
[ImplicitDataDefinitionForInheritors]
public abstract class LightBehaviourAnimationTrack : AnimationTrackProperty
public abstract partial class LightBehaviourAnimationTrack : AnimationTrackProperty
{
protected IEntityManager _entMan = default!;
protected IRobustRandom _random = default!;
@@ -111,7 +111,7 @@ namespace Content.Client.Light.Components
/// A light behaviour that alternates between StartValue and EndValue
/// </summary>
[UsedImplicitly]
public sealed class PulseBehaviour : LightBehaviourAnimationTrack
public sealed partial class PulseBehaviour : LightBehaviourAnimationTrack
{
public override (int KeyFrameIndex, float FramePlayingTime) AdvancePlayback(
object context, int prevKeyFrameIndex, float prevPlayingTime, float frameTime)
@@ -166,7 +166,7 @@ namespace Content.Client.Light.Components
/// A light behaviour that interpolates from StartValue to EndValue
/// </summary>
[UsedImplicitly]
public sealed class FadeBehaviour : LightBehaviourAnimationTrack
public sealed partial class FadeBehaviour : LightBehaviourAnimationTrack
{
/// <summary>
/// Automatically reverse the animation when EndValue is reached. In this particular case, MaxTime specifies the
@@ -229,7 +229,7 @@ namespace Content.Client.Light.Components
/// A light behaviour that interpolates using random values chosen between StartValue and EndValue.
/// </summary>
[UsedImplicitly]
public sealed class RandomizeBehaviour : LightBehaviourAnimationTrack
public sealed partial class RandomizeBehaviour : LightBehaviourAnimationTrack
{
private float _randomValue1;
private float _randomValue2;
@@ -295,7 +295,7 @@ namespace Content.Client.Light.Components
/// </summary>
[UsedImplicitly]
[DataDefinition]
public sealed class ColorCycleBehaviour : LightBehaviourAnimationTrack, ISerializationHooks
public sealed partial class ColorCycleBehaviour : LightBehaviourAnimationTrack, ISerializationHooks
{
[DataField("property")]
public override string Property { get; protected set; } = "Color";
@@ -357,7 +357,7 @@ namespace Content.Client.Light.Components
/// A component which applies a specific behaviour to a PointLightComponent on its owner.
/// </summary>
[RegisterComponent]
public sealed class LightBehaviourComponent : SharedLightBehaviourComponent, ISerializationHooks
public sealed partial class LightBehaviourComponent : SharedLightBehaviourComponent, ISerializationHooks
{
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IRobustRandom _random = default!;
@@ -381,7 +381,7 @@ namespace Content.Client.Light.Components
[ViewVariables(VVAccess.ReadOnly)]
[DataField("behaviours")]
public readonly List<LightBehaviourAnimationTrack> Behaviours = new();
public List<LightBehaviourAnimationTrack> Behaviours = new();
[ViewVariables(VVAccess.ReadOnly)]
public readonly List<AnimationContainer> Animations = new();

View File

@@ -4,7 +4,7 @@ namespace Content.Client.Light.Components;
/// Fades out the <see cref="SharedPointLightComponent"/> attached to this entity.
/// </summary>
[RegisterComponent]
public sealed class LightFadeComponent : Component
public sealed partial class LightFadeComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("duration")]
public float Duration = 0.5f;

View File

@@ -5,14 +5,14 @@ namespace Content.Client.Light.Visualizers;
[RegisterComponent]
[Access(typeof(PoweredLightVisualizerSystem))]
public sealed class PoweredLightVisualsComponent : Component
public sealed partial class PoweredLightVisualsComponent : Component
{
/// <summary>
/// A map of the sprite states used by this visualizer indexed by the light state they correspond to.
/// </summary>
[DataField("spriteStateMap")]
[ViewVariables(VVAccess.ReadOnly)]
public readonly Dictionary<PoweredLightState, string> SpriteStateMap = new()
public Dictionary<PoweredLightState, string> SpriteStateMap = new()
{
[PoweredLightState.Empty] = "empty",
[PoweredLightState.Off] = "off",