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

@@ -8,7 +8,7 @@ namespace Content.Server.Atmos.Reactions;
/// Takes in nitrogen and frezon and cools down the surrounding area.
/// </summary>
[UsedImplicitly]
public sealed class FrezonCoolantReaction : IGasReactionEffect
public sealed partial class FrezonCoolantReaction : IGasReactionEffect
{
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
{

View File

@@ -9,7 +9,7 @@ namespace Content.Server.Atmos.Reactions;
/// Has a max temperature, but paradoxically gets more efficient the hotter it is.
/// </summary>
[UsedImplicitly]
public sealed class FrezonProductionReaction : IGasReactionEffect
public sealed partial class FrezonProductionReaction : IGasReactionEffect
{
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
{

View File

@@ -22,38 +22,38 @@ namespace Content.Server.Atmos.Reactions
{
[ViewVariables]
[IdDataField]
public string ID { get; } = default!;
public string ID { get; private set; } = default!;
/// <summary>
/// Minimum gas amount requirements.
/// </summary>
[DataField("minimumRequirements")]
public float[] MinimumRequirements { get; } = new float[Atmospherics.TotalNumberOfGases];
public float[] MinimumRequirements { get; private set; } = new float[Atmospherics.TotalNumberOfGases];
/// <summary>
/// Maximum temperature requirement.
/// </summary>
[DataField("maximumTemperature")]
public float MaximumTemperatureRequirement { get; } = float.MaxValue;
public float MaximumTemperatureRequirement { get; private set; } = float.MaxValue;
/// <summary>
/// Minimum temperature requirement.
/// </summary>
[DataField("minimumTemperature")]
public float MinimumTemperatureRequirement { get; } = Atmospherics.TCMB;
public float MinimumTemperatureRequirement { get; private set; } = Atmospherics.TCMB;
/// <summary>
/// Minimum energy requirement.
/// </summary>
[DataField("minimumEnergy")]
public float MinimumEnergyRequirement { get; } = 0f;
public float MinimumEnergyRequirement { get; private set; } = 0f;
/// <summary>
/// Lower numbers are checked/react later than higher numbers.
/// If two reactions have the same priority, they may happen in either order.
/// </summary>
[DataField("priority")]
public int Priority { get; } = int.MinValue;
public int Priority { get; private set; } = int.MinValue;
/// <summary>
/// A list of effects this will produce.

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Atmos.Reactions;
/// Converts frezon into miasma when the two come into contact. Does not occur at very high temperatures.
/// </summary>
[UsedImplicitly]
public sealed class MiasmicSubsumationReaction : IGasReactionEffect
public sealed partial class MiasmicSubsumationReaction : IGasReactionEffect
{
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
{

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Atmos.Reactions
{
[UsedImplicitly]
[DataDefinition]
public sealed class PlasmaFireReaction : IGasReactionEffect
public sealed partial class PlasmaFireReaction : IGasReactionEffect
{
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
{

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Atmos.Reactions
{
[UsedImplicitly]
[DataDefinition]
public sealed class TritiumFireReaction : IGasReactionEffect
public sealed partial class TritiumFireReaction : IGasReactionEffect
{
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
{

View File

@@ -9,13 +9,13 @@ namespace Content.Server.Atmos.Reactions
{
[UsedImplicitly]
[DataDefinition]
public sealed class WaterVaporReaction : IGasReactionEffect
public sealed partial class WaterVaporReaction : IGasReactionEffect
{
[DataField("reagent")] public string? Reagent { get; } = null;
[DataField("reagent")] public string? Reagent { get; private set; } = null;
[DataField("gas")] public int GasId { get; } = 0;
[DataField("gas")] public int GasId { get; private set; } = 0;
[DataField("molesPerUnit")] public float MolesPerUnit { get; } = 1;
[DataField("molesPerUnit")] public float MolesPerUnit { get; private set; } = 1;
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
{