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

@@ -7,6 +7,6 @@ namespace Content.Server.Nutrition.Components;
/// Including but not limited to: puddles
/// </summary>
[RegisterComponent, Access(typeof(DrinkSystem))]
public sealed class BadDrinkComponent : Component
public sealed partial class BadDrinkComponent : Component
{
}

View File

@@ -7,6 +7,6 @@ namespace Content.Server.Nutrition.Components;
/// Including but not limited to: uranium, death pills, insulation
/// </summary>
[RegisterComponent, Access(typeof(FoodSystem))]
public sealed class BadFoodComponent : Component
public sealed partial class BadFoodComponent : Component
{
}

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Nutrition.Components
/// A disposable, single-use smokable.
/// </summary>
[RegisterComponent, Access(typeof(SmokingSystem))]
public sealed class CigarComponent : Component
public sealed partial class CigarComponent : Component
{
}
}

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Nutrition.Components
{
[RegisterComponent]
[Access(typeof(DrinkSystem))]
public sealed class DrinkComponent : Component
public sealed partial class DrinkComponent : Component
{
[DataField("solution")]
public string SolutionName { get; set; } = DefaultSolutionName;

View File

@@ -12,7 +12,7 @@ namespace Content.Server.Nutrition.Components;
/// This is used for a machine that extracts hunger from entities and creates meat. Yum!
/// </summary>
[RegisterComponent, Access(typeof(FatExtractorSystem))]
public sealed class FatExtractorComponent : Component
public sealed partial class FatExtractorComponent : Component
{
/// <summary>
/// Whether or not the extractor is currently extracting fat from someone

View File

@@ -1,19 +1,19 @@
namespace Content.Server.Nutrition.Components;
[RegisterComponent]
public sealed class FlavorProfileComponent : Component
public sealed partial class FlavorProfileComponent : Component
{
/// <summary>
/// Localized string containing the base flavor of this entity.
/// </summary>
[DataField("flavors")]
public HashSet<string> Flavors { get; } = new();
public HashSet<string> Flavors { get; private set; } = new();
/// <summary>
/// Reagent IDs to ignore when processing this flavor profile. Defaults to nutriment.
/// </summary>
[DataField("ignoreReagents")]
public HashSet<string> IgnoreReagents { get; } = new()
public HashSet<string> IgnoreReagents { get; private set; } = new()
{
"Nutriment",
"Vitamin",

View File

@@ -9,7 +9,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Nutrition.Components
{
[RegisterComponent, Access(typeof(FoodSystem))]
public sealed class FoodComponent : Component
public sealed partial class FoodComponent : Component
{
[DataField("solution")]
public string SolutionName { get; set; } = "food";
@@ -39,7 +39,7 @@ namespace Content.Server.Nutrition.Components
/// If this is set to true, food can only be eaten if you have a stomach with a
/// <see cref="StomachComponent.SpecialDigestible"/> that includes this entity in its whitelist,
/// rather than just being digestible by anything that can eat food.
/// Whitelist the food component to allow eating of normal food.
/// Whitelist the food component to allow eating of normal food.
/// </summary>
[DataField("requiresSpecialDigestion")]
public bool RequiresSpecialDigestion = false;

View File

@@ -7,6 +7,6 @@ namespace Content.Server.Nutrition.Components;
/// See MobMouseAdmeme for usage.
/// </summary>
[RegisterComponent, Access(typeof(FoodSystem))]
public sealed class IgnoreBadFoodComponent : Component
public sealed partial class IgnoreBadFoodComponent : Component
{
}

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Nutrition.EntitySystems;
/// masks), then this component might become redundant.
/// </remarks>
[RegisterComponent, Access(typeof(FoodSystem), typeof(DrinkSystem), typeof(MaskSystem))]
public sealed class IngestionBlockerComponent : Component
public sealed partial class IngestionBlockerComponent : Component
{
/// <summary>
/// Is this component currently blocking consumption.

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Audio;
namespace Content.Server.Nutrition.Components
{
[RegisterComponent, Access(typeof(SliceableFoodSystem))]
internal sealed class SliceableFoodComponent : Component
internal sealed partial class SliceableFoodComponent : Component
{
[DataField("slice")]
[ViewVariables(VVAccess.ReadWrite)]

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Nutrition.Components
/// A reusable vessel for smoking
/// </summary>
[RegisterComponent, Access(typeof(SmokingSystem))]
public sealed class SmokingPipeComponent : Component
public sealed partial class SmokingPipeComponent : Component
{
public const string BowlSlotId = "bowl_slot";

View File

@@ -14,7 +14,7 @@ namespace Content.Server.Nutrition.Components
}
[RegisterComponent]
public sealed class ThirstComponent : Component
public sealed partial class ThirstComponent : Component
{
// Base stuff
[ViewVariables(VVAccess.ReadWrite)]
@@ -35,7 +35,7 @@ namespace Content.Server.Nutrition.Components
public float CurrentThirst = -1f;
[DataField("thresholds")]
public Dictionary<ThirstThreshold, float> ThirstThresholds { get; } = new()
public Dictionary<ThirstThreshold, float> ThirstThresholds { get; private set; } = new()
{
{ThirstThreshold.OverHydrated, 600.0f},
{ThirstThreshold.Okay, 450.0f},

View File

@@ -5,7 +5,7 @@ namespace Content.Server.Nutrition.Components
/// Used for things like used ketchup packets or used syringes.
/// </summary>
[RegisterComponent]
public sealed class TrashOnEmptyComponent : Component
public sealed partial class TrashOnEmptyComponent : Component
{
/// <summary>
/// The name of the solution of which to check emptiness

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Audio;
namespace Content.Server.Nutrition.Components
{
[RegisterComponent, Access(typeof(UtensilSystem))]
public sealed class UtensilComponent : Component
public sealed partial class UtensilComponent : Component
{
[DataField("types")]
private UtensilType _types = UtensilType.None;

View File

@@ -8,8 +8,8 @@ using Content.Shared.Atmos;
/// </summary>
namespace Content.Server.Nutrition.Components
{
[RegisterComponent, Access(typeof(SmokingSystem))]
public sealed class VapeComponent : Component
[RegisterComponent, Access(typeof(SmokingSystem))]
public sealed partial class VapeComponent : Component
{
[DataField("delay")]
[ViewVariables(VVAccess.ReadWrite)]
@@ -48,4 +48,4 @@ namespace Content.Server.Nutrition.Components
public CancellationTokenSource? CancelToken;
}
}
}