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

@@ -11,7 +11,7 @@ using Robust.Shared.Reflection;
namespace Content.Benchmarks
{
[Virtual]
public class EntityManagerGetAllComponents
public partial class EntityManagerGetAllComponents
{
private IEntityManager _entityManager;
@@ -87,7 +87,7 @@ namespace Content.Benchmarks
return count;
}
private sealed class DummyComponent : Component
private sealed partial class DummyComponent : Component
{
}
}

View File

@@ -4,7 +4,7 @@ using Robust.Shared.GameStates;
namespace Content.Client.Administration.Components;
[RegisterComponent, NetworkedComponent]
public sealed class HeadstandComponent : SharedHeadstandComponent
public sealed partial class HeadstandComponent : SharedHeadstandComponent
{
}

View File

@@ -4,5 +4,5 @@ using Robust.Shared.GameStates;
namespace Content.Client.Administration.Components;
[NetworkedComponent, RegisterComponent]
public sealed class KillSignComponent : SharedKillSignComponent
public sealed partial class KillSignComponent : SharedKillSignComponent
{ }

View File

@@ -5,7 +5,7 @@ namespace Content.Client.Atmos.Components;
/// accumulated.
/// </summary>
[RegisterComponent]
public sealed class FireVisualsComponent : Component
public sealed partial class FireVisualsComponent : Component
{
[DataField("fireStackAlternateState")]
public int FireStackAlternateState = 3;

View File

@@ -3,7 +3,7 @@ using Content.Shared.Atmos.Components;
namespace Content.Client.Atmos.Components;
[RegisterComponent]
public sealed class MapAtmosphereComponent : SharedMapAtmosphereComponent
public sealed partial class MapAtmosphereComponent : SharedMapAtmosphereComponent
{
}

View File

@@ -3,6 +3,6 @@ using Robust.Shared.GameObjects;
namespace Content.Client.Atmos.Components;
[RegisterComponent]
public sealed class PipeColorVisualsComponent : Component
public sealed partial class PipeColorVisualsComponent : Component
{
}

View File

@@ -3,18 +3,18 @@ using Content.Shared.Atmos.Monitor;
namespace Content.Client.Atmos.Monitor;
[RegisterComponent]
public sealed class AtmosAlarmableVisualsComponent : Component
public sealed partial class AtmosAlarmableVisualsComponent : Component
{
[DataField("layerMap")]
public string LayerMap { get; } = string.Empty;
public string LayerMap { get; private set; } = string.Empty;
[DataField("alarmStates")]
public readonly Dictionary<AtmosAlarmType, string> AlarmStates = new();
public Dictionary<AtmosAlarmType, string> AlarmStates = new();
[DataField("hideOnDepowered")]
public readonly List<string>? HideOnDepowered;
public List<string>? HideOnDepowered;
// eh...
[DataField("setOnDepowered")]
public readonly Dictionary<string, string>? SetOnDepowered;
public Dictionary<string, string>? SetOnDepowered;
}

View File

@@ -5,7 +5,7 @@ namespace Content.Client.Atmos.Visualizers;
/// the ready / full pair controls the color of the light.
/// </summary>
[RegisterComponent]
public sealed class PortableScrubberVisualsComponent : Component
public sealed partial class PortableScrubberVisualsComponent : Component
{
[DataField("idleState", required: true)]
public string IdleState = default!;

View File

@@ -8,7 +8,7 @@ namespace Content.Client.Audio;
/// Samples nearby <see cref="AmbientSoundComponent"/> and plays audio.
/// </summary>
[RegisterComponent]
public sealed class AmbientSoundTreeComponent : Component, IComponentTreeComponent<AmbientSoundComponent>
public sealed partial class AmbientSoundTreeComponent : Component, IComponentTreeComponent<AmbientSoundComponent>
{
public DynamicTree<ComponentTreeEntry<AmbientSoundComponent>> Tree { get; set; } = default!;
}

View File

@@ -2,7 +2,7 @@
namespace Content.Client.Beam.Components;
[RegisterComponent]
public sealed class BeamComponent : SharedBeamComponent
public sealed partial class BeamComponent : SharedBeamComponent
{
}

View File

@@ -1,5 +1,5 @@
namespace Content.Client.Bed;
[RegisterComponent]
public sealed class StasisBedVisualsComponent : Component
public sealed partial class StasisBedVisualsComponent : Component
{}

View File

@@ -1,6 +1,6 @@
namespace Content.Client.Botany.Components;
[RegisterComponent]
public sealed class PlantHolderVisualsComponent : Component
public sealed partial class PlantHolderVisualsComponent : Component
{
}

View File

@@ -1,7 +1,7 @@
namespace Content.Client.Botany.Components;
[RegisterComponent]
public sealed class PotencyVisualsComponent : Component
public sealed partial class PotencyVisualsComponent : Component
{
[DataField("minimumScale")]
public float MinimumScale = 1f;

View File

@@ -5,7 +5,7 @@ using Robust.Client.UserInterface;
namespace Content.Client.CartridgeLoader.Cartridges;
public sealed class CrewManifestUi : UIFragment
public sealed partial class CrewManifestUi : UIFragment
{
private CrewManifestUiFragment? _fragment;

View File

@@ -5,7 +5,7 @@ using Robust.Client.UserInterface;
namespace Content.Client.CartridgeLoader.Cartridges;
public sealed class NetProbeUi : UIFragment
public sealed partial class NetProbeUi : UIFragment
{
private NetProbeUiFragment? _fragment;

View File

@@ -6,7 +6,7 @@ using Robust.Client.UserInterface;
namespace Content.Client.CartridgeLoader.Cartridges;
public sealed class NewsReadUi : UIFragment
public sealed partial class NewsReadUi : UIFragment
{
private NewsReadUiFragment? _fragment;

View File

@@ -6,7 +6,7 @@ using Robust.Client.UserInterface;
namespace Content.Client.CartridgeLoader.Cartridges;
public sealed class NotekeeperUi : UIFragment
public sealed partial class NotekeeperUi : UIFragment
{
private NotekeeperUiFragment? _fragment;

View File

@@ -18,7 +18,7 @@ using Robust.Shared.Utility;
namespace Content.Client.Changelog
{
public sealed class ChangelogManager
public sealed partial class ChangelogManager
{
[Dependency] private readonly IResourceManager _resource = default!;
[Dependency] private readonly ISerializationManager _serialization = default!;
@@ -86,20 +86,20 @@ namespace Content.Client.Changelog
}
[DataDefinition]
public sealed class ChangelogEntry : ISerializationHooks
public sealed partial class ChangelogEntry : ISerializationHooks
{
[DataField("id")]
public int Id { get; private set; }
[DataField("author")]
public string Author { get; } = "";
public string Author { get; private set; } = "";
[DataField("time")] private string _time = default!;
public DateTime Time { get; private set; }
[DataField("changes")]
public List<ChangelogChange> Changes { get; } = default!;
public List<ChangelogChange> Changes { get; private set; } = default!;
void ISerializationHooks.AfterDeserialization()
{
@@ -108,7 +108,7 @@ namespace Content.Client.Changelog
}
[DataDefinition]
public sealed class ChangelogChange : ISerializationHooks
public sealed partial class ChangelogChange : ISerializationHooks
{
[DataField("type")]
public ChangelogLineType Type { get; private set; }

View File

@@ -4,7 +4,7 @@ using Content.Shared.FixedPoint;
namespace Content.Client.Chemistry.Components
{
[RegisterComponent]
public sealed class HyposprayComponent : SharedHyposprayComponent
public sealed partial class HyposprayComponent : SharedHyposprayComponent
{
[ViewVariables]
public FixedPoint2 CurrentVolume;

View File

@@ -17,7 +17,7 @@ namespace Content.Client.Chemistry.Components
/// Client behavior for injectors & syringes. Used for item status on injectors
/// </summary>
[RegisterComponent]
public sealed class InjectorComponent : SharedInjectorComponent
public sealed partial class InjectorComponent : SharedInjectorComponent
{
[ViewVariables]
public FixedPoint2 CurrentVolume;

View File

@@ -8,7 +8,7 @@ namespace Content.Client.Chemistry.Visualizers;
/// </summary>
[RegisterComponent]
[Access(typeof(FoamVisualizerSystem))]
public sealed class FoamVisualsComponent : Component
public sealed partial class FoamVisualsComponent : Component
{
/// <summary>
/// The id of the animation used when the foam dissolves.

View File

@@ -7,4 +7,4 @@ namespace Content.Client.Chemistry.Visualizers;
/// </summary>
[RegisterComponent]
[Access(typeof(SmokeVisualizerSystem))]
public sealed class SmokeVisualsComponent : Component {}
public sealed partial class SmokeVisualsComponent : Component {}

View File

@@ -11,7 +11,7 @@ using Robust.Shared.Utility;
namespace Content.Client.Chemistry.Visualizers
{
[RegisterComponent]
public sealed class SolutionContainerVisualsComponent : Component
public sealed partial class SolutionContainerVisualsComponent : Component
{
[DataField("maxFillLevels")]
public int MaxFillLevels = 0;

View File

@@ -7,7 +7,7 @@ namespace Content.Client.Chemistry.Visualizers;
/// </summary>
[RegisterComponent]
[Access(typeof(VaporVisualizerSystem))]
public sealed class VaporVisualsComponent : Component
public sealed partial class VaporVisualsComponent : Component
{
/// <summary>
/// The id of the animation played when the vapor spawns in.

View File

@@ -7,7 +7,7 @@ using static Robust.Client.GameObjects.SpriteComponent;
namespace Content.Client.Clickable
{
[RegisterComponent]
public sealed class ClickableComponent : Component
public sealed partial class ClickableComponent : Component
{
[Dependency] private readonly IClickMapManager _clickMapManager = default!;
@@ -131,7 +131,7 @@ namespace Content.Client.Clickable
}
[DataDefinition]
public sealed class DirBoundData
public sealed partial class DirBoundData
{
[DataField("all")] public Box2 All;
[DataField("north")] public Box2 North;

View File

@@ -5,7 +5,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.Construction
{
[RegisterComponent]
public sealed class ConstructionGhostComponent : Component
public sealed partial class ConstructionGhostComponent : Component
{
[ViewVariables] public ConstructionPrototype? Prototype { get; set; }
[ViewVariables] public int GhostId { get; set; }

View File

@@ -5,7 +5,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.Crayon
{
[RegisterComponent]
public sealed class CrayonComponent : SharedCrayonComponent
public sealed partial class CrayonComponent : SharedCrayonComponent
{
[ViewVariables(VVAccess.ReadWrite)] public bool UIUpdateNeeded;
[ViewVariables] public int Charges { get; set; }

View File

@@ -3,7 +3,7 @@ using Content.Shared.FixedPoint;
namespace Content.Client.Damage;
[RegisterComponent]
public sealed class DamageVisualsComponent : Component
public sealed partial class DamageVisualsComponent : Component
{
/// <summary>
/// Damage thresholds between damage state changes.
@@ -55,7 +55,7 @@ public sealed class DamageVisualsComponent : Component
/// (for example, Brute), and has a value
/// of a DamageVisualizerSprite (see below)
/// </summary>
[DataField("damageOverlayGroups")] public readonly Dictionary<string, DamageVisualizerSprite>? DamageOverlayGroups;
[DataField("damageOverlayGroups")] public Dictionary<string, DamageVisualizerSprite>? DamageOverlayGroups;
/// <summary>
/// Sets if you want sprites to overlay the
@@ -68,7 +68,7 @@ public sealed class DamageVisualsComponent : Component
/// - There are no target layers
/// - There is no damage group
/// </summary>
[DataField("overlay")] public readonly bool Overlay = true;
[DataField("overlay")] public bool Overlay = true;
/// <summary>
/// A single damage group to target.
@@ -84,7 +84,7 @@ public sealed class DamageVisualsComponent : Component
/// what kind of damage combination
/// you would want, on which threshold.
/// </remarks>
[DataField("damageGroup")] public readonly string? DamageGroup;
[DataField("damageGroup")] public string? DamageGroup;
/// <summary>
/// Set this if you want incoming damage to be
@@ -106,14 +106,14 @@ public sealed class DamageVisualsComponent : Component
/// This will only work if you have damageOverlay
/// defined - otherwise, it will not work.
/// </remarks>
[DataField("trackAllDamage")] public readonly bool TrackAllDamage;
[DataField("trackAllDamage")] public bool TrackAllDamage;
/// <summary>
/// This is the overlay sprite used, if _trackAllDamage is
/// enabled. Supports no complex per-group layering,
/// just an actually simple damage overlay. See
/// DamageVisualizerSprite for more information.
/// </summary>
[DataField("damageOverlay")] public readonly DamageVisualizerSprite? DamageOverlay;
[DataField("damageOverlay")] public DamageVisualizerSprite? DamageOverlay;
public readonly List<Enum> TargetLayerMapKeys = new();
public bool Disabled = false;
@@ -128,7 +128,7 @@ public sealed class DamageVisualsComponent : Component
// deals with the edge case of human damage visuals not
// being in color without making a Dict<Dict<Dict<Dict<Dict<Dict...
[DataDefinition]
public sealed class DamageVisualizerSprite
public sealed partial class DamageVisualizerSprite
{
/// <summary>
/// The RSI path for the damage visualizer
@@ -151,11 +151,11 @@ public sealed class DamageVisualizerSprite
/// - DamageOverlay_{threshold} if not targeting
/// a layer.
/// </remarks>
[DataField("sprite", required: true)] public readonly string Sprite = default!;
[DataField("sprite", required: true)] public string Sprite = default!;
/// <summary>
/// The color of this sprite overlay.
/// Supports only hexadecimal format.
/// </summary>
[DataField("color")] public readonly string? Color;
[DataField("color")] public string? Color;
}

View File

@@ -3,7 +3,7 @@ using Content.Shared.Mobs;
namespace Content.Client.DamageState;
[RegisterComponent]
public sealed class DamageStateVisualsComponent : Component
public sealed partial class DamageStateVisualsComponent : Component
{
public int? OriginalDrawDepth;

View File

@@ -195,7 +195,7 @@ public sealed class DecalPlacementSystem : EntitySystem
}
}
public sealed class PlaceDecalActionEvent : WorldTargetActionEvent
public sealed partial class PlaceDecalActionEvent : WorldTargetActionEvent
{
[DataField("decalId", customTypeSerializer:typeof(PrototypeIdSerializer<DecalPrototype>), required:true)]
public string DecalId = string.Empty;

View File

@@ -4,7 +4,7 @@ namespace Content.Client.Disposal;
[RegisterComponent]
[ComponentReference(typeof(SharedDisposalUnitComponent))]
public sealed class DisposalUnitComponent : SharedDisposalUnitComponent
public sealed partial class DisposalUnitComponent : SharedDisposalUnitComponent
{
}

View File

@@ -3,7 +3,7 @@ using Content.Shared.Dragon;
namespace Content.Client.Dragon;
[RegisterComponent]
public sealed class DragonRiftComponent : SharedDragonRiftComponent
public sealed partial class DragonRiftComponent : SharedDragonRiftComponent
{
}

View File

@@ -4,4 +4,4 @@ namespace Content.Client.Effects;
/// Deletes the attached entity whenever any animation completes. Used for temporary client-side entities.
/// </summary>
[RegisterComponent]
public sealed class EffectVisualsComponent : Component {}
public sealed partial class EffectVisualsComponent : Component {}

View File

@@ -2,7 +2,7 @@ namespace Content.Client.Explosion;
[RegisterComponent]
[Access(typeof(ClusterGrenadeVisualizerSystem))]
public sealed class ClusterGrenadeVisualsComponent : Component
public sealed partial class ClusterGrenadeVisualsComponent : Component
{
[DataField("state")]
public string? State;

View File

@@ -3,7 +3,7 @@ using Robust.Client.Graphics;
namespace Content.Client.Explosion;
[RegisterComponent]
public sealed class ExplosionVisualsTexturesComponent : Component
public sealed partial class ExplosionVisualsTexturesComponent : Component
{
/// <summary>
/// Uid of the client-side point light entity for this explosion.

View File

@@ -3,4 +3,4 @@ using Content.Shared.Explosion;
namespace Content.Client.Explosion;
[RegisterComponent, Access(typeof(TriggerSystem))]
public sealed class TriggerOnProximityComponent : SharedTriggerOnProximityComponent {}
public sealed partial class TriggerOnProximityComponent : SharedTriggerOnProximityComponent {}

View File

@@ -4,6 +4,6 @@ using Robust.Shared.GameStates;
namespace Content.Client.Extinguisher;
[NetworkedComponent, RegisterComponent]
public sealed class FireExtinguisherComponent : SharedFireExtinguisherComponent
public sealed partial class FireExtinguisherComponent : SharedFireExtinguisherComponent
{
}

View File

@@ -4,7 +4,7 @@ namespace Content.Client.Eye;
/// Component for keeping track of client-side eye lerping. This component should only be added or removed via the <see cref="EyeLerpingSystem"/>.
/// </summary>
[RegisterComponent]
public sealed class LerpingEyeComponent : Component
public sealed partial class LerpingEyeComponent : Component
{
/// <summary>
/// False if this eye was automatically added when a player was attached to this entity.

View File

@@ -3,7 +3,7 @@ using Content.Shared.GPS;
namespace Content.Client.GPS.Components
{
[RegisterComponent]
public sealed class HandheldGPSComponent : SharedHandheldGPSComponent
public sealed partial class HandheldGPSComponent : SharedHandheldGPSComponent
{
}
}

View File

@@ -7,7 +7,7 @@ namespace Content.Client.Ghost
{
[RegisterComponent]
[ComponentReference(typeof(SharedGhostComponent))]
public sealed class GhostComponent : SharedGhostComponent
public sealed partial class GhostComponent : SharedGhostComponent
{
public bool IsAttached { get; set; }
@@ -42,9 +42,9 @@ namespace Content.Client.Ghost
};
}
public sealed class ToggleLightingActionEvent : InstantActionEvent { };
public sealed partial class ToggleLightingActionEvent : InstantActionEvent { };
public sealed class ToggleFoVActionEvent : InstantActionEvent { };
public sealed partial class ToggleFoVActionEvent : InstantActionEvent { };
public sealed class ToggleGhostsActionEvent : InstantActionEvent { };
public sealed partial class ToggleGhostsActionEvent : InstantActionEvent { };
}

View File

@@ -7,7 +7,7 @@ namespace Content.Client.Guidebook.Components;
/// </summary>
[RegisterComponent]
[Access(typeof(GuidebookSystem))]
public sealed class GuideHelpComponent : Component
public sealed partial class GuideHelpComponent : Component
{
/// <summary>
/// What guides to include show when opening the guidebook. The first entry will be used to select the currently

View File

@@ -4,7 +4,7 @@
/// This is used for the guidebook monkey.
/// </summary>
[RegisterComponent]
public sealed class GuidebookControlsTestComponent : Component
public sealed partial class GuidebookControlsTestComponent : Component
{
}

View File

@@ -13,7 +13,7 @@ namespace Content.Client.IconSmoothing
/// Any objects with the same <c>key</c> will connect.
/// </remarks>
[RegisterComponent]
public sealed class IconSmoothComponent : Component
public sealed partial class IconSmoothComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("enabled")]
public bool Enabled = true;
@@ -24,13 +24,13 @@ namespace Content.Client.IconSmoothing
/// We will smooth with other objects with the same key.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("key")]
public string? SmoothKey { get; }
public string? SmoothKey { get; private set; }
/// <summary>
/// Prepended to the RSI state.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("base")]
public string StateBase { get; } = string.Empty;
public string StateBase { get; private set; } = string.Empty;
[DataField("shader", customTypeSerializer:typeof(PrototypeIdSerializer<ShaderPrototype>))]
public string? Shader;

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Audio.Midi;
namespace Content.Client.Instruments;
[RegisterComponent, ComponentReference(typeof(SharedInstrumentComponent))]
public sealed class InstrumentComponent : SharedInstrumentComponent
public sealed partial class InstrumentComponent : SharedInstrumentComponent
{
public event Action? OnMidiPlaybackEnded;

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Prototypes;
namespace Content.Client.Interactable.Components
{
[RegisterComponent]
public sealed class InteractionOutlineComponent : Component
public sealed partial class InteractionOutlineComponent : Component
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entMan = default!;

View File

@@ -5,7 +5,7 @@ namespace Content.Client.Inventory;
/// </summary>
[RegisterComponent]
[Access(typeof(ClientInventorySystem))]
public sealed class InventorySlotsComponent : Component
public sealed partial class InventorySlotsComponent : Component
{
[ViewVariables]
public readonly Dictionary<string, ClientInventorySystem.SlotData> SlotData = new ();

View File

@@ -3,7 +3,7 @@ using Robust.Shared.GameObjects;
namespace Content.Client.Items.Components
{
[RegisterComponent]
public sealed class ItemStatusComponent : Component
public sealed partial class ItemStatusComponent : Component
{
}
}

View File

@@ -1,10 +1,10 @@
namespace Content.Client.Kudzu
{
[RegisterComponent]
public sealed class KudzuVisualsComponent : Component
public sealed partial class KudzuVisualsComponent : Component
{
[DataField("layer")]
public int Layer { get; } = 0;
public int Layer { get; private set; } = 0;
}
}

View File

@@ -6,7 +6,7 @@ namespace Content.Client.Light.Components;
[RegisterComponent]
[NetworkedComponent]
public sealed class EmergencyLightComponent : SharedEmergencyLightComponent
public sealed partial class EmergencyLightComponent : SharedEmergencyLightComponent
{
}

View File

@@ -8,7 +8,7 @@ namespace Content.Client.Light.Components;
/// Component that represents a handheld expendable light which can be activated and eventually dies over time.
/// </summary>
[RegisterComponent]
public sealed class ExpendableLightComponent : SharedExpendableLightComponent
public sealed partial class ExpendableLightComponent : SharedExpendableLightComponent
{
/// <summary>
/// The icon state used by expendable lights when the they have been completely expended.

View File

@@ -16,7 +16,7 @@ namespace Content.Client.Light.Components
/// </summary>
[Serializable]
[ImplicitDataDefinitionForInheritors]
public abstract class LightBehaviourAnimationTrack : AnimationTrackProperty
public abstract partial class LightBehaviourAnimationTrack : AnimationTrackProperty
{
protected IEntityManager _entMan = default!;
protected IRobustRandom _random = default!;
@@ -111,7 +111,7 @@ namespace Content.Client.Light.Components
/// A light behaviour that alternates between StartValue and EndValue
/// </summary>
[UsedImplicitly]
public sealed class PulseBehaviour : LightBehaviourAnimationTrack
public sealed partial class PulseBehaviour : LightBehaviourAnimationTrack
{
public override (int KeyFrameIndex, float FramePlayingTime) AdvancePlayback(
object context, int prevKeyFrameIndex, float prevPlayingTime, float frameTime)
@@ -166,7 +166,7 @@ namespace Content.Client.Light.Components
/// A light behaviour that interpolates from StartValue to EndValue
/// </summary>
[UsedImplicitly]
public sealed class FadeBehaviour : LightBehaviourAnimationTrack
public sealed partial class FadeBehaviour : LightBehaviourAnimationTrack
{
/// <summary>
/// Automatically reverse the animation when EndValue is reached. In this particular case, MaxTime specifies the
@@ -229,7 +229,7 @@ namespace Content.Client.Light.Components
/// A light behaviour that interpolates using random values chosen between StartValue and EndValue.
/// </summary>
[UsedImplicitly]
public sealed class RandomizeBehaviour : LightBehaviourAnimationTrack
public sealed partial class RandomizeBehaviour : LightBehaviourAnimationTrack
{
private float _randomValue1;
private float _randomValue2;
@@ -295,7 +295,7 @@ namespace Content.Client.Light.Components
/// </summary>
[UsedImplicitly]
[DataDefinition]
public sealed class ColorCycleBehaviour : LightBehaviourAnimationTrack, ISerializationHooks
public sealed partial class ColorCycleBehaviour : LightBehaviourAnimationTrack, ISerializationHooks
{
[DataField("property")]
public override string Property { get; protected set; } = "Color";
@@ -357,7 +357,7 @@ namespace Content.Client.Light.Components
/// A component which applies a specific behaviour to a PointLightComponent on its owner.
/// </summary>
[RegisterComponent]
public sealed class LightBehaviourComponent : SharedLightBehaviourComponent, ISerializationHooks
public sealed partial class LightBehaviourComponent : SharedLightBehaviourComponent, ISerializationHooks
{
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IRobustRandom _random = default!;
@@ -381,7 +381,7 @@ namespace Content.Client.Light.Components
[ViewVariables(VVAccess.ReadOnly)]
[DataField("behaviours")]
public readonly List<LightBehaviourAnimationTrack> Behaviours = new();
public List<LightBehaviourAnimationTrack> Behaviours = new();
[ViewVariables(VVAccess.ReadOnly)]
public readonly List<AnimationContainer> Animations = new();

View File

@@ -4,7 +4,7 @@ namespace Content.Client.Light.Components;
/// Fades out the <see cref="SharedPointLightComponent"/> attached to this entity.
/// </summary>
[RegisterComponent]
public sealed class LightFadeComponent : Component
public sealed partial class LightFadeComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("duration")]
public float Duration = 0.5f;

View File

@@ -5,14 +5,14 @@ namespace Content.Client.Light.Visualizers;
[RegisterComponent]
[Access(typeof(PoweredLightVisualizerSystem))]
public sealed class PoweredLightVisualsComponent : Component
public sealed partial class PoweredLightVisualsComponent : Component
{
/// <summary>
/// A map of the sprite states used by this visualizer indexed by the light state they correspond to.
/// </summary>
[DataField("spriteStateMap")]
[ViewVariables(VVAccess.ReadOnly)]
public readonly Dictionary<PoweredLightState, string> SpriteStateMap = new()
public Dictionary<PoweredLightState, string> SpriteStateMap = new()
{
[PoweredLightState.Empty] = "empty",
[PoweredLightState.Off] = "off",

View File

@@ -2,7 +2,7 @@
namespace Content.Client.Lightning.Components;
[RegisterComponent]
public sealed class LightningComponent : SharedLightningComponent
public sealed partial class LightningComponent : SharedLightningComponent
{
}

View File

@@ -141,7 +141,7 @@ public sealed partial class MappingSystem : EntitySystem
}
}
public sealed class StartPlacementActionEvent : InstantActionEvent
public sealed partial class StartPlacementActionEvent : InstantActionEvent
{
[DataField("entityType")]
public string? EntityType;

View File

@@ -5,7 +5,7 @@ using Robust.Shared.IoC;
namespace Content.Client.Markers
{
[RegisterComponent]
public sealed class MarkerComponent : Component
public sealed partial class MarkerComponent : Component
{
}
}

View File

@@ -4,7 +4,7 @@
/// This is used for visualizing mech constructions
/// </summary>
[RegisterComponent]
public sealed class MechAssemblyVisualsComponent : Component
public sealed partial class MechAssemblyVisualsComponent : Component
{
/// <summary>
/// The prefix that is followed by the number which

View File

@@ -5,7 +5,7 @@ using Robust.Client.UserInterface;
namespace Content.Client.Mech.Ui.Equipment;
public sealed class MechGrabberUi : UIFragment
public sealed partial class MechGrabberUi : UIFragment
{
private MechGrabberUiFragment? _fragment;

View File

@@ -5,7 +5,7 @@ using Robust.Client.UserInterface;
namespace Content.Client.Mech.Ui.Equipment;
public sealed class MechSoundboardUi : UIFragment
public sealed partial class MechSoundboardUi : UIFragment
{
private MechSoundboardUiFragment? _fragment;

View File

@@ -3,6 +3,6 @@
namespace Content.Client.MedicalScanner;
[RegisterComponent]
public sealed class MedicalScannerComponent : SharedMedicalScannerComponent
public sealed partial class MedicalScannerComponent : SharedMedicalScannerComponent
{
}

View File

@@ -1,7 +1,7 @@
namespace Content.Client.NPC.HTN;
[RegisterComponent]
public sealed class HTNComponent : NPCComponent
public sealed partial class HTNComponent : NPCComponent
{
public string DebugText = string.Empty;
}

View File

@@ -2,7 +2,7 @@ using Content.Shared.NPC;
namespace Content.Client.NPC;
public abstract class NPCComponent : SharedNPCComponent
public abstract partial class NPCComponent : SharedNPCComponent
{
}

View File

@@ -3,7 +3,7 @@ using System.Numerics;
namespace Content.Client.NPC;
[RegisterComponent]
public sealed class NPCSteeringComponent : Component
public sealed partial class NPCSteeringComponent : Component
{
/* Not hooked up to the server component as it's used for debugging only.
*/

View File

@@ -4,7 +4,7 @@ namespace Content.Client.NetworkConfigurator;
/// This is used for...
/// </summary>
[RegisterComponent]
public sealed class NetworkConfiguratorActiveLinkOverlayComponent : Component
public sealed partial class NetworkConfiguratorActiveLinkOverlayComponent : Component
{
/// <summary>
/// The entities linked to this network configurator.

View File

@@ -4,7 +4,7 @@
/// Used for specifying the pda windows border colors
/// </summary>
[RegisterComponent]
public sealed class PdaBorderColorComponent : Component
public sealed partial class PdaBorderColorComponent : Component
{
[DataField("borderColor", required: true)]
public string? BorderColor;

View File

@@ -4,6 +4,6 @@ using Robust.Shared.GameStates;
namespace Content.Client.Paper;
[NetworkedComponent, RegisterComponent]
public sealed class PaperComponent : SharedPaperComponent
public sealed partial class PaperComponent : SharedPaperComponent
{
}

View File

@@ -3,7 +3,7 @@ using System.Numerics;
namespace Content.Client.Paper;
[RegisterComponent]
public sealed class PaperVisualsComponent : Component
public sealed partial class PaperVisualsComponent : Component
{
/// <summary>
/// The path to the image which will be used as a background for the paper itself

View File

@@ -16,14 +16,14 @@ namespace Content.Client.Parallax.Data;
[UsedImplicitly]
[DataDefinition]
public sealed class GeneratedParallaxTextureSource : IParallaxTextureSource
public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSource
{
/// <summary>
/// Parallax config path (the TOML file).
/// In client resources.
/// </summary>
[DataField("configPath")]
public ResPath ParallaxConfigPath { get; } = new("/parallax_config.toml");
public ResPath ParallaxConfigPath { get; private set; } = new("/parallax_config.toml");
/// <summary>
/// ID for debugging, caching, and so forth.
@@ -31,7 +31,7 @@ public sealed class GeneratedParallaxTextureSource : IParallaxTextureSource
/// It is advisible to provide a roughly unique ID for any unique config contents.
/// </summary>
[DataField("id")]
public string Identifier { get; } = "other";
public string Identifier { get; private set; } = "other";
/// <summary>
/// Cached path.

View File

@@ -5,7 +5,7 @@ using Robust.Client.Graphics;
namespace Content.Client.Parallax.Data
{
[ImplicitDataDefinitionForInheritors]
public interface IParallaxTextureSource
public partial interface IParallaxTextureSource
{
/// <summary>
/// Generates or loads the texture.

View File

@@ -10,13 +10,13 @@ namespace Content.Client.Parallax.Data;
[UsedImplicitly]
[DataDefinition]
public sealed class ImageParallaxTextureSource : IParallaxTextureSource
public sealed partial class ImageParallaxTextureSource : IParallaxTextureSource
{
/// <summary>
/// Texture path.
/// </summary>
[DataField("path", required: true)]
public ResPath Path { get; } = default!;
public ResPath Path { get; private set; } = default!;
Task<Texture> IParallaxTextureSource.GenerateTexture(CancellationToken cancel)
{

View File

@@ -6,7 +6,7 @@ namespace Content.Client.Parallax.Data;
/// The configuration for a parallax layer.
/// </summary>
[DataDefinition]
public sealed class ParallaxLayerConfig
public sealed partial class ParallaxLayerConfig
{
/// <summary>
/// The texture source for this layer.

View File

@@ -15,23 +15,23 @@ public sealed class ParallaxPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
public string ID { get; } = default!;
public string ID { get; private set; } = default!;
/// <summary>
/// Parallax layers.
/// </summary>
[DataField("layers")]
public List<ParallaxLayerConfig> Layers { get; } = new();
public List<ParallaxLayerConfig> Layers { get; private set; } = new();
/// <summary>
/// Parallax layers, low-quality.
/// </summary>
[DataField("layersLQ")]
public List<ParallaxLayerConfig> LayersLQ { get; } = new();
public List<ParallaxLayerConfig> LayersLQ { get; private set; } = new();
/// <summary>
/// If low-quality layers don't exist for this parallax and high-quality should be used instead.
/// </summary>
[DataField("layersLQUseHQ")]
public bool LayersLQUseHQ { get; } = true;
public bool LayersLQUseHQ { get; private set; } = true;
}

View File

@@ -4,7 +4,7 @@ namespace Content.Client.ParticleAccelerator;
[RegisterComponent]
[Access(typeof(ParticleAcceleratorPartVisualizerSystem))]
public sealed class ParticleAcceleratorPartVisualsComponent : Component
public sealed partial class ParticleAcceleratorPartVisualsComponent : Component
{
[DataField("stateBase", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
@@ -12,7 +12,7 @@ public sealed class ParticleAcceleratorPartVisualsComponent : Component
[DataField("stateSuffixes")]
[ViewVariables(VVAccess.ReadWrite)]
public readonly Dictionary<ParticleAcceleratorVisualState, string> StatesSuffixes = new()
public Dictionary<ParticleAcceleratorVisualState, string> StatesSuffixes = new()
{
{ParticleAcceleratorVisualState.Powered, "p"},
{ParticleAcceleratorVisualState.Level0, "p0"},

View File

@@ -3,21 +3,21 @@ using Content.Shared.Pointing.Components;
namespace Content.Client.Pointing.Components;
[RegisterComponent]
public sealed class PointingArrowComponent : SharedPointingArrowComponent
public sealed partial class PointingArrowComponent : SharedPointingArrowComponent
{
/// <summary>
/// How long it takes to go from the bottom of the animation to the top.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("animationTime")]
public readonly float AnimationTime = 0.5f;
public float AnimationTime = 0.5f;
/// <summary>
/// How far it goes in any direction.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("offset")]
public readonly Vector2 Offset = new(0, 0.25f);
public Vector2 Offset = new(0, 0.25f);
public readonly string AnimationKey = "pointingarrow";
}

View File

@@ -7,7 +7,7 @@ using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Pointing.Components
{
[RegisterComponent]
public sealed class RoguePointingArrowComponent : SharedRoguePointingArrowComponent
public sealed partial class RoguePointingArrowComponent : SharedRoguePointingArrowComponent
{
}
}

View File

@@ -4,7 +4,7 @@ namespace Content.Client.Power.APC;
[RegisterComponent]
[Access(typeof(ApcVisualizerSystem))]
public sealed class ApcVisualsComponent : Component
public sealed partial class ApcVisualsComponent : Component
{
#region Indicators

View File

@@ -2,7 +2,7 @@
/// <seealso cref="TegSystem"/>
[RegisterComponent]
public sealed class TegCirculatorComponent : Component
public sealed partial class TegCirculatorComponent : Component
{
}

View File

@@ -1,7 +1,7 @@
namespace Content.Client.Power.SMES;
[RegisterComponent]
public sealed class SmesComponent : Component
public sealed partial class SmesComponent : Component
{
/// <summary>
/// The prefix used for the RSI states of the sprite layers indicating the charge level of the SMES.
@@ -9,7 +9,7 @@ public sealed class SmesComponent : Component
[DataField("chargeOverlayPrefix")]
[ViewVariables(VVAccess.ReadWrite)]
public string ChargeOverlayPrefix = "smes-og";
/// <summary>
/// The prefix used for the RSI states of the sprite layers indicating the input state of the SMES.
/// Actually bundled together with the output indicator light.
@@ -17,7 +17,7 @@ public sealed class SmesComponent : Component
[DataField("inputOverlayPrefix")]
[ViewVariables(VVAccess.ReadWrite)]
public string InputOverlayPrefix = "smes-oc";
/// <summary>
/// The prefix used for the RSI states of the sprite layers indicating the output state of the SMES.
/// Actually bundled together with the input indicator light.

View File

@@ -1,7 +1,7 @@
namespace Content.Client.Power.Visualizers;
[RegisterComponent]
public sealed class CableVisualizerComponent : Component
public sealed partial class CableVisualizerComponent : Component
{
[DataField("statePrefix")]
public string? StatePrefix;

View File

@@ -1,4 +1,4 @@
namespace Content.Client.PowerCell;
[RegisterComponent]
public sealed class PowerCellVisualsComponent : Component {}
public sealed partial class PowerCellVisualsComponent : Component {}

View File

@@ -4,7 +4,7 @@ namespace Content.Client.PowerCell;
[RegisterComponent]
[Access(typeof(PowerChargerVisualizerSystem))]
public sealed class PowerChargerVisualsComponent : Component
public sealed partial class PowerChargerVisualsComponent : Component
{
/// <summary>
/// The base sprite state used if the power cell charger does not contain a power cell.
@@ -12,14 +12,14 @@ public sealed class PowerChargerVisualsComponent : Component
[DataField("emptyState")]
[ViewVariables(VVAccess.ReadWrite)]
public string EmptyState = "empty";
/// <summary>
/// The base sprite state used if the power cell charger contains a power cell.
/// </summary>
[DataField("occupiedState")]
[ViewVariables(VVAccess.ReadWrite)]
public string OccupiedState = "full";
/// <summary>
/// A mapping of the indicator light overlays for the power cell charger.
/// <see cref="CellChargerStatus.Off"/> Maps to the state used when the charger is out of power/disabled.
@@ -29,7 +29,7 @@ public sealed class PowerChargerVisualsComponent : Component
/// </summary>
[DataField("lightStates")]
[ViewVariables(VVAccess.ReadWrite)]
public readonly Dictionary<CellChargerStatus, string> LightStates = new()
public Dictionary<CellChargerStatus, string> LightStates = new()
{
[CellChargerStatus.Off] = "light-off",
[CellChargerStatus.Empty] = "light-empty",

View File

@@ -4,6 +4,6 @@ namespace Content.Client.Replay.Spectator;
/// This component indicates that this entity currently has a replay spectator/observer attached to it.
/// </summary>
[RegisterComponent]
public sealed class ReplaySpectatorComponent : Component
public sealed partial class ReplaySpectatorComponent : Component
{
}

View File

@@ -1,11 +1,11 @@
namespace Content.Client.Rotation;
[RegisterComponent]
public sealed class RotationVisualsComponent : Component
public sealed partial class RotationVisualsComponent : Component
{
[DataField("defaultRotation")]
[ViewVariables(VVAccess.ReadOnly)]
public readonly Angle DefaultRotation = Angle.FromDegrees(90);
public Angle DefaultRotation = Angle.FromDegrees(90);
[ViewVariables(VVAccess.ReadWrite)]
public Angle VerticalRotation = 0;

View File

@@ -3,7 +3,7 @@ using Content.Shared.Salvage.Expeditions;
namespace Content.Client.Salvage;
[RegisterComponent]
public sealed class SalvageExpeditionComponent : SharedSalvageExpeditionComponent
public sealed partial class SalvageExpeditionComponent : SharedSalvageExpeditionComponent
{
}

View File

@@ -4,4 +4,4 @@ using Robust.Shared.GameStates;
namespace Content.Client.Salvage;
[NetworkedComponent, RegisterComponent]
public sealed class SalvageMagnetComponent : SharedSalvageMagnetComponent {}
public sealed partial class SalvageMagnetComponent : SharedSalvageMagnetComponent {}

View File

@@ -3,5 +3,5 @@ using Content.Shared.Shuttles.Components;
namespace Content.Client.Shuttles
{
[RegisterComponent]
public sealed class ShuttleConsoleComponent : SharedShuttleConsoleComponent {}
public sealed partial class ShuttleConsoleComponent : SharedShuttleConsoleComponent {}
}

View File

@@ -7,6 +7,6 @@ namespace Content.Client.Shuttles;
/// Managed by <see cref="ThrusterSystem"/>
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(ThrusterSystem))]
public sealed class ThrusterComponent : Component
public sealed partial class ThrusterComponent : Component
{
}

View File

@@ -8,7 +8,7 @@ namespace Content.Client.Singularity.Visualizers;
/// </summary>
[RegisterComponent]
[Access(typeof(RadiationCollectorSystem))]
public sealed class RadiationCollectorComponent : Component
public sealed partial class RadiationCollectorComponent : Component
{
/// <summary>
/// The key used to index the (de)activation animations played when turning a radiation collector on/off.

View File

@@ -1,7 +1,7 @@
namespace Content.Client.Smoking;
[RegisterComponent]
public sealed class BurnStateVisualsComponent : Component
public sealed partial class BurnStateVisualsComponent : Component
{
[DataField("burntIcon")]
public string BurntIcon = "burnt-icon";

View File

@@ -6,7 +6,7 @@ namespace Content.Client.Sprite;
/// The non-networked client-only component to track active <see cref="SpriteFadeComponent"/>
/// </summary>
[RegisterComponent, Access(typeof(SpriteFadeSystem))]
public sealed class FadingSpriteComponent : Component
public sealed partial class FadingSpriteComponent : Component
{
[ViewVariables]
public float OriginalAlpha;

View File

@@ -9,7 +9,7 @@ namespace Content.Client.Storage
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(SharedStorageComponent))]
public sealed class ClientStorageComponent : SharedStorageComponent
public sealed partial class ClientStorageComponent : SharedStorageComponent
{
private List<EntityUid> _storedEntities = new();
public override IReadOnlyList<EntityUid> StoredEntities => _storedEntities;

View File

@@ -4,7 +4,7 @@ using Robust.Shared.GameStates;
namespace Content.Client.Storage.Components;
[RegisterComponent, ComponentReference(typeof(SharedEntityStorageComponent))]
public sealed class EntityStorageComponent : SharedEntityStorageComponent
public sealed partial class EntityStorageComponent : SharedEntityStorageComponent
{
}

View File

@@ -2,7 +2,7 @@ namespace Content.Client.Storage.Visualizers;
[RegisterComponent]
[Access(typeof(EntityStorageVisualizerSystem))]
public sealed class EntityStorageVisualsComponent : Component
public sealed partial class EntityStorageVisualsComponent : Component
{
/// <summary>
/// The RSI state used for the base layer of the storage entity sprite while the storage is closed.

View File

@@ -4,7 +4,7 @@ namespace Content.Client.SubFloor;
/// Added clientside if an entity is revealed for TRay.
/// </summary>
[RegisterComponent]
public sealed class TrayRevealedComponent : Component
public sealed partial class TrayRevealedComponent : Component
{
}

View File

@@ -1,7 +1,7 @@
namespace Content.Client.SurveillanceCamera;
[RegisterComponent]
public sealed class ActiveSurveillanceCameraMonitorVisualsComponent : Component
public sealed partial class ActiveSurveillanceCameraMonitorVisualsComponent : Component
{
public float TimeLeft = 10f;

View File

@@ -5,8 +5,8 @@ namespace Content.Client.SurveillanceCamera;
// Dummy component so that targetted events work on client for
// appearance events.
[RegisterComponent]
public sealed class SurveillanceCameraVisualsComponent : Component
public sealed partial class SurveillanceCameraVisualsComponent : Component
{
[DataField("sprites")]
public readonly Dictionary<SurveillanceCameraVisuals, string> CameraSprites = new();
public Dictionary<SurveillanceCameraVisuals, string> CameraSprites = new();
}

View File

@@ -4,7 +4,7 @@
/// This is an active component for tracking <see cref="TextScreenVisualsComponent"/>
/// </summary>
[RegisterComponent]
public sealed class TextScreenTimerComponent : Component
public sealed partial class TextScreenTimerComponent : Component
{
}

View File

@@ -6,7 +6,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Client.TextScreen;
[RegisterComponent]
public sealed class TextScreenVisualsComponent : Component
public sealed partial class TextScreenVisualsComponent : Component
{
/// <summary>
/// 1/32 - the size of a pixel

View File

@@ -10,7 +10,7 @@ namespace Content.Client.Toggleable;
/// visuals. This will modify the color of any attached point lights.
/// </remarks>
[RegisterComponent]
public sealed class ToggleableLightVisualsComponent : Component
public sealed partial class ToggleableLightVisualsComponent : Component
{
/// <summary>
/// Sprite layer that will have its visibility toggled when this item is toggled.
@@ -28,5 +28,5 @@ public sealed class ToggleableLightVisualsComponent : Component
/// Layers to add to the sprite of the player that is wearing this entity (while the component is toggled on).
/// </summary>
[DataField("clothingVisuals")]
public readonly Dictionary<string, List<PrototypeLayerData>> ClothingVisuals = new();
public Dictionary<string, List<PrototypeLayerData>> ClothingVisuals = new();
}

View File

@@ -3,7 +3,7 @@ using Content.Shared.Tools.Components;
namespace Content.Client.Tools.Components;
[RegisterComponent]
public sealed class WeldableComponent : SharedWeldableComponent
public sealed partial class WeldableComponent : SharedWeldableComponent
{
}

Some files were not shown because too many files have changed in this diff Show More