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

@@ -17,27 +17,27 @@ namespace Content.Shared.Explosion;
public sealed class ExplosionPrototype : IPrototype
{
[IdDataField]
public string ID { get; } = default!;
public string ID { get; private set; } = default!;
/// <summary>
/// Damage to deal to entities. This is scaled by the explosion intensity.
/// </summary>
[DataField("damagePerIntensity", required: true)]
public readonly DamageSpecifier DamagePerIntensity = default!;
public DamageSpecifier DamagePerIntensity = default!;
/// <summary>
/// This set of points, together with <see cref="_tileBreakIntensity"/> define a function that maps the
/// explosion intensity to a tile break chance via linear interpolation.
/// </summary>
[DataField("tileBreakChance")]
private readonly float[] _tileBreakChance = { 0f, 1f };
private float[] _tileBreakChance = { 0f, 1f };
/// <summary>
/// This set of points, together with <see cref="_tileBreakChance"/> define a function that maps the
/// explosion intensity to a tile break chance via linear interpolation.
/// </summary>
[DataField("tileBreakIntensity")]
private readonly float[] _tileBreakIntensity = {0f, 15f };
private float[] _tileBreakIntensity = {0f, 15f };
/// <summary>
/// When a tile is broken by an explosion, the intensity is reduced by this amount and is used to try and
@@ -48,25 +48,25 @@ public sealed class ExplosionPrototype : IPrototype
/// chance to create a space tile.
/// </remarks>
[DataField("tileBreakRerollReduction")]
public readonly float TileBreakRerollReduction = 10f;
public float TileBreakRerollReduction = 10f;
/// <summary>
/// Color emitted by a point light at the center of the explosion.
/// </summary>
[DataField("lightColor")]
public readonly Color LightColor = Color.Orange;
public Color LightColor = Color.Orange;
/// <summary>
/// Color used to modulate the fire texture.
/// </summary>
[DataField("fireColor")]
public readonly Color? FireColor;
public Color? FireColor;
[DataField("Sound")]
public readonly SoundSpecifier Sound = new SoundCollectionSpecifier("explosion");
public SoundSpecifier Sound = new SoundCollectionSpecifier("explosion");
[DataField("texturePath")]
public readonly ResPath TexturePath = new("/Textures/Effects/fire.rsi");
public ResPath TexturePath = new("/Textures/Effects/fire.rsi");
/// <summary>
/// How intense does the explosion have to be at a tile to advance to the next fire texture state?
@@ -77,7 +77,7 @@ public sealed class ExplosionPrototype : IPrototype
// Theres probably a better way to do this. Currently Atmos just hard codes a constant int, so I have no one to
// steal code from.
[DataField("fireStates")]
public readonly int FireStates = 3;
public int FireStates = 3;
/// <summary>
/// Basic function for linear interpolation of the _tileBreakChance and _tileBreakIntensity arrays