Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -13,19 +13,19 @@ namespace Content.Shared.Salvage.Expeditions.Modifiers;
|
||||
public sealed class SalvageAirMod : IPrototype, IBiomeSpecificMod
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("desc")]
|
||||
public string Description { get; } = string.Empty;
|
||||
public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; } = 0f;
|
||||
public float Cost { get; private set; } = 0f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeMod>))]
|
||||
public List<string>? Biomes { get; } = null;
|
||||
public List<string>? Biomes { get; private set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Set to true if this planet will have no atmosphere.
|
||||
|
||||
@@ -12,13 +12,13 @@ public sealed class SalvageBiomeMod : IPrototype, ISalvageMod
|
||||
{
|
||||
[IdDataField] public string ID { get; } = default!;
|
||||
|
||||
[DataField("desc")] public string Description { get; } = string.Empty;
|
||||
[DataField("desc")] public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Cost for difficulty modifiers.
|
||||
/// </summary>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; } = 0f;
|
||||
public float Cost { get; private set; } = 0f;
|
||||
|
||||
/// <summary>
|
||||
/// Is weather allowed to apply to this biome.
|
||||
|
||||
@@ -10,15 +10,15 @@ public sealed class SalvageDungeonMod : IPrototype, IBiomeSpecificMod
|
||||
{
|
||||
[IdDataField] public string ID { get; } = default!;
|
||||
|
||||
[DataField("desc")] public string Description { get; } = string.Empty;
|
||||
[DataField("desc")] public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <inheridoc/>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; } = 0f;
|
||||
public float Cost { get; private set; } = 0f;
|
||||
|
||||
/// <inheridoc/>
|
||||
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeMod>))]
|
||||
public List<string>? Biomes { get; } = null;
|
||||
public List<string>? Biomes { get; private set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// The config to use for spawning the dungeon.
|
||||
|
||||
@@ -8,15 +8,15 @@ public sealed class SalvageLightMod : IPrototype, IBiomeSpecificMod
|
||||
{
|
||||
[IdDataField] public string ID { get; } = default!;
|
||||
|
||||
[DataField("desc")] public string Description { get; } = string.Empty;
|
||||
[DataField("desc")] public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; } = 0f;
|
||||
public float Cost { get; private set; } = 0f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeMod>))]
|
||||
public List<string>? Biomes { get; } = null;
|
||||
public List<string>? Biomes { get; private set; } = null;
|
||||
|
||||
[DataField("color", required: true)] public Color? Color;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ public sealed class SalvageMod : IPrototype, ISalvageMod
|
||||
{
|
||||
[IdDataField] public string ID { get; } = default!;
|
||||
|
||||
[DataField("desc")] public string Description { get; } = string.Empty;
|
||||
[DataField("desc")] public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Cost for difficulty modifiers.
|
||||
/// </summary>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; } = 0f;
|
||||
public float Cost { get; private set; } = 0f;
|
||||
}
|
||||
|
||||
@@ -9,15 +9,15 @@ public sealed class SalvageTemperatureMod : IPrototype, IBiomeSpecificMod
|
||||
{
|
||||
[IdDataField] public string ID { get; } = default!;
|
||||
|
||||
[DataField("desc")] public string Description { get; } = string.Empty;
|
||||
[DataField("desc")] public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; } = 0f;
|
||||
public float Cost { get; private set; } = 0f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeMod>))]
|
||||
public List<string>? Biomes { get; } = null;
|
||||
public List<string>? Biomes { get; private set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Temperature in the planets air mix.
|
||||
|
||||
@@ -7,13 +7,13 @@ public sealed class SalvageTimeMod : IPrototype, ISalvageMod
|
||||
{
|
||||
[IdDataField] public string ID { get; } = default!;
|
||||
|
||||
[DataField("desc")] public string Description { get; } = string.Empty;
|
||||
[DataField("desc")] public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Cost for difficulty modifiers.
|
||||
/// </summary>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; }
|
||||
public float Cost { get; private set; }
|
||||
|
||||
[DataField("minDuration")]
|
||||
public int MinDuration = 630;
|
||||
|
||||
@@ -10,15 +10,15 @@ public sealed class SalvageWeatherMod : IPrototype, IBiomeSpecificMod
|
||||
{
|
||||
[IdDataField] public string ID { get; } = default!;
|
||||
|
||||
[DataField("desc")] public string Description { get; } = string.Empty;
|
||||
[DataField("desc")] public string Description { get; private set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("cost")]
|
||||
public float Cost { get; } = 0f;
|
||||
public float Cost { get; private set; } = 0f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeMod>))]
|
||||
public List<string>? Biomes { get; } = null;
|
||||
public List<string>? Biomes { get; private set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Weather prototype to use on the planet.
|
||||
|
||||
Reference in New Issue
Block a user