Seal/abstract/virtual everything (#6739)
This commit is contained in:
@@ -4,7 +4,7 @@ using Robust.Shared.GameObjects;
|
||||
namespace Content.Server.Power.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class ActivatableUIRequiresPowerComponent : Component
|
||||
public sealed class ActivatableUIRequiresPowerComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.Power.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(ApcSystem))]
|
||||
public class ApcComponent : BaseApcNetComponent
|
||||
public sealed class ApcComponent : BaseApcNetComponent
|
||||
{
|
||||
[DataField("onReceiveMessageSound")]
|
||||
public SoundSpecifier OnReceiveMessageSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Power.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentProtoName("PowerProvider")]
|
||||
public class ApcPowerProviderComponent : BaseApcNetComponent
|
||||
public sealed class ApcPowerProviderComponent : BaseApcNetComponent
|
||||
{
|
||||
[ViewVariables] public List<ApcPowerReceiverComponent> LinkedReceivers { get; } = new();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.Power.Components
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
#pragma warning disable 618
|
||||
public class ApcPowerReceiverComponent : Component, IExamine
|
||||
public sealed class ApcPowerReceiverComponent : Component, IExamine
|
||||
#pragma warning restore 618
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
@@ -105,7 +105,7 @@ namespace Content.Server.Power.Components
|
||||
}
|
||||
|
||||
#pragma warning disable 618
|
||||
public class PowerChangedMessage : ComponentMessage
|
||||
public sealed class PowerChangedMessage : ComponentMessage
|
||||
#pragma warning restore 618
|
||||
{
|
||||
public readonly bool Powered;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Power.Components
|
||||
/// Connects the loading side of a <see cref="BatteryComponent"/> to a non-APC power network.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class BatteryChargerComponent : BasePowerNetComponent
|
||||
public sealed class BatteryChargerComponent : BasePowerNetComponent
|
||||
{
|
||||
protected override void AddSelfToNet(IPowerNet net)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Content.Server.Power.Components
|
||||
/// Battery node on the pow3r network. Needs other components to connect to actual networks.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Virtual]
|
||||
public class BatteryComponent : Component
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.GameObjects;
|
||||
namespace Content.Server.Power.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class BatteryDischargerComponent : BasePowerNetComponent
|
||||
public sealed class BatteryDischargerComponent : BasePowerNetComponent
|
||||
{
|
||||
protected override void AddSelfToNet(IPowerNet net)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Power.Components
|
||||
/// Self-recharging battery.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class BatterySelfRechargerComponent : Component
|
||||
public sealed class BatterySelfRechargerComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)] [DataField("autoRecharge")] public bool AutoRecharge { get; set; }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.Power.Components
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(CableSystem))]
|
||||
public class CableComponent : Component
|
||||
public sealed class CableComponent : Component
|
||||
{
|
||||
[DataField("cableDroppedOnCutPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public readonly string CableDroppedOnCutPrototype = "CableHVStack1";
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Power.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
#pragma warning disable 618
|
||||
public class ExaminableBatteryComponent : Component, IExamine
|
||||
public sealed class ExaminableBatteryComponent : Component, IExamine
|
||||
#pragma warning restore 618
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Power.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(ExtensionCableSystem))]
|
||||
public class ExtensionCableProviderComponent : Component
|
||||
public sealed class ExtensionCableProviderComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The max distance this can connect to <see cref="ExtensionCableReceiverComponent"/>s from.
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Power.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(ExtensionCableSystem))]
|
||||
public class ExtensionCableReceiverComponent : Component
|
||||
public sealed class ExtensionCableReceiverComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public ExtensionCableProviderComponent? Provider { get; set; }
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Power.Components
|
||||
/// Draws power directly from an MV or HV wire it is on top of.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class PowerConsumerComponent : BaseNetConnectorComponent<IBasePowerNet>
|
||||
public sealed class PowerConsumerComponent : BaseNetConnectorComponent<IBasePowerNet>
|
||||
{
|
||||
/// <summary>
|
||||
/// How much power this needs to be fully powered.
|
||||
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.Power.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class PowerSupplierComponent : BasePowerNetComponent
|
||||
public sealed class PowerSupplierComponent : BasePowerNetComponent
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("supplyRate")]
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.GameObjects;
|
||||
namespace Content.Server.Power.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class BatterySystem : EntitySystem
|
||||
public sealed class BatterySystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ public sealed partial class CableSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
public class CuttingFinishedEvent : EntityEventArgs
|
||||
public sealed class CuttingFinishedEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid User;
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
/// <summary>
|
||||
/// Sent when a <see cref="ExtensionCableProviderComponent"/> connects to a <see cref="ExtensionCableReceiverComponent"/>
|
||||
/// </summary>
|
||||
public class ProviderConnectedEvent : EntityEventArgs
|
||||
public sealed class ProviderConnectedEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ExtensionCableProviderComponent"/> that connected.
|
||||
@@ -275,7 +275,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
/// <summary>
|
||||
/// Sent when a <see cref="ExtensionCableProviderComponent"/> disconnects from a <see cref="ExtensionCableReceiverComponent"/>
|
||||
/// </summary>
|
||||
public class ProviderDisconnectedEvent : EntityEventArgs
|
||||
public sealed class ProviderDisconnectedEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ExtensionCableProviderComponent"/> that disconnected.
|
||||
@@ -290,7 +290,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
/// <summary>
|
||||
/// Sent when a <see cref="ExtensionCableReceiverComponent"/> connects to a <see cref="ExtensionCableProviderComponent"/>
|
||||
/// </summary>
|
||||
public class ReceiverConnectedEvent : EntityEventArgs
|
||||
public sealed class ReceiverConnectedEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ExtensionCableReceiverComponent"/> that connected.
|
||||
@@ -305,7 +305,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
/// <summary>
|
||||
/// Sent when a <see cref="ExtensionCableReceiverComponent"/> disconnects from a <see cref="ExtensionCableProviderComponent"/>
|
||||
/// </summary>
|
||||
public class ReceiverDisconnectedEvent : EntityEventArgs
|
||||
public sealed class ReceiverDisconnectedEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="ExtensionCableReceiverComponent"/> that disconnected.
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
/// Manages power networks, power state, and all power components.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public class PowerNetSystem : EntitySystem
|
||||
public sealed class PowerNetSystem : EntitySystem
|
||||
{
|
||||
private readonly PowerState _powerState = new();
|
||||
private readonly HashSet<PowerNet> _powerNetReconnectQueue = new();
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.Power.NodeGroups
|
||||
|
||||
[NodeGroup(NodeGroupID.Apc)]
|
||||
[UsedImplicitly]
|
||||
public class ApcNet : BaseNetConnectorNodeGroup<IApcNet>, IApcNet
|
||||
public sealed class ApcNet : BaseNetConnectorNodeGroup<IApcNet>, IApcNet
|
||||
{
|
||||
private readonly PowerNetSystem _powerNetSystem = EntitySystem.Get<PowerNetSystem>();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.Power.NodeGroups
|
||||
|
||||
[NodeGroup(NodeGroupID.HVPower, NodeGroupID.MVPower)]
|
||||
[UsedImplicitly]
|
||||
public class PowerNet : BaseNetConnectorNodeGroup<IPowerNet>, IPowerNet
|
||||
public sealed class PowerNet : BaseNetConnectorNodeGroup<IPowerNet>, IPowerNet
|
||||
{
|
||||
private readonly PowerNetSystem _powerNetSystem = EntitySystem.Get<PowerNetSystem>();
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Content.Server.Power.Nodes
|
||||
/// Type of node that connects to a <see cref="CableNode"/> below it.
|
||||
/// </summary>
|
||||
[DataDefinition]
|
||||
[Virtual]
|
||||
public class CableDeviceNode : Node
|
||||
{
|
||||
public override IEnumerable<Node> GetReachableNodes(TransformComponent xform,
|
||||
|
||||
@@ -9,7 +9,7 @@ using Robust.Shared.Serialization.Manager.Attributes;
|
||||
namespace Content.Server.Power.Nodes
|
||||
{
|
||||
[DataDefinition]
|
||||
public class CableNode : Node
|
||||
public sealed class CableNode : Node
|
||||
{
|
||||
public override IEnumerable<Node> GetReachableNodes(TransformComponent xform,
|
||||
EntityQuery<NodeContainerComponent> nodeQuery,
|
||||
|
||||
@@ -9,7 +9,7 @@ using Robust.Shared.Serialization.Manager.Attributes;
|
||||
namespace Content.Server.Power.Nodes
|
||||
{
|
||||
[DataDefinition]
|
||||
public class CableTerminalNode : CableDeviceNode
|
||||
public sealed class CableTerminalNode : CableDeviceNode
|
||||
{
|
||||
public override IEnumerable<Node> GetReachableNodes(TransformComponent xform,
|
||||
EntityQuery<NodeContainerComponent> nodeQuery,
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.Serialization.Manager.Attributes;
|
||||
namespace Content.Server.Power.Nodes
|
||||
{
|
||||
[DataDefinition]
|
||||
public class CableTerminalPortNode : Node
|
||||
public sealed class CableTerminalPortNode : Node
|
||||
{
|
||||
public override IEnumerable<Node> GetReachableNodes(TransformComponent xform,
|
||||
EntityQuery<NodeContainerComponent> nodeQuery,
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.GameObjects;
|
||||
namespace Content.Server.Power.SMES
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal class PowerSmesSystem : EntitySystem
|
||||
internal sealed class PowerSmesSystem : EntitySystem
|
||||
{
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Power.SMES
|
||||
/// Code interfacing with the powernet is handled in <see cref="BatteryStorageComponent"/> and <see cref="BatteryDischargerComponent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class SmesComponent : Component
|
||||
public sealed class SmesComponent : Component
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.IoC;
|
||||
namespace Content.Server.Power
|
||||
{
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public class SetBatteryPercentCommand : IConsoleCommand
|
||||
public sealed class SetBatteryPercentCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "setbatterypercent";
|
||||
public string Description => "Drains or recharges a battery by entity uid and percentage, i.e.: forall with Battery do setbatterypercent $ID 0";
|
||||
|
||||
Reference in New Issue
Block a user