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 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Xenoarchaeology.XenoArtifacts;
[RegisterComponent, Access(typeof(ArtifactSystem))]
public sealed class ArtifactComponent : Component
public sealed partial class ArtifactComponent : Component
{
/// <summary>
/// Every node contained in the tree
@@ -97,7 +97,7 @@ public sealed class ArtifactComponent : Component
/// A single "node" of an artifact that contains various data about it.
/// </summary>
[DataDefinition]
public sealed class ArtifactNode : ICloneable
public sealed partial class ArtifactNode : ICloneable
{
/// <summary>
/// A numeric id corresponding to each node.

View File

@@ -4,7 +4,7 @@
/// This is used for recharging all nearby batteries when activated
/// </summary>
[RegisterComponent]
public sealed class ChargeBatteryArtifactComponent : Component
public sealed partial class ChargeBatteryArtifactComponent : Component
{
/// <summary>
/// The radius of entities that will be affected

View File

@@ -12,7 +12,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// random chemicals upon being triggered.
/// </summary>
[RegisterComponent, Access(typeof(ChemicalPuddleArtifactSystem))]
public sealed class ChemicalPuddleArtifactComponent : Component
public sealed partial class ChemicalPuddleArtifactComponent : Component
{
/// <summary>
/// The solution where all the chemicals are stored

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// When activated, damages nearby entities.
/// </summary>
[RegisterComponent]
public sealed class DamageNearbyArtifactComponent : Component
public sealed partial class DamageNearbyArtifactComponent : Component
{
/// <summary>
/// The radius of entities that will be affected

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// </summary>
[RegisterComponent]
[Access(typeof(EmpArtifactSystem))]
public sealed class EmpArtifactComponent : Component
public sealed partial class EmpArtifactComponent : Component
{
[DataField("range"), ViewVariables(VVAccess.ReadWrite)]
public float Range = 4f;

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// Generates foam from the artifact when activated
/// </summary>
[RegisterComponent, Access(typeof(FoamArtifactSystem))]
public sealed class FoamArtifactComponent : Component
public sealed partial class FoamArtifactComponent : Component
{
/// <summary>
/// The list of reagents that will randomly be picked from

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// Spawn a random gas with random temperature when artifact activated.
/// </summary>
[RegisterComponent]
public sealed class GasArtifactComponent : Component
public sealed partial class GasArtifactComponent : Component
{
/// <summary>
/// Gas that will be spawned when artifact activated.

View File

@@ -4,7 +4,7 @@
/// Artifact that ignites surrounding entities when triggered.
/// </summary>
[RegisterComponent]
public sealed class IgniteArtifactComponent : Component
public sealed partial class IgniteArtifactComponent : Component
{
[DataField("range")]
public float Range = 2f;

View File

@@ -4,7 +4,7 @@
/// This is used for using the "knock" spell when the artifact is activated
/// </summary>
[RegisterComponent]
public sealed class KnockArtifactComponent : Component
public sealed partial class KnockArtifactComponent : Component
{
/// <summary>
/// The range of the spell

View File

@@ -4,7 +4,7 @@
/// Flickers all the lights within a certain radius.
/// </summary>
[RegisterComponent]
public sealed class LightFlickerArtifactComponent : Component
public sealed partial class LightFlickerArtifactComponent : Component
{
/// <summary>
/// Lights within this radius will be flickered on activation

View File

@@ -5,6 +5,6 @@
/// and such.
/// </summary>
[RegisterComponent]
public sealed class PhasingArtifactComponent : Component
public sealed partial class PhasingArtifactComponent : Component
{
}

View File

@@ -1,7 +1,7 @@
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
[RegisterComponent]
public sealed class RandomInstrumentArtifactComponent : Component
public sealed partial class RandomInstrumentArtifactComponent : Component
{
}

View File

@@ -5,7 +5,7 @@
/// to a random position within a certain radius
/// </summary>
[RegisterComponent]
public sealed class RandomTeleportArtifactComponent : Component
public sealed partial class RandomTeleportArtifactComponent : Component
{
/// <summary>
/// The max distance that the artifact will teleport.

View File

@@ -5,7 +5,7 @@
/// within a certain radius.
/// </summary>
[RegisterComponent]
public sealed class ShuffleArtifactComponent : Component
public sealed partial class ShuffleArtifactComponent : Component
{
[DataField("radius")]
public float Radius = 7.5f;

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// It could be an angry mob or some random item.
/// </summary>
[RegisterComponent]
public sealed class SpawnArtifactComponent : Component
public sealed partial class SpawnArtifactComponent : Component
{
[DataField("spawns")]
public List<EntitySpawnEntry>? Spawns;

View File

@@ -5,7 +5,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// Thoughts are shown as popups and unique for each player.
/// </summary>
[RegisterComponent]
public sealed class TelepathicArtifactComponent : Component
public sealed partial class TelepathicArtifactComponent : Component
{
/// <summary>
/// Loc string ids of telepathic messages.

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
/// Change atmospherics temperature until it reach target.
/// </summary>
[RegisterComponent]
public sealed class TemperatureArtifactComponent : Component
public sealed partial class TemperatureArtifactComponent : Component
{
[DataField("targetTemp"), ViewVariables(VVAccess.ReadWrite)]
public float TargetTemperature = Atmospherics.T0C;

View File

@@ -5,7 +5,7 @@
/// Also pries nearby tiles.
/// </summary>
[RegisterComponent]
public sealed class ThrowArtifactComponent : Component
public sealed partial class ThrowArtifactComponent : Component
{
/// <summary>
/// How close do you have to be to get yeeted?

View File

@@ -4,7 +4,7 @@
/// This is used for an artifact that triggers when activated.
/// </summary>
[RegisterComponent]
public sealed class TriggerArtifactComponent : Component
public sealed partial class TriggerArtifactComponent : Component
{
}

View File

@@ -7,7 +7,7 @@
/// Not every trigger can be a winner
/// </remarks>
[RegisterComponent]
public sealed class ArtifactAnchorTriggerComponent : Component
public sealed partial class ArtifactAnchorTriggerComponent : Component
{
}

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
/// Triggers when a certain threshold of damage of certain types is reached
/// </summary>
[RegisterComponent]
public sealed class ArtifactDamageTriggerComponent : Component
public sealed partial class ArtifactDamageTriggerComponent : Component
{
/// <summary>
/// What damage types are accumulated for the trigger?

View File

@@ -4,7 +4,7 @@
/// Triggers when a nearby entity dies
/// </summary>
[RegisterComponent]
public sealed class ArtifactDeathTriggerComponent : Component
public sealed partial class ArtifactDeathTriggerComponent : Component
{
/// <summary>
/// How close to the death the artifact has to be for it to trigger.

View File

@@ -5,7 +5,7 @@
/// It could be connected MV cables, stun baton or multi tool.
/// </summary>
[RegisterComponent]
public sealed class ArtifactElectricityTriggerComponent : Component
public sealed partial class ArtifactElectricityTriggerComponent : Component
{
/// <summary>
/// How much power should artifact receive to operate.

View File

@@ -4,7 +4,7 @@
/// Triggers when the artifact is examined.
/// </summary>
[RegisterComponent]
public sealed class ArtifactExamineTriggerComponent : Component
public sealed partial class ArtifactExamineTriggerComponent : Component
{
}

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
/// Activates artifact when it surrounded by certain gas.
/// </summary>
[RegisterComponent]
public sealed class ArtifactGasTriggerComponent : Component
public sealed partial class ArtifactGasTriggerComponent : Component
{
/// <summary>
/// List of possible activation gases to pick on startup.

View File

@@ -8,7 +8,7 @@
/// has contacted with a hot object (lit welder, lighter, etc).
/// </summary>
[RegisterComponent]
public sealed class ArtifactHeatTriggerComponent : Component
public sealed partial class ArtifactHeatTriggerComponent : Component
{
/// <summary>
/// Minimal surrounding gas temperature to trigger artifact.

View File

@@ -4,7 +4,7 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
/// Activate artifact by touching, attacking or pulling it.
/// </summary>
[RegisterComponent]
public sealed class ArtifactInteractionTriggerComponent : Component
public sealed partial class ArtifactInteractionTriggerComponent : Component
{
/// <summary>
/// Should artifact be activated just by touching with empty hand?

View File

@@ -4,6 +4,6 @@
/// Triggers when the artifact lands after being thrown.
/// </summary>
[RegisterComponent]
public sealed class ArtifactLandTriggerComponent : Component
public sealed partial class ArtifactLandTriggerComponent : Component
{
}

View File

@@ -4,7 +4,7 @@
/// Triggers when the salvage magnet is activated
/// </summary>
[RegisterComponent]
public sealed class ArtifactMagnetTriggerComponent : Component
public sealed partial class ArtifactMagnetTriggerComponent : Component
{
/// <summary>
/// how close to the magnet do you have to be?

View File

@@ -4,6 +4,6 @@
/// Triggers when an item artifact is microwaved.
/// </summary>
[RegisterComponent]
public sealed class ArtifactMicrowaveTriggerComponent : Component
public sealed partial class ArtifactMicrowaveTriggerComponent : Component
{
}

View File

@@ -4,7 +4,7 @@
/// Triggers when an instrument is played nearby
/// </summary>
[RegisterComponent]
public sealed class ArtifactMusicTriggerComponent : Component
public sealed partial class ArtifactMusicTriggerComponent : Component
{
/// <summary>
/// how close does the artifact have to be to the instrument to activate

View File

@@ -4,7 +4,7 @@
/// Triggers when a certain pressure threshold is hit
/// </summary>
[RegisterComponent]
public sealed class ArtifactPressureTriggerComponent : Component
public sealed partial class ArtifactPressureTriggerComponent : Component
{
/// <summary>
/// The lower-end pressure threshold

View File

@@ -5,7 +5,7 @@
/// Doesn't used for random artifacts, can be spawned by admins.
/// </summary>
[RegisterComponent]
public sealed class ArtifactTimerTriggerComponent : Component
public sealed partial class ArtifactTimerTriggerComponent : Component
{
/// <summary>
/// Time between artifact activation attempts.