Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
namespace Content.Server.Atmos.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class AirtightComponent : Component
|
||||
public sealed partial class AirtightComponent : Component
|
||||
{
|
||||
public (EntityUid Grid, Vector2i Tile) LastPosition { get; set; }
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/// Represents that entity can be exposed to Atmos
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class AtmosExposedComponent : Component
|
||||
public sealed partial class AtmosExposedComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Content.Server.Atmos.Components
|
||||
/// Used by FixGridAtmos. Entities with this may get magically auto-deleted on map initialization in future.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class AtmosFixMarkerComponent : Component
|
||||
public sealed partial class AtmosFixMarkerComponent : Component
|
||||
{
|
||||
// See FixGridAtmos for more details
|
||||
[DataField("mode")]
|
||||
|
||||
@@ -3,7 +3,7 @@ using Content.Server.Atmos.EntitySystems;
|
||||
namespace Content.Server.Atmos.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class AtmosPlaqueComponent : Component
|
||||
public sealed partial class AtmosPlaqueComponent : Component
|
||||
{
|
||||
[DataField("plaqueType")] public PlaqueType Type = PlaqueType.Unset;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Atmos.Components
|
||||
/// Barotrauma: injury because of changes in air pressure.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class BarotraumaComponent : Component
|
||||
public sealed partial class BarotraumaComponent : Component
|
||||
{
|
||||
[DataField("damage", required: true)]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Atmos.Components
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[ComponentProtoName("BreathMask")]
|
||||
public sealed class BreathToolComponent : Component
|
||||
public sealed partial class BreathToolComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Tool is functional only in allowed slots
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Physics.Collision.Shapes;
|
||||
namespace Content.Server.Atmos.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class FlammableComponent : Component
|
||||
public sealed partial class FlammableComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public bool Resisting = false;
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Content.Server.Atmos.Components;
|
||||
/// Used to keep track of which analyzers are active for update purposes
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ActiveGasAnalyzerComponent : Component
|
||||
public sealed partial class ActiveGasAnalyzerComponent : Component
|
||||
{
|
||||
// Set to a tiny bit after the default because otherwise the user often gets a blank window when first using
|
||||
[DataField("accumulatedFrameTime"), ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Atmos.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class GasMixtureHolderComponent : Component, IGasMixtureHolder
|
||||
public sealed partial class GasMixtureHolderComponent : Component, IGasMixtureHolder
|
||||
{
|
||||
[DataField("air")] public GasMixture Air { get; set; } = new GasMixture();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Audio;
|
||||
namespace Content.Server.Atmos.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class GasTankComponent : Component, IGasMixtureHolder
|
||||
public sealed partial class GasTankComponent : Component, IGasMixtureHolder
|
||||
{
|
||||
public const float MaxExplosionRange = 80f;
|
||||
private const float DefaultLowPressure = 0f;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Atmos.Components
|
||||
/// </summary>
|
||||
[RegisterComponent, Serializable,
|
||||
Access(typeof(AtmosphereSystem), typeof(GasTileOverlaySystem), typeof(AtmosDebugOverlaySystem))]
|
||||
public sealed class GridAtmosphereComponent : Component
|
||||
public sealed partial class GridAtmosphereComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool Simulated { get; set; } = true;
|
||||
@@ -26,7 +26,7 @@ namespace Content.Server.Atmos.Components
|
||||
|
||||
[ViewVariables]
|
||||
[IncludeDataField(customTypeSerializer:typeof(TileAtmosCollectionSerializer))]
|
||||
public readonly Dictionary<Vector2i, TileAtmosphere> Tiles = new(1000);
|
||||
public Dictionary<Vector2i, TileAtmosphere> Tiles = new(1000);
|
||||
|
||||
[ViewVariables]
|
||||
public readonly HashSet<TileAtmosphere> ActiveTiles = new(1000);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class HeatExchangerComponent : Component
|
||||
public sealed partial class HeatExchangerComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("inlet")]
|
||||
|
||||
@@ -3,7 +3,7 @@ using Content.Server.Atmos.EntitySystems;
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
[RegisterComponent, Access(typeof(FlammableSystem))]
|
||||
public sealed class IgniteOnCollideComponent : Component
|
||||
public sealed partial class IgniteOnCollideComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// How many more times the ignition can be applied.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class IgniteOnMeleeHitComponent : Component
|
||||
public sealed partial class IgniteOnMeleeHitComponent : Component
|
||||
{
|
||||
[DataField("fireStacks")]
|
||||
public float FireStacks { get; set; }
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Atmos.Components;
|
||||
/// Component that defines the default GasMixture for a map.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(SharedAtmosphereSystem))]
|
||||
public sealed class MapAtmosphereComponent : SharedMapAtmosphereComponent
|
||||
public sealed partial class MapAtmosphereComponent : SharedMapAtmosphereComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// The default GasMixture a map will have. Space mixture by default.
|
||||
|
||||
@@ -2,7 +2,7 @@ namespace Content.Server.Atmos.Components
|
||||
{
|
||||
// Unfortunately can't be friends yet due to magboots.
|
||||
[RegisterComponent]
|
||||
public sealed class MovedByPressureComponent : Component
|
||||
public sealed partial class MovedByPressureComponent : Component
|
||||
{
|
||||
public const float MoveForcePushRatio = 1f;
|
||||
public const float MoveForceForcePushRatio = 1f;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class PressureImmunityComponent : Component
|
||||
public sealed partial class PressureImmunityComponent : Component
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
namespace Content.Server.Atmos.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class PressureProtectionComponent : Component
|
||||
public sealed partial class PressureProtectionComponent : Component
|
||||
{
|
||||
[DataField("highPressureMultiplier")]
|
||||
public float HighPressureMultiplier { get; } = 1f;
|
||||
public float HighPressureMultiplier { get; private set; } = 1f;
|
||||
|
||||
[DataField("highPressureModifier")]
|
||||
public float HighPressureModifier { get; } = 0f;
|
||||
public float HighPressureModifier { get; private set; } = 0f;
|
||||
|
||||
[DataField("lowPressureMultiplier")]
|
||||
public float LowPressureMultiplier { get; } = 1f;
|
||||
public float LowPressureMultiplier { get; private set; } = 1f;
|
||||
|
||||
[DataField("lowPressureModifier")]
|
||||
public float LowPressureModifier { get; } = 0f;
|
||||
public float LowPressureModifier { get; private set; } = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class TemperatureProtectionComponent : Component
|
||||
public sealed partial class TemperatureProtectionComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// How much to multiply temperature deltas by.
|
||||
|
||||
Reference in New Issue
Block a user