Skip to content

Commit

Permalink
Remove Entity<T> data-fields (#34083)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored Jan 11, 2025
1 parent 6be4fba commit 1c315ba
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ public sealed partial class ReagentProducerAnomalyComponent : Component
/// <summary>
/// Solution where the substance is generated
/// </summary>
[DataField("solutionRef")]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed partial class GasCondenserComponent : Component
/// <summary>
/// The solution that gases are condensed into.
/// </summary>
[DataField]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions Content.Server/Body/Components/BloodstreamComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,22 @@ public sealed partial class BloodstreamComponent : Component
/// <summary>
/// Internal solution for blood storage
/// </summary>
[DataField]
public Entity<SolutionComponent>? BloodSolution = null;
[ViewVariables]
public Entity<SolutionComponent>? BloodSolution;

/// <summary>
/// Internal solution for reagent storage
/// </summary>
[DataField]
public Entity<SolutionComponent>? ChemicalSolution = null;
[ViewVariables]
public Entity<SolutionComponent>? ChemicalSolution;

/// <summary>
/// Temporary blood solution.
/// When blood is lost, it goes to this solution, and when this
/// solution hits a certain cap, the blood is actually spilled as a puddle.
/// </summary>
[DataField]
public Entity<SolutionComponent>? TemporarySolution = null;
[ViewVariables]
public Entity<SolutionComponent>? TemporarySolution;

/// <summary>
/// Variable that stores the amount of status time added by having a low blood level.
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Body/Components/LungComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public sealed partial class LungComponent : Component
/// <summary>
/// The solution on this entity that these lungs act on.
/// </summary>
[DataField]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Body/Components/StomachComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public sealed partial class StomachComponent : Component
/// <summary>
/// The solution inside of this stomach this transfers reagents to the body.
/// </summary>
[DataField]
public Entity<SolutionComponent>? Solution = null;
[ViewVariables]
public Entity<SolutionComponent>? Solution;

/// <summary>
/// What solution should this stomach push reagents into, on the body?
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Botany/Components/PlantHolderComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ public sealed partial class PlantHolderComponent : Component
[DataField]
public string SoilSolutionName = "soil";

[DataField]
[ViewVariables]
public Entity<SolutionComponent>? SoilSolution = null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public sealed partial class SolutionRegenerationComponent : Component
/// <summary>
/// The solution to add reagents to.
/// </summary>
[DataField]
[ViewVariables]
public Entity<SolutionComponent>? SolutionRef = null;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public sealed partial class ChemicalFuelGeneratorAdapterComponent : Component
/// <summary>
/// The solution on the <see cref="SolutionContainerManagerComponent"/> to use.
/// </summary>
[DataField("solutionRef")]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Animals/UdderComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed partial class UdderComponent : Component
/// <summary>
/// The solution to add reagent to.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadOnly)]
[ViewVariables(VVAccess.ReadOnly)]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Animals/WoolyComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed partial class WoolyComponent : Component
/// <summary>
/// The solution to add reagent to.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadOnly)]
[ViewVariables(VVAccess.ReadOnly)]
public Entity<SolutionComponent>? Solution;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Chemistry/Components/SmokeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class SmokeComponent : Component
/// <summary>
/// The solution on the entity with touch and ingestion reactions.
/// </summary>
[DataField]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public sealed partial class SolutionContainerMixerComponent : Component
[DataField, AutoNetworkedField]
public SoundSpecifier? MixingSound;

[DataField]
[ViewVariables]
public Entity<AudioComponent>? MixingSoundEntity;
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Fluids/Components/DrainComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public sealed partial class DrainComponent : Component
[ValidatePrototypeId<TagPrototype>]
public const string PlungerTag = "Plunger";

[DataField]
[ViewVariables]
public Entity<SolutionComponent>? Solution = null;

[DataField]
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Fluids/Components/PuddleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed partial class PuddleComponent : Component

[DataField("solution")] public string SolutionName = "puddle";

[DataField("solutionRef")]
[ViewVariables]
public Entity<SolutionComponent>? Solution;
}
}
6 changes: 3 additions & 3 deletions Content.Shared/Mind/MindComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public sealed partial class MindComponent : Component
/// The first entity that this mind controlled. Used for round end information.
/// Might be relevant if the player has ghosted since.
/// </summary>
[DataField, AutoNetworkedField]
public NetEntity? OriginalOwnedEntity;
// This is a net entity, because this field currently ddoes not get set to null when this entity is deleted.
[AutoNetworkedField]
public NetEntity? OriginalOwnedEntity; // TODO WeakEntityReference make this a Datafield again
// This is a net entity, because this field currently does not get set to null when this entity is deleted.
// This is a lazy way to ensure that people check that the entity still exists.
// TODO MIND Fix this properly by adding an OriginalMindContainerComponent or something like that.

Expand Down

0 comments on commit 1c315ba

Please sign in to comment.