Refactor serialization copying to use source generators (#19412)
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Content.Server.Worldgen.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(BiomeSelectionSystem))]
|
||||
public sealed class BiomeSelectionComponent : Component
|
||||
public sealed partial class BiomeSelectionComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The list of biomes available to this selector.
|
||||
|
||||
@@ -10,19 +10,19 @@ namespace Content.Server.Worldgen.Components.Carvers;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(NoiseRangeCarverSystem))]
|
||||
public sealed class NoiseRangeCarverComponent : Component
|
||||
public sealed partial class NoiseRangeCarverComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The noise channel to use as a density controller.
|
||||
/// </summary>
|
||||
/// <remarks>This noise channel should be mapped to exactly the range [0, 1] unless you want a lot of warnings in the log.</remarks>
|
||||
[DataField("noiseChannel", customTypeSerializer: typeof(PrototypeIdSerializer<NoiseChannelPrototype>))]
|
||||
public string NoiseChannel { get; } = default!;
|
||||
public string NoiseChannel { get; private set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The index of ranges in which to cut debris generation.
|
||||
/// </summary>
|
||||
[DataField("ranges", required: true)]
|
||||
public List<Vector2> Ranges { get; } = default!;
|
||||
public List<Vector2> Ranges { get; private set; } = default!;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Worldgen.Components.Debris;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(BlobFloorPlanBuilderSystem))]
|
||||
public sealed class BlobFloorPlanBuilderComponent : Component
|
||||
public sealed partial class BlobFloorPlanBuilderComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The probability that placing a floor tile will add up to three-four neighboring tiles as well.
|
||||
@@ -26,12 +26,12 @@ public sealed class BlobFloorPlanBuilderComponent : Component
|
||||
/// </summary>
|
||||
[DataField("floorTileset", required: true,
|
||||
customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
|
||||
public List<string> FloorTileset { get; } = default!;
|
||||
public List<string> FloorTileset { get; private set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The number of floor tiles to place when drawing the asteroid layout.
|
||||
/// </summary>
|
||||
[DataField("floorPlacements", required: true)]
|
||||
public int FloorPlacements { get; }
|
||||
public int FloorPlacements { get; private set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Worldgen.Components.Debris;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(DebrisFeaturePlacerSystem))]
|
||||
public sealed class DebrisFeaturePlacerControllerComponent : Component
|
||||
public sealed partial class DebrisFeaturePlacerControllerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether or not to clip debris that would spawn at a location that has a density of zero.
|
||||
@@ -38,6 +38,6 @@ public sealed class DebrisFeaturePlacerControllerComponent : Component
|
||||
/// The noise channel to use as a density controller.
|
||||
/// </summary>
|
||||
[DataField("densityNoiseChannel", customTypeSerializer: typeof(PrototypeIdSerializer<NoiseChannelPrototype>))]
|
||||
public string DensityNoiseChannel { get; } = default!;
|
||||
public string DensityNoiseChannel { get; private set; } = default!;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Worldgen.Components.Debris;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(NoiseDrivenDebrisSelectorSystem))]
|
||||
public sealed class NoiseDrivenDebrisSelectorComponent : Component
|
||||
public sealed partial class NoiseDrivenDebrisSelectorComponent : Component
|
||||
{
|
||||
private EntitySpawnCollectionCache? _cache;
|
||||
|
||||
@@ -39,6 +39,6 @@ public sealed class NoiseDrivenDebrisSelectorComponent : Component
|
||||
/// </summary>
|
||||
/// <remarks>This noise channel should be mapped to exactly the range [0, 1] unless you want a lot of warnings in the log.</remarks>
|
||||
[DataField("noiseChannel", customTypeSerializer: typeof(PrototypeIdSerializer<NoiseChannelPrototype>))]
|
||||
public string NoiseChannel { get; } = default!;
|
||||
public string NoiseChannel { get; private set; } = default!;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Worldgen.Components.Debris;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(DebrisFeaturePlacerSystem))]
|
||||
public sealed class OwnedDebrisComponent : Component
|
||||
public sealed partial class OwnedDebrisComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The last location in the controller's internal structure for this debris.
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Worldgen.Components.Debris;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(DebrisFeaturePlacerSystem))]
|
||||
public sealed class SimpleDebrisSelectorComponent : Component
|
||||
public sealed partial class SimpleDebrisSelectorComponent : Component
|
||||
{
|
||||
private EntitySpawnCollectionCache? _cache;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Worldgen.Components.Debris;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(SimpleFloorPlanPopulatorSystem))]
|
||||
public sealed class SimpleFloorPlanPopulatorComponent : Component
|
||||
public sealed partial class SimpleFloorPlanPopulatorComponent : Component
|
||||
{
|
||||
private Dictionary<string, EntitySpawnCollectionCache>? _caches;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Worldgen.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(WorldControllerSystem))]
|
||||
public sealed class LoadedChunkComponent : Component
|
||||
public sealed partial class LoadedChunkComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The current list of entities loading this chunk.
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Worldgen.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(LocalityLoaderSystem))]
|
||||
public sealed class LocalityLoaderComponent : Component
|
||||
public sealed partial class LocalityLoaderComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The maximum distance an entity can be from the loader for it to not load.
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Worldgen.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(NoiseIndexSystem))]
|
||||
public sealed class NoiseIndexComponent : Component
|
||||
public sealed partial class NoiseIndexComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// An index of generators, to avoid having to recreate them every time a noise channel is used.
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Worldgen.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(WorldControllerSystem))]
|
||||
public sealed class WorldChunkComponent : Component
|
||||
public sealed partial class WorldChunkComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The coordinates of the chunk, in chunk space.
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Worldgen.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(WorldControllerSystem))]
|
||||
public sealed class WorldControllerComponent : Component
|
||||
public sealed partial class WorldControllerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The prototype to use for chunks on this world map.
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Worldgen.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(WorldControllerSystem))]
|
||||
public sealed class WorldLoaderComponent : Component
|
||||
public sealed partial class WorldLoaderComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The radius in which the loader loads the world.
|
||||
|
||||
Reference in New Issue
Block a user