Remove Static Component NetIds (#4247)

* Remove the unnecessary NetID property from ComponentState.

* Remove Component.NetworkSynchronizeExistence.

* Removed Component.NetID.

* Adds component netID automatic generation.

* Removed NetIdAttribute from serverside components with no corresponding clientside registration.

* Completely remove static NetIds.

* Renamed NetIDAttribute to NetworkedComponentAttribute.

* Add GenerateNetIds calls to client and server entry points.
Add test to make sure auto generated NetIds are identical.

* Component changes when rebasing that I am too lazy to rewrite into the branch.

Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
Acruid
2021-07-12 01:32:10 -07:00
committed by GitHub
parent baeabfd936
commit 59e5cc5e3c
103 changed files with 334 additions and 429 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using Moq;
using Robust.Shared.Exceptions;
@@ -45,8 +45,7 @@ namespace Content.Benchmarks
var dummyReg = new Mock<IComponentRegistration>();
dummyReg.SetupGet(p => p.Name).Returns("Dummy");
dummyReg.SetupGet(p => p.Type).Returns(typeof(DummyComponent));
dummyReg.SetupGet(p => p.NetID).Returns((uint?) null);
dummyReg.SetupGet(p => p.NetworkSynchronizeExistence).Returns(false);
dummyReg.SetupGet(p => p.NetID).Returns((ushort?) null);
dummyReg.SetupGet(p => p.References).Returns(new [] {typeof(DummyComponent)});
var componentFactory = new Mock<IComponentFactory>();

View File

@@ -9,7 +9,7 @@ namespace Content.Client.Administration.UI.CustomControls
{
public string? Command { get; set; }
public CommandButton() : base()
public CommandButton()
{
OnPressed += Execute;
}

View File

@@ -4,11 +4,11 @@ using Content.Client.Items.Components;
using Content.Shared.Clothing;
using Content.Shared.Inventory;
using Content.Shared.Item;
using Content.Shared.NetIDs;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -18,12 +18,12 @@ namespace Content.Client.Clothing
[RegisterComponent]
[ComponentReference(typeof(SharedItemComponent))]
[ComponentReference(typeof(ItemComponent))]
[NetworkedComponent()]
public class ClothingComponent : ItemComponent
{
[DataField("femaleMask")]
private FemaleClothingMask _femaleMask = FemaleClothingMask.UniformFull;
public override string Name => "Clothing";
public override uint? NetID => ContentNetIDs.CLOTHING;
private string? _clothingEquippedPrefix;

View File

@@ -105,6 +105,7 @@ namespace Content.Client.Entry
}
IoCManager.BuildGraph();
factory.GenerateNetIds();
IoCManager.Resolve<IClientAdminManager>().Initialize();
IoCManager.Resolve<IParallaxManager>().LoadParallax();

View File

@@ -1,11 +1,11 @@
using Content.Client.Items.Components;
using Content.Client.Message;
using Content.Client.Stylesheets;
using Content.Shared.NetIDs;
using Content.Shared.Tool;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -13,6 +13,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.Tools.Components
{
[RegisterComponent]
[NetworkedComponent()]
public class MultiToolComponent : Component, IItemStatus
{
private ToolQuality _behavior;
@@ -24,7 +25,6 @@ namespace Content.Client.Tools.Components
[ViewVariables] public ToolQuality? Behavior => _behavior;
public override string Name => "MultiTool";
public override uint? NetID => ContentNetIDs.MULTITOOLS;
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{

View File

@@ -2,11 +2,11 @@ using System;
using Content.Client.Items.Components;
using Content.Client.Message;
using Content.Client.Stylesheets;
using Content.Shared.NetIDs;
using Content.Shared.Tool;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Localization;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -14,10 +14,11 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.Tools.Components
{
[RegisterComponent]
[NetworkedComponent()]
public class WelderComponent : SharedToolComponent, IItemStatus
{
public override string Name => "Welder";
public override uint? NetID => ContentNetIDs.WELDER;
private ToolQuality _behavior;
[ViewVariables(VVAccess.ReadWrite)] private bool _uiUpdateNeeded;

View File

@@ -1,22 +1,22 @@
using System;
using System;
using Content.Client.Items.Components;
using Content.Client.Stylesheets;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged.Barrels.Components;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
namespace Content.Client.Weapons.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public class ClientBatteryBarrelComponent : Component, IItemStatus
{
public override string Name => "BatteryBarrel";
public override uint? NetID => ContentNetIDs.BATTERY_BARREL;
private StatusControl? _statusControl;

View File

@@ -1,24 +1,24 @@
using System;
using System;
using Content.Client.IoC;
using Content.Client.Items.Components;
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged.Barrels.Components;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
namespace Content.Client.Weapons.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public class ClientBoltActionBarrelComponent : Component, IItemStatus
{
public override string Name => "BoltActionBarrel";
public override uint? NetID => ContentNetIDs.BOLTACTION_BARREL;
private StatusControl? _statusControl;

View File

@@ -1,9 +1,8 @@
using System;
using System;
using Content.Client.IoC;
using Content.Client.Items.Components;
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged;
using Content.Shared.Weapons.Ranged.Barrels.Components;
using Robust.Client.Animations;
@@ -12,6 +11,7 @@ using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Animations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.Players;
@@ -21,6 +21,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.Weapons.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public class ClientMagazineBarrelComponent : Component, IItemStatus
{
private static readonly Animation AlarmAnimationSmg = new()
@@ -70,7 +71,6 @@ namespace Content.Client.Weapons.Ranged.Barrels.Components
};
public override string Name => "MagazineBarrel";
public override uint? NetID => ContentNetIDs.MAGAZINE_BARREL;
private StatusControl? _statusControl;

View File

@@ -1,24 +1,24 @@
using System;
using System;
using Content.Client.IoC;
using Content.Client.Items.Components;
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged.Barrels.Components;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
namespace Content.Client.Weapons.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public class ClientPumpBarrelComponent : Component, IItemStatus
{
public override string Name => "PumpBarrel";
public override uint? NetID => ContentNetIDs.PUMP_BARREL;
private StatusControl? _statusControl;

View File

@@ -1,22 +1,22 @@
using Content.Client.IoC;
using Content.Client.IoC;
using Content.Client.Items.Components;
using Content.Client.Resources;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged.Barrels.Components;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
namespace Content.Client.Weapons.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public class ClientRevolverBarrelComponent : Component, IItemStatus
{
public override string Name => "RevolverBarrel";
public override uint? NetID => ContentNetIDs.REVOLVER_BARREL;
private StatusControl? _statusControl;

View File

@@ -0,0 +1,66 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using Robust.Server.Player;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Network;
namespace Content.IntegrationTests.Tests.Networking
{
[TestFixture]
class NetworkIdsMatchTest : ContentIntegrationTest
{
[Test]
public async Task TestConnect()
{
var client = StartClient();
var server = StartServer();
await ConnectNetworking(client, server);
var clientCompFactory = client.ResolveDependency<IComponentFactory>();
var serverCompFactory = server.ResolveDependency<IComponentFactory>();
var clientNetComps = clientCompFactory.NetworkedComponents;
var serverNetComps = serverCompFactory.NetworkedComponents;
Assert.That(clientNetComps, Is.Not.Null);
Assert.That(serverNetComps, Is.Not.Null);
Assert.That(clientNetComps.Count, Is.EqualTo(serverNetComps.Count));
// Checks that at least Metadata and Transform are registered.
Assert.That(clientNetComps.Count, Is.GreaterThanOrEqualTo(2));
for (var netId = 0; netId < clientNetComps.Count; netId++)
{
Assert.That(clientNetComps[netId].Name, Is.EqualTo(serverNetComps[netId].Name));
}
}
private static async Task ConnectNetworking(ClientIntegrationInstance client, ServerIntegrationInstance server)
{
await Task.WhenAll(client.WaitIdleAsync(), server.WaitIdleAsync());
// Connect.
client.SetConnectTarget(server);
client.Post(() => IoCManager.Resolve<IClientNetManager>().ClientConnect(null, 0, null));
// Run some ticks for the handshake to complete and such.
for (var i = 0; i < 10; i++)
{
server.RunTicks(1);
await server.WaitIdleAsync();
client.RunTicks(1);
await client.WaitIdleAsync();
}
await Task.WhenAll(client.WaitIdleAsync(), server.WaitIdleAsync());
}
}
}

View File

@@ -3,13 +3,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Content.Shared.NetIDs;
using NUnit.Framework;
using Robust.Client.GameObjects;
using Robust.Client.GameStates;
using Robust.Server.Player;
using Robust.Shared;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Players;
@@ -391,10 +391,10 @@ namespace Content.IntegrationTests.Tests.Networking
}
}
[NetworkedComponent()]
private sealed class PredictionTestComponent : Component
{
public override string Name => "PredictionTest";
public override uint? NetID => ContentNetIDs.PREDICTION_TEST;
private bool _foo;
@@ -428,7 +428,7 @@ namespace Content.IntegrationTests.Tests.Networking
{
public bool Foo { get; }
public PredictionComponentState(bool foo) : base(ContentNetIDs.PREDICTION_TEST)
public PredictionComponentState(bool foo)
{
Foo = foo;
}

View File

@@ -7,8 +7,6 @@ using Content.Server.UserInterface;
using Content.Shared.ActionBlocker;
using Content.Shared.Arcade;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.NetIDs;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.GameObjects;
@@ -25,7 +23,6 @@ namespace Content.Server.Arcade.Components
[Dependency] private readonly IRobustRandom _random = default!;
public override string Name => "BlockGameArcade";
public override uint? NetID => ContentNetIDs.BLOCKGAME_ARCADE;
[ComponentDependency] private readonly ApcPowerReceiverComponent? _powerReceiverComponent = default!;

View File

@@ -7,7 +7,6 @@ using Content.Server.WireHacking;
using Content.Shared.ActionBlocker;
using Content.Shared.Arcade;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Wires;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;

View File

@@ -10,8 +10,6 @@ using Content.Shared.Body.Mechanism;
using Content.Shared.Body.Part;
using Content.Shared.Body.Surgery;
using Content.Shared.Interaction;
using Content.Shared.NetIDs;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -31,7 +29,6 @@ namespace Content.Server.Body.Surgery.Components
public class SurgeryToolComponent : Component, ISurgeon, IAfterInteract
{
public override string Name => "SurgeryTool";
public override uint? NetID => ContentNetIDs.SURGERY;
private readonly Dictionary<int, object> _optionsCache = new();

View File

@@ -4,9 +4,9 @@ using Content.Server.Items;
using Content.Shared.Clothing;
using Content.Shared.Interaction;
using Content.Shared.Item;
using Content.Shared.NetIDs;
using Content.Shared.Notification.Managers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -17,10 +17,10 @@ namespace Content.Server.Clothing.Components
[RegisterComponent]
[ComponentReference(typeof(SharedItemComponent))]
[ComponentReference(typeof(ItemComponent))]
[NetworkedComponent()]
public class ClothingComponent : ItemComponent, IUse
{
public override string Name => "Clothing";
public override uint? NetID => ContentNetIDs.CLOTHING;
[ViewVariables]
[DataField("Slots")]

View File

@@ -1,6 +1,5 @@
#nullable enable
using System.Threading;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -13,7 +12,6 @@ namespace Content.Server.Engineering.Components
public class DisassembleOnActivateComponent : Component
{
public override string Name => "DisassembleOnActivate";
public override uint? NetID => ContentNetIDs.DISASSEMBLE_ON_ACTIVATE;
[ViewVariables]
[DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]

View File

@@ -1,5 +1,4 @@
#nullable enable
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -12,7 +11,6 @@ namespace Content.Server.Engineering.Components
public class SpawnAfterInteractComponent : Component
{
public override string Name => "SpawnAfterInteract";
public override uint? NetID => ContentNetIDs.SPAWN_AFTER_INTERACT;
[ViewVariables]
[DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]

View File

@@ -1,4 +1,4 @@
using Content.Server.Administration.Managers;
using Content.Server.Administration.Managers;
using Content.Server.AI.Utility;
using Content.Server.AI.Utility.Considerations;
using Content.Server.AI.WorldState;
@@ -56,6 +56,7 @@ namespace Content.Server.Entry
}
IoCManager.BuildGraph();
factory.GenerateNetIds();
_euiManager = IoCManager.Resolve<EuiManager>();
_voteManager = IoCManager.Resolve<IVoteManager>();

View File

@@ -10,7 +10,6 @@ using Content.Server.UserInterface;
using Content.Shared.Chemistry.Solution;
using Content.Shared.Interaction;
using Content.Shared.Kitchen.Components;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Random.Helpers;
using Content.Shared.Tag;

View File

@@ -3,8 +3,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.Storage.Components;
using Content.Shared.NetIDs;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
@@ -27,7 +25,6 @@ namespace Content.Server.Light.Components
public class LightReplacerComponent : Component
{
public override string Name => "LightReplacer";
public override uint? NetID => ContentNetIDs.LIGHT_REPLACER;
[DataField("sound")] private string _sound = "/Audio/Weapons/click.ogg";

View File

@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Content.Shared.Interaction;
using Content.Shared.NetIDs;
using Content.Shared.Tool;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -15,6 +15,7 @@ namespace Content.Server.Tools.Components
/// Not to be confused with Multitool (power)
/// </summary>
[RegisterComponent]
[NetworkedComponent()]
public class MultiToolComponent : Component, IUse
{
[DataDefinition]
@@ -42,7 +43,6 @@ namespace Content.Server.Tools.Components
}
public override string Name => "MultiTool";
public override uint? NetID => ContentNetIDs.MULTITOOLS;
[DataField("tools")] private List<ToolEntry> _tools = new();
private int _currentTool = 0;

View File

@@ -13,7 +13,6 @@ using Content.Shared.Chemistry.Reagent;
using Content.Shared.Chemistry.Solution.Components;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.NetIDs;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Temperature;
@@ -21,6 +20,7 @@ using Content.Shared.Tool;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
@@ -35,12 +35,12 @@ namespace Content.Server.Tools.Components
[ComponentReference(typeof(ToolComponent))]
[ComponentReference(typeof(IToolComponent))]
[ComponentReference(typeof(IHotItem))]
[NetworkedComponent()]
public class WelderComponent : ToolComponent, IExamine, IUse, ISuicideAct, ISolutionChange, IHotItem, IAfterInteract
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
public override string Name => "Welder";
public override uint? NetID => ContentNetIDs.WELDER;
/// <summary>
/// Default Cost of using the welder fuel for an action

View File

@@ -5,7 +5,6 @@ using Content.Shared.ActionBlocker;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.NetIDs;
using Content.Shared.Notification.Managers;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Ranged.Barrels.Components;
@@ -13,6 +12,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
@@ -27,13 +27,13 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
/// Shotguns mostly
/// </summary>
[RegisterComponent]
[NetworkedComponent()]
public sealed class BoltActionBarrelComponent : ServerRangedBarrelComponent, IMapInit, IExamine
{
// Originally I had this logic shared with PumpBarrel and used a couple of variables to control things
// but it felt a lot messier to play around with, especially when adding verbs
public override string Name => "BoltActionBarrel";
public override uint? NetID => ContentNetIDs.BOLTACTION_BARREL;
public override int ShotsLeft
{

View File

@@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Content.Server.Weapon.Ranged.Ammunition.Components;
using Content.Shared.Interaction;
using Content.Shared.NetIDs;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Weapons.Ranged.Barrels.Components;
@@ -10,6 +9,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
@@ -25,10 +25,10 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
/// Bolt-action rifles
/// </summary>
[RegisterComponent]
[NetworkedComponent()]
public sealed class PumpBarrelComponent : ServerRangedBarrelComponent, IMapInit, ISerializationHooks
{
public override string Name => "PumpBarrel";
public override uint? NetID => ContentNetIDs.PUMP_BARREL;
public override int ShotsLeft
{

View File

@@ -4,7 +4,6 @@ using Content.Server.Weapon.Ranged.Ammunition.Components;
using Content.Shared.ActionBlocker;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.NetIDs;
using Content.Shared.Notification.Managers;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Ranged.Barrels.Components;
@@ -12,6 +11,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
@@ -25,12 +25,12 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.Weapon.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public sealed class RevolverBarrelComponent : ServerRangedBarrelComponent, ISerializationHooks
{
[Dependency] private readonly IRobustRandom _random = default!;
public override string Name => "RevolverBarrel";
public override uint? NetID => ContentNetIDs.REVOLVER_BARREL;
[ViewVariables]
[DataField("caliber")]

View File

@@ -9,13 +9,13 @@ using Content.Shared.ActionBlocker;
using Content.Shared.Damage;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.NetIDs;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Ranged.Barrels.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
@@ -26,10 +26,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.Weapon.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public sealed class ServerBatteryBarrelComponent : ServerRangedBarrelComponent
{
public override string Name => "BatteryBarrel";
public override uint? NetID => ContentNetIDs.BATTERY_BARREL;
// The minimum change we need before we can fire
[DataField("lowerChargeLimit")]

View File

@@ -8,7 +8,6 @@ using Content.Shared.ActionBlocker;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.NetIDs;
using Content.Shared.Notification.Managers;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Ranged;
@@ -17,6 +16,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
@@ -28,10 +28,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.Weapon.Ranged.Barrels.Components
{
[RegisterComponent]
[NetworkedComponent()]
public sealed class ServerMagazineBarrelComponent : ServerRangedBarrelComponent, IExamine
{
public override string Name => "MagazineBarrel";
public override uint? NetID => ContentNetIDs.MAGAZINE_BARREL;
[ViewVariables]
private ContainerSlot _chamberContainer = default!;

View File

@@ -4,8 +4,8 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Actions.Prototypes;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Players;
@@ -29,6 +29,7 @@ namespace Content.Shared.Actions.Components
/// may be unusable while the player is stunned, but this component will still have an entry for the action
/// so the user can see whether it's currently toggled on or off.
/// </summary>
[NetworkedComponent()]
public abstract class SharedActionsComponent : Component
{
private static readonly TimeSpan CooldownExpiryThreshold = TimeSpan.FromSeconds(10);
@@ -41,7 +42,6 @@ namespace Content.Shared.Actions.Components
protected readonly IEntityManager EntityManager = default!;
public override string Name => "Actions";
public override uint? NetID => ContentNetIDs.ACTIONS;
/// <summary>
/// Actions granted to this entity as soon as they spawn, regardless
@@ -405,7 +405,7 @@ namespace Content.Shared.Actions.Components
public Dictionary<EntityUid, Dictionary<ItemActionType, ActionState>> ItemActions;
public ActionComponentState(Dictionary<ActionType, ActionState> actions,
Dictionary<EntityUid, Dictionary<ItemActionType, ActionState>> itemActions) : base(ContentNetIDs.ACTIONS)
Dictionary<EntityUid, Dictionary<ItemActionType, ActionState>> itemActions)
{
Actions = actions;
ItemActions = itemActions;

View File

@@ -1,8 +1,8 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Players;
@@ -15,13 +15,13 @@ namespace Content.Shared.Alert
/// Handles the icons on the right side of the screen.
/// Should only be used for player-controlled entities.
/// </summary>
[NetworkedComponent()]
public abstract class SharedAlertsComponent : Component
{
[Dependency]
protected readonly AlertManager AlertManager = default!;
public override string Name => "Alerts";
public override uint? NetID => ContentNetIDs.ALERTS;
[ViewVariables] private Dictionary<AlertKey, AlertState> _alerts = new();
@@ -169,7 +169,7 @@ namespace Content.Shared.Alert
{
public Dictionary<AlertKey, AlertState> Alerts;
public AlertsComponentState(Dictionary<AlertKey, AlertState> alerts) : base(ContentNetIDs.ALERTS)
public AlertsComponentState(Dictionary<AlertKey, AlertState> alerts)
{
Alerts = alerts;
}

View File

@@ -1,15 +1,13 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.Arcade
{
public class SharedSpaceVillainArcadeComponent : Component
public abstract class SharedSpaceVillainArcadeComponent : Component
{
public override string Name => "SpaceVillainArcade";
public override uint? NetID => ContentNetIDs.SPACE_VILLAIN_ARCADE;
[Serializable, NetSerializable]
public enum Indicators

View File

@@ -1,15 +1,15 @@
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Localization;
using Robust.Shared.Serialization;
namespace Content.Shared.Atmos.Components
{
[NetworkedComponent()]
public class SharedGasAnalyzerComponent : Component
{
public override string Name => "GasAnalyzer";
public override uint? NetID => ContentNetIDs.GAS_ANALYZER;
[Serializable, NetSerializable]
public enum GasAnalyzerUiKey
@@ -77,7 +77,7 @@ namespace Content.Shared.Atmos.Components
{
public GasAnalyzerDanger Danger;
public GasAnalyzerComponentState(GasAnalyzerDanger danger) : base(ContentNetIDs.GAS_ANALYZER)
public GasAnalyzerComponentState(GasAnalyzerDanger danger)
{
Danger = danger;
}

View File

@@ -12,9 +12,9 @@ using Content.Shared.Body.Template;
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Content.Shared.Standing;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Players;
using Robust.Shared.Prototypes;
@@ -26,14 +26,14 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Body.Components
{
// TODO BODY Damage methods for collections of IDamageableComponents
[NetworkedComponent()]
public abstract class SharedBodyComponent : Component, IBodyPartContainer, ISerializationHooks
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public override string Name => "Body";
public override uint? NetID => ContentNetIDs.BODY;
[ViewVariables]
[DataField("template", required: true)]
private string? TemplateId { get; } = default;
@@ -711,7 +711,7 @@ namespace Content.Shared.Body.Components
public readonly (string slot, EntityUid partId)[] PartIds;
public BodyComponentState((string slot, EntityUid partId)[] partIds) : base(ContentNetIDs.BODY)
public BodyComponentState((string slot, EntityUid partId)[] partIds)
{
PartIds = partIds;
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -8,8 +8,8 @@ using Content.Shared.Body.Components;
using Content.Shared.Body.Mechanism;
using Content.Shared.Body.Part.Property;
using Content.Shared.Body.Surgery;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Players;
@@ -20,12 +20,11 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Body.Part
{
[NetworkedComponent()]
public abstract class SharedBodyPartComponent : Component, IBodyPartContainer
{
public override string Name => "BodyPart";
public override uint? NetID => ContentNetIDs.BODY_PART;
private SharedBodyComponent? _body;
// TODO BODY Remove
@@ -384,7 +383,7 @@ namespace Content.Shared.Body.Part
public readonly EntityUid[] MechanismIds;
public BodyPartComponentState(EntityUid[] mechanismIds) : base(ContentNetIDs.BODY_PART)
public BodyPartComponentState(EntityUid[] mechanismIds)
{
MechanismIds = mechanismIds;
}

View File

@@ -4,20 +4,19 @@ using Content.Shared.ActionBlocker;
using Content.Shared.DragDrop;
using Content.Shared.EffectBlocker;
using Content.Shared.Interaction;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Buckle.Components
{
[NetworkedComponent()]
public abstract class SharedBuckleComponent : Component, IActionBlocker, IEffectBlocker, IDraggable
{
public sealed override string Name => "Buckle";
public sealed override uint? NetID => ContentNetIDs.BUCKLE;
/// <summary>
/// The range from which this entity can buckle to a <see cref="SharedStrapComponent"/>.
/// </summary>
@@ -64,7 +63,7 @@ namespace Content.Shared.Buckle.Components
[Serializable, NetSerializable]
public sealed class BuckleComponentState : ComponentState
{
public BuckleComponentState(bool buckled, int? drawDepth, EntityUid? lastEntityBuckledTo, bool dontCollide) : base(ContentNetIDs.BUCKLE)
public BuckleComponentState(bool buckled, int? drawDepth, EntityUid? lastEntityBuckledTo, bool dontCollide)
{
Buckled = buckled;
DrawDepth = drawDepth;

View File

@@ -1,9 +1,9 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.DragDrop;
using Content.Shared.Interaction.Helpers;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Buckle.Components
@@ -26,12 +26,11 @@ namespace Content.Shared.Buckle.Components
Down
}
[NetworkedComponent()]
public abstract class SharedStrapComponent : Component, IDragDropOn
{
public sealed override string Name => "Strap";
public sealed override uint? NetID => ContentNetIDs.STRAP;
bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs)
{
if (!eventArgs.Dragged.TryGetComponent(out SharedBuckleComponent? buckleComponent)) return false;
@@ -46,7 +45,7 @@ namespace Content.Shared.Buckle.Components
[Serializable, NetSerializable]
public sealed class StrapComponentState : ComponentState
{
public StrapComponentState(StrapPosition position) : base(ContentNetIDs.BUCKLE)
public StrapComponentState(StrapPosition position)
{
Position = position;
}

View File

@@ -1,18 +1,17 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
namespace Content.Shared.Camera
{
[NetworkedComponent()]
public abstract class SharedCameraRecoilComponent : Component
{
public sealed override string Name => "CameraRecoil";
public override uint? NetID => ContentNetIDs.CAMERA_RECOIL;
public abstract void Kick(Vector2 recoil);
[Serializable, NetSerializable]

View File

@@ -1,16 +1,16 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Cargo.Components
{
[NetworkedComponent()]
public class SharedCargoOrderDatabaseComponent : Component
{
public sealed override string Name => "CargoOrderDatabase";
public sealed override uint? NetID => ContentNetIDs.CARGO_ORDER_DATABASE;
}
[NetSerializable, Serializable]
@@ -18,7 +18,7 @@ namespace Content.Shared.Cargo.Components
{
public readonly List<CargoOrderData>? Orders;
public CargoOrderDatabaseState(List<CargoOrderData>? orders) : base(ContentNetIDs.CARGO_ORDER_DATABASE)
public CargoOrderDatabaseState(List<CargoOrderData>? orders)
{
Orders = orders;
}

View File

@@ -1,9 +1,9 @@
#nullable enable
#nullable enable
using System;
using System.Collections;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -11,10 +11,10 @@ using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Cargo.Components
{
[NetworkedComponent()]
public class SharedGalacticMarketComponent : Component, IEnumerable<CargoProductPrototype>, ISerializationHooks
{
public sealed override string Name => "GalacticMarket";
public sealed override uint? NetID => ContentNetIDs.GALACTIC_MARKET;
[DataField("products")]
protected List<string> _productIds = new();
@@ -98,7 +98,7 @@ namespace Content.Shared.Cargo.Components
public class GalacticMarketState : ComponentState
{
public List<string> Products;
public GalacticMarketState(List<string> technologies) : base(ContentNetIDs.GALACTIC_MARKET)
public GalacticMarketState(List<string> technologies)
{
Products = technologies;
}

View File

@@ -1,10 +1,10 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.NetIDs;
using Content.Shared.Preferences;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.Localization;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -12,6 +12,7 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.CharacterAppearance.Components
{
[NetworkedComponent()]
public abstract class SharedHumanoidAppearanceComponent : Component
{
private HumanoidCharacterAppearance _appearance = HumanoidCharacterAppearance.Default();
@@ -19,7 +20,6 @@ namespace Content.Shared.CharacterAppearance.Components
private Gender _gender;
public sealed override string Name => "HumanoidAppearance";
public sealed override uint? NetID => ContentNetIDs.HUMANOID_APPEARANCE;
[DataField("categoriesHair")]
[ViewVariables]
@@ -105,8 +105,7 @@ namespace Content.Shared.CharacterAppearance.Components
[NetSerializable]
private sealed class HumanoidAppearanceComponentState : ComponentState
{
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex, Gender gender) :
base(ContentNetIDs.HUMANOID_APPEARANCE)
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex, Gender gender)
{
Appearance = appearance;
Sex = sex;

View File

@@ -1,17 +1,17 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Content.Shared.Objectives;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.CharacterInfo
{
[NetworkedComponent()]
public class SharedCharacterInfoComponent : Component
{
public override string Name => "CharacterInfo";
public override uint? NetID => ContentNetIDs.CHARACTERINFO;
[Serializable, NetSerializable]
protected class RequestCharacterInfoMessage : ComponentMessage

View File

@@ -1,16 +1,16 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Chemistry.Components
{
[NetworkedComponent()]
public abstract class SharedHyposprayComponent : Component
{
public sealed override string Name => "Hypospray";
public sealed override uint? NetID => ContentNetIDs.HYPOSPRAY;
[Serializable, NetSerializable]
protected sealed class HyposprayComponentState : ComponentState
@@ -18,7 +18,7 @@ namespace Content.Shared.Chemistry.Components
public ReagentUnit CurVolume { get; }
public ReagentUnit MaxVolume { get; }
public HyposprayComponentState(ReagentUnit curVolume, ReagentUnit maxVolume) : base(ContentNetIDs.HYPOSPRAY)
public HyposprayComponentState(ReagentUnit curVolume, ReagentUnit maxVolume)
{
CurVolume = curVolume;
MaxVolume = maxVolume;

View File

@@ -1,8 +1,8 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Chemistry.Components
@@ -10,10 +10,10 @@ namespace Content.Shared.Chemistry.Components
/// <summary>
/// Shared class for injectors & syringes
/// </summary>
[NetworkedComponent()]
public class SharedInjectorComponent : Component
{
public override string Name => "Injector";
public sealed override uint? NetID => ContentNetIDs.REAGENT_INJECTOR;
/// <summary>
/// Component data used for net updates. Used by client for item status ui
@@ -25,7 +25,7 @@ namespace Content.Shared.Chemistry.Components
public ReagentUnit TotalVolume { get; }
public InjectorToggleMode CurrentMode { get; }
public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode) : base(ContentNetIDs.REAGENT_INJECTOR)
public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode)
{
CurrentVolume = currentVolume;
TotalVolume = totalVolume;

View File

@@ -4,8 +4,8 @@ using System.Collections.Generic;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Examine;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
@@ -22,13 +22,11 @@ namespace Content.Shared.Chemistry.Solution.Components
/// <summary>
/// Holds a <see cref="Solution"/> with a limited volume.
/// </summary>
[NetworkedComponent()]
public abstract class SharedSolutionContainerComponent : Component, IExamine, ISolutionInteractionsComponent
{
public override string Name => "SolutionContainer";
/// <inheritdoc />
public sealed override uint? NetID => ContentNetIDs.SOLUTION;
[ViewVariables]
[DataField("contents")]
public Solution Solution { get; private set; } = new();
@@ -324,7 +322,7 @@ namespace Content.Shared.Chemistry.Solution.Components
{
public readonly Solution Solution;
public SolutionContainerComponentState(Solution solution) : base(ContentNetIDs.SOLUTION)
public SolutionContainerComponentState(Solution solution)
{
Solution = solution;
}

View File

@@ -1,19 +1,19 @@
#nullable enable
using System;
using Content.Shared.ActionBlocker;
using Content.Shared.NetIDs;
using Content.Shared.Physics;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Physics;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Climbing
{
[NetworkedComponent()]
public abstract class SharedClimbingComponent : Component, IActionBlocker
{
public sealed override string Name => "Climbing";
public sealed override uint? NetID => ContentNetIDs.CLIMBING;
protected bool IsOnClimbableThisFrame
{
@@ -99,7 +99,7 @@ namespace Content.Shared.Climbing
[Serializable, NetSerializable]
protected sealed class ClimbModeComponentState : ComponentState
{
public ClimbModeComponentState(bool climbing, bool isTransitioning) : base(ContentNetIDs.CLIMBING)
public ClimbModeComponentState(bool climbing, bool isTransitioning)
{
Climbing = climbing;
IsTransitioning = isTransitioning;

View File

@@ -1,6 +1,5 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -13,7 +12,7 @@ namespace Content.Shared.Clothing
public string? EquippedPrefix { get; }
public ClothingComponentState(string? clothingEquippedPrefix, string? equippedPrefix) : base(ContentNetIDs.CLOTHING)
public ClothingComponentState(string? clothingEquippedPrefix, string? equippedPrefix)
{
ClothingEquippedPrefix = clothingEquippedPrefix;
EquippedPrefix = equippedPrefix;

View File

@@ -1,16 +1,16 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Clothing
{
[NetworkedComponent()]
public abstract class SharedMagbootsComponent : Component, IMoveSpeedModifier
{
public sealed override string Name => "Magboots";
public sealed override uint? NetID => ContentNetIDs.MAGBOOTS;
public abstract bool On { get; set; }
@@ -28,7 +28,7 @@ namespace Content.Shared.Clothing
{
public bool On { get; }
public MagbootsComponentState(bool @on) : base(ContentNetIDs.MAGBOOTS)
public MagbootsComponentState(bool @on)
{
On = on;
}

View File

@@ -1,17 +1,17 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Content.Shared.Targeting;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.CombatMode
{
[NetworkedComponent()]
public abstract class SharedCombatModeComponent : Component
{
public sealed override uint? NetID => ContentNetIDs.COMBATMODE;
public override string Name => "CombatMode";
private bool _isInCombatMode;
@@ -78,7 +78,6 @@ namespace Content.Shared.CombatMode
public TargetingZone TargetingZone { get; }
public CombatModeComponentState(bool isInCombatMode, TargetingZone targetingZone)
: base(ContentNetIDs.COMBATMODE)
{
IsInCombatMode = isInCombatMode;
TargetingZone = targetingZone;

View File

@@ -1,7 +1,7 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -12,10 +12,10 @@ namespace Content.Shared.Cooldown
/// Stores a visual "cooldown" for items, that gets displayed in the hands GUI.
/// </summary>
[RegisterComponent]
[NetworkedComponent()]
public sealed class ItemCooldownComponent : Component
{
public override string Name => "ItemCooldown";
public override uint? NetID => ContentNetIDs.ITEMCOOLDOWN;
private TimeSpan? _cooldownEnd;
private TimeSpan? _cooldownStart;
@@ -80,8 +80,7 @@ namespace Content.Shared.Cooldown
public TimeSpan? CooldownStart { get; set; }
public TimeSpan? CooldownEnd { get; set; }
public ItemCooldownComponentState() : base(ContentNetIDs.ITEMCOOLDOWN)
{
public ItemCooldownComponentState() {
}
}
}

View File

@@ -1,8 +1,8 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -11,10 +11,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Crayon
{
[NetworkedComponent()]
public class SharedCrayonComponent : Component
{
public override string Name => "Crayon";
public override uint? NetID => ContentNetIDs.CRAYONS;
public string SelectedState { get; set; } = string.Empty;
@@ -54,7 +54,7 @@ namespace Content.Shared.Crayon
public readonly int Charges;
public readonly int Capacity;
public CrayonComponentState(string color, string state, int charges, int capacity) : base(ContentNetIDs.CRAYONS)
public CrayonComponentState(string color, string state, int charges, int capacity)
{
Color = color;
State = state;

View File

@@ -1,19 +1,19 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.ActionBlocker;
using Content.Shared.NetIDs;
using Content.Shared.Pulling.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Cuffs.Components
{
[NetworkedComponent()]
public class SharedCuffableComponent : Component, IActionBlocker
{
public override string Name => "Cuffable";
public override uint? NetID => ContentNetIDs.CUFFED;
[ComponentDependency] private readonly SharedPullableComponent? _pullable = default!;
@@ -42,7 +42,7 @@ namespace Content.Shared.Cuffs.Components
public string IconState { get; }
public Color Color { get; }
public CuffableComponentState(int numHandsCuffed, bool canStillInteract, string? rsiPath, string iconState, Color color) : base(ContentNetIDs.CUFFED)
public CuffableComponentState(int numHandsCuffed, bool canStillInteract, string? rsiPath, string iconState, Color color)
{
NumHandsCuffed = numHandsCuffed;
CanStillInteract = canStillInteract;

View File

@@ -1,22 +1,22 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Cuffs.Components
{
[NetworkedComponent()]
public abstract class SharedHandcuffComponent : Component
{
public override string Name => "Handcuff";
public override uint? NetID => ContentNetIDs.HANDCUFFS;
[Serializable, NetSerializable]
protected sealed class HandcuffedComponentState : ComponentState
{
public string? IconState { get; }
public HandcuffedComponentState(string? iconState) : base(ContentNetIDs.HANDCUFFS)
public HandcuffedComponentState(string? iconState)
{
IconState = iconState;
}

View File

@@ -5,9 +5,9 @@ using System.Linq;
using Content.Shared.Acts;
using Content.Shared.Damage.Container;
using Content.Shared.Damage.Resistances;
using Content.Shared.NetIDs;
using Content.Shared.Radiation;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Players;
using Robust.Shared.Prototypes;
@@ -23,12 +23,11 @@ namespace Content.Shared.Damage.Components
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(IDamageableComponent))]
[NetworkedComponent()]
public class DamageableComponent : Component, IDamageableComponent, IRadiationAct, ISerializationHooks
{
public override string Name => "Damageable";
public override uint? NetID => ContentNetIDs.DAMAGEABLE;
// TODO define these in yaml?
public const string DefaultResistanceSet = "defaultResistances";
public const string DefaultDamageContainer = "metallicDamageContainer";
@@ -411,7 +410,7 @@ namespace Content.Shared.Damage.Components
{
public readonly Dictionary<DamageType, int> DamageList;
public DamageableComponentState(Dictionary<DamageType, int> damageList) : base(ContentNetIDs.DAMAGEABLE)
public DamageableComponentState(Dictionary<DamageType, int> damageList)
{
DamageList = damageList;
}

View File

@@ -1,18 +1,17 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Shared.DoAfter
{
[NetworkedComponent()]
public abstract class SharedDoAfterComponent : Component
{
public override string Name => "DoAfter";
public override uint? NetID => ContentNetIDs.DO_AFTER;
}
[Serializable, NetSerializable]
@@ -20,7 +19,7 @@ namespace Content.Shared.DoAfter
{
public List<ClientDoAfter> DoAfters { get; }
public DoAfterComponentState(List<ClientDoAfter> doAfters) : base(ContentNetIDs.DO_AFTER)
public DoAfterComponentState(List<ClientDoAfter> doAfters)
{
DoAfters = doAfters;
}

View File

@@ -1,8 +1,8 @@
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Physics;
using Robust.Shared.Serialization;
@@ -12,10 +12,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Doors
{
[NetworkedComponent()]
public abstract class SharedDoorComponent : Component
{
public override string Name => "Door";
public override uint? NetID => ContentNetIDs.DOOR;
[ComponentDependency]
protected readonly SharedAppearanceComponent? AppearanceComponent = null;
@@ -167,7 +167,7 @@ namespace Content.Shared.Doors
public readonly List<EntityUid> CurrentlyCrushing;
public readonly TimeSpan CurTime;
public DoorComponentState(SharedDoorComponent.DoorState doorState, TimeSpan? startTime, List<EntityUid> currentlyCrushing, TimeSpan curTime) : base(ContentNetIDs.DOOR)
public DoorComponentState(SharedDoorComponent.DoorState doorState, TimeSpan? startTime, List<EntityUid> currentlyCrushing, TimeSpan curTime)
{
DoorState = doorState;
StartTime = startTime;

View File

@@ -1,15 +1,15 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Flash
{
[NetworkedComponent()]
public class SharedFlashableComponent : Component
{
public override string Name => "Flashable";
public override uint? NetID => ContentNetIDs.FLASHABLE;
}
[Serializable, NetSerializable]
@@ -18,7 +18,7 @@ namespace Content.Shared.Flash
public double Duration { get; }
public TimeSpan Time { get; }
public FlashComponentState(double duration, TimeSpan time) : base(ContentNetIDs.FLASHABLE)
public FlashComponentState(double duration, TimeSpan time)
{
Duration = duration;
Time = time;

View File

@@ -1,6 +1,5 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Players;
@@ -50,7 +49,7 @@ namespace Content.Shared.Friction
{
public float Modifier;
public TileFrictionComponentState(float modifier) : base(ContentNetIDs.TILE_FRICTION)
public TileFrictionComponentState(float modifier)
{
Modifier = modifier;
}

View File

@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using Content.Shared.ActionBlocker;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -10,10 +10,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Ghost
{
[NetworkedComponent()]
public class SharedGhostComponent : Component, IActionBlocker
{
public override string Name => "Ghost";
public override uint? NetID => ContentNetIDs.GHOST;
/// <summary>
/// Changed by <see cref="GhostChangeCanReturnToBodyEvent"/>
@@ -61,7 +61,6 @@ namespace Content.Shared.Ghost
bool canReturnToBody,
HashSet<string>? locationWarps = null,
Dictionary<EntityUid, string>? playerWarps = null)
: base(ContentNetIDs.GHOST)
{
CanReturnToBody = canReturnToBody;
LocationWarps = locationWarps;

View File

@@ -1,6 +1,6 @@
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Log;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
@@ -9,10 +9,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Gravity
{
[RegisterComponent]
[NetworkedComponent]
public sealed class GravityComponent : Component
{
public override string Name => "Gravity";
public override uint? NetID => ContentNetIDs.GRAVITY;
[ViewVariables(VVAccess.ReadWrite)]
public bool Enabled
@@ -53,7 +53,7 @@ namespace Content.Shared.Gravity
{
public bool Enabled { get; }
public GravityComponentState(bool enabled) : base(ContentNetIDs.GRAVITY)
public GravityComponentState(bool enabled)
{
Enabled = enabled;
}

View File

@@ -1,17 +1,16 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Gravity
{
[NetworkedComponent()]
public class SharedGravityGeneratorComponent : Component
{
public override string Name => "GravityGenerator";
public override uint? NetID => ContentNetIDs.GRAVITY_GENERATOR;
/// <summary>
/// Sent to the server to set whether the generator should be on or off
/// </summary>

View File

@@ -5,9 +5,9 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.ActionBlocker;
using Content.Shared.Interaction;
using Content.Shared.NetIDs;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
@@ -19,12 +19,11 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Hands.Components
{
[NetworkedComponent()]
public abstract class SharedHandsComponent : Component, ISharedHandsComponent
{
public sealed override string Name => "Hands";
public sealed override uint? NetID => ContentNetIDs.HANDS;
public event Action? OnItemChanged; //TODO: Try to replace C# event
/// <summary>
@@ -867,7 +866,7 @@ namespace Content.Shared.Hands.Components
public HandState[] Hands { get; }
public string? ActiveHand { get; }
public HandsComponentState(HandState[] hands, string? activeHand = null) : base(ContentNetIDs.HANDS)
public HandsComponentState(HandState[] hands, string? activeHand = null)
{
Hands = hands;
ActiveHand = activeHand;

View File

@@ -1,17 +1,17 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.Audio.Midi;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Instruments
{
[NetworkedComponent()]
public class SharedInstrumentComponent : Component
{
public override string Name => "Instrument";
public override uint? NetID => ContentNetIDs.INSTRUMENTS;
[ViewVariables(VVAccess.ReadWrite)]
public virtual byte InstrumentProgram { get; set; }
@@ -75,7 +75,7 @@ namespace Content.Shared.Instruments
public bool AllowProgramChange { get; }
public bool RespectMidiLimits { get; }
public InstrumentState(bool playing, byte instrumentProgram, byte instrumentBank, bool allowPercussion, bool allowProgramChange, bool respectMidiLimits, uint sequencerTick = 0) : base(ContentNetIDs.INSTRUMENTS)
public InstrumentState(bool playing, byte instrumentProgram, byte instrumentBank, bool allowPercussion, bool allowProgramChange, bool respectMidiLimits, uint sequencerTick = 0)
{
Playing = playing;
InstrumentProgram = instrumentProgram;

View File

@@ -1,8 +1,8 @@
using System;
using System;
using System.Collections.Generic;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Reflection;
using Robust.Shared.Serialization;
@@ -13,13 +13,13 @@ using static Content.Shared.Inventory.EquipmentSlotDefines;
namespace Content.Shared.Inventory
{
[NetworkedComponent()]
public abstract class SharedInventoryComponent : Component, IMoveSpeedModifier
{
[Dependency] protected readonly IReflectionManager ReflectionManager = default!;
[Dependency] protected readonly IDynamicTypeFactory DynamicTypeFactory = default!;
public sealed override string Name => "Inventory";
public sealed override uint? NetID => ContentNetIDs.STORAGE;
[ViewVariables]
protected Inventory InventoryInstance { get; private set; } = default!;
@@ -52,7 +52,7 @@ namespace Content.Shared.Inventory
public List<KeyValuePair<Slots, EntityUid>> Entities { get; }
public KeyValuePair<Slots, (EntityUid entity, bool fits)>? HoverEntity { get; }
public InventoryComponentState(List<KeyValuePair<Slots, EntityUid>> entities, KeyValuePair<Slots, (EntityUid entity, bool fits)>? hoverEntity = null) : base(ContentNetIDs.STORAGE)
public InventoryComponentState(List<KeyValuePair<Slots, EntityUid>> entities, KeyValuePair<Slots, (EntityUid entity, bool fits)>? hoverEntity = null)
{
Entities = entities;
HoverEntity = hoverEntity;

View File

@@ -5,8 +5,8 @@ using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Helpers;
using Content.Shared.Inventory;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Players;
@@ -19,12 +19,11 @@ namespace Content.Shared.Item
/// <summary>
/// Players can pick up, drop, and put items in bags, and they can be seen in player's hands.
/// </summary>
[NetworkedComponent()]
public abstract class SharedItemComponent : Component, IEquipped, IUnequipped, IInteractHand
{
public override string Name => "Item";
public override uint? NetID => ContentNetIDs.ITEM;
/// <summary>
/// How much big this item is.
/// </summary>
@@ -169,7 +168,7 @@ namespace Content.Shared.Item
public Color Color { get; }
public string? RsiPath { get; }
public ItemComponentState(int size, string? equippedPrefix, Color color, string? rsiPath) : base(ContentNetIDs.ITEM)
public ItemComponentState(int size, string? equippedPrefix, Color color, string? rsiPath)
{
Size = size;
EquippedPrefix = equippedPrefix;

View File

@@ -1,18 +1,18 @@
#nullable enable
using System;
using Content.Shared.Chemistry.Solution;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Kitchen.Components
{
[NetworkedComponent()]
public class SharedMicrowaveComponent : Component
{
public override string Name => "Microwave";
public override uint? NetID => ContentNetIDs.MICROWAVE;
[Serializable, NetSerializable]
public class MicrowaveStartCookMessage : BoundUserInterfaceMessage

View File

@@ -1,7 +1,6 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.Chemistry.Solution;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -10,7 +9,6 @@ namespace Content.Shared.Kitchen.Components
public abstract class SharedReagentGrinderComponent : Component
{
public override string Name => "ReagentGrinder";
public override uint? NetID => ContentNetIDs.REAGENT_GRINDER;
[Serializable, NetSerializable]
public class ReagentGrinderGrindStartMessage : BoundUserInterfaceMessage

View File

@@ -1,21 +1,21 @@
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Content.Shared.Research.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Lathe
{
[NetworkedComponent()]
public class SharedLatheComponent : Component
{
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
public override string Name => "Lathe";
public override uint? NetID => ContentNetIDs.LATHE;
public bool CanProduce(LatheRecipePrototype recipe, int quantity = 1)
{

View File

@@ -2,9 +2,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Content.Shared.Research.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -12,10 +12,10 @@ using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Lathe
{
[NetworkedComponent()]
public class SharedLatheDatabaseComponent : Component, IEnumerable<LatheRecipePrototype>, ISerializationHooks
{
public override string Name => "LatheDatabase";
public override uint? NetID => ContentNetIDs.LATHE_DATABASE;
[DataField("recipes")] private List<string> _recipeIds = new();
@@ -127,7 +127,7 @@ namespace Content.Shared.Lathe
public class LatheDatabaseState : ComponentState
{
public readonly List<string> Recipes;
public LatheDatabaseState(List<string> recipes) : base(ContentNetIDs.LATHE_DATABASE)
public LatheDatabaseState(List<string> recipes)
{
Recipes = recipes;
}

View File

@@ -3,17 +3,17 @@ using System;
using System.Collections;
using System.Collections.Generic;
using Content.Shared.Materials;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Lathe
{
[NetworkedComponent()]
public class SharedMaterialStorageComponent : Component, IEnumerable<KeyValuePair<string, int>>
{
public override string Name => "MaterialStorage";
public sealed override uint? NetID => ContentNetIDs.MATERIAL_STORAGE;
[ViewVariables]
protected virtual Dictionary<string, int> Storage { get; set; } = new();
@@ -72,7 +72,7 @@ namespace Content.Shared.Lathe
public class MaterialStorageState : ComponentState
{
public readonly Dictionary<string, int> Storage;
public MaterialStorageState(Dictionary<string, int> storage) : base(ContentNetIDs.MATERIAL_STORAGE)
public MaterialStorageState(Dictionary<string, int> storage)
{
Storage = storage;
}

View File

@@ -1,9 +1,9 @@
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Content.Shared.Research.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -12,14 +12,13 @@ using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Lathe
{
[ComponentReference(typeof(SharedLatheDatabaseComponent))]
[NetworkedComponent()]
public class SharedProtolatheDatabaseComponent : SharedLatheDatabaseComponent, ISerializationHooks
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public override string Name => "ProtolatheDatabase";
public sealed override uint? NetID => ContentNetIDs.PROTOLATHE_DATABASE;
[DataField("protolatherecipes")] private List<string> _recipeIds = new();
/// <summary>
@@ -41,7 +40,7 @@ namespace Content.Shared.Lathe
public class ProtolatheDatabaseState : ComponentState
{
public readonly List<string> Recipes;
public ProtolatheDatabaseState(List<string> recipes) : base(ContentNetIDs.PROTOLATHE_DATABASE)
public ProtolatheDatabaseState(List<string> recipes)
{
Recipes = recipes;
}

View File

@@ -1,15 +1,15 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Light.Component
{
[NetworkedComponent()]
public abstract class SharedHandheldLightComponent : Robust.Shared.GameObjects.Component
{
public sealed override string Name => "HandheldLight";
public sealed override uint? NetID => ContentNetIDs.HANDHELD_LIGHT;
protected abstract bool HasCell { get; }
@@ -20,7 +20,7 @@ namespace Content.Shared.Light.Component
{
public byte? Charge { get; }
public HandheldLightComponentState(byte? charge) : base(ContentNetIDs.HANDHELD_LIGHT)
public HandheldLightComponentState(byte? charge)
{
Charge = charge;
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -8,8 +8,8 @@ using Content.Shared.Alert;
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
using Content.Shared.MobState.State;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -23,12 +23,11 @@ namespace Content.Shared.MobState.Components
/// Additionally, it handles sending effects to clients
/// (such as blur effect for unconsciousness) and managing the health HUD.
/// </summary>
[NetworkedComponent()]
public abstract class SharedMobStateComponent : Component, IMobStateComponent, IActionBlocker
{
public override string Name => "MobState";
public override uint? NetID => ContentNetIDs.MOB_STATE;
/// <summary>
/// States that this <see cref="SharedMobStateComponent"/> mapped to
/// the amount of damage at which they are triggered.
@@ -401,7 +400,7 @@ namespace Content.Shared.MobState.Components
{
public readonly int? CurrentThreshold;
public MobStateComponentState(int? currentThreshold) : base(ContentNetIDs.MOB_STATE)
public MobStateComponentState(int? currentThreshold)
{
CurrentThreshold = currentThreshold;
}

View File

@@ -1,9 +1,9 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.CCVar;
using Content.Shared.NetIDs;
using Robust.Shared.Configuration;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Players;
@@ -15,6 +15,7 @@ namespace Content.Shared.Movement.Components
{
[RegisterComponent]
[ComponentReference(typeof(IMoverComponent))]
[NetworkedComponent()]
public class SharedPlayerInputMoverComponent : Component, IMoverComponent
{
// This class has to be able to handle server TPS being lower than client FPS.
@@ -42,7 +43,6 @@ namespace Content.Shared.Movement.Components
[ComponentDependency] private readonly MovementSpeedModifierComponent? _movementSpeed = default!;
public override string Name => "PlayerInputMover";
public override uint? NetID => ContentNetIDs.PLAYER_INPUT_MOVER;
private GameTick _lastInputTick;
private ushort _lastInputSubTick;
@@ -238,8 +238,7 @@ namespace Content.Shared.Movement.Components
{
public MoveButtons Buttons { get; }
public MoverComponentState(MoveButtons buttons) : base(ContentNetIDs
.PLAYER_INPUT_MOVER)
public MoverComponentState(MoveButtons buttons)
{
Buttons = buttons;
}

View File

@@ -1,7 +1,7 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Players;
@@ -16,10 +16,10 @@ namespace Content.Shared.Movement.Components
/// </summary>
[RegisterComponent]
[ComponentReference(typeof(IMobMoverComponent))]
[NetworkedComponent()]
public class SharedPlayerMobMoverComponent : Component, IMobMoverComponent
{
public override string Name => "PlayerMobMover";
public override uint? NetID => ContentNetIDs.PLAYER_MOB_MOVER;
private float _stepSoundDistance;
[DataField("grabRange")]
@@ -112,7 +112,7 @@ namespace Content.Shared.Movement.Components
public float PushStrength;
public float WeightlessStrength;
public PlayerMobMoverComponentState(float grabRange, float pushStrength, float weightlessStrength) : base(ContentNetIDs.PLAYER_MOB_MOVER)
public PlayerMobMoverComponentState(float grabRange, float pushStrength, float weightlessStrength)
{
GrabRange = grabRange;
PushStrength = pushStrength;

View File

@@ -1,108 +0,0 @@
#nullable enable
namespace Content.Shared.NetIDs
{
// Starting from 1000 to avoid crossover with engine.
public static class ContentNetIDs
{
// As a CMO main I hereby declare the hypospray worthy of ID #1000.
public const uint HYPOSPRAY = 1000;
public const uint DESTRUCTIBLE = 1001;
public const uint MAGAZINE_BARREL = 1002;
public const uint HANDS = 1003;
public const uint SOLUTION = 1004;
public const uint STORAGE = 1005;
public const uint INVENTORY = 1006;
public const uint POWER_DEBUG_TOOL = 1007;
public const uint PLAYER_MOB_MOVER = 1008;
public const uint TILE_FRICTION = 1009;
public const uint RANGED_WEAPON = 1010;
public const uint CAMERA_RECOIL = 1011;
public const uint SOUND = 1012;
public const uint ITEM = 1013;
public const uint CLOTHING = 1014;
public const uint ENTITYSTORAGE = 1015;
public const uint LATHE = 1016;
public const uint LATHE_DATABASE = 1017;
public const uint MATERIAL_STORAGE = 1018;
public const uint HAND_TELEPORTER = 1019;
public const uint VENDING_MACHINE = 1020;
public const uint PROTOLATHE_DATABASE = 1021;
public const uint TECHNOLOGY_DATABASE = 1022;
public const uint RESEARCH_CONSOLE = 1023;
public const uint WIRES = 1024;
public const uint COMBATMODE = 1025;
public const uint ALERTS = 1026;
public const uint OVERLAYEFFECTS = 1027;
public const uint STOMACH = 1028;
public const uint ITEMCOOLDOWN = 1029;
public const uint CARGO_ORDER_DATABASE = 1030;
public const uint GALACTIC_MARKET = 1031;
public const uint HUMANOID_APPEARANCE = 1032;
public const uint INSTRUMENTS = 1033;
public const uint WELDER = 1034;
public const uint STACK = 1035;
public const uint HANDHELD_LIGHT = 1036;
public const uint PAPER = 1037;
public const uint REAGENT_INJECTOR = 1038;
public const uint GHOST = 1039;
public const uint MICROWAVE = 1040;
public const uint GRAVITY_GENERATOR = 1041;
public const uint SURGERY = 1042;
public const uint MULTITOOLS = 1043;
public const uint PDA = 1044;
public const uint PATHFINDER_DEBUG = 1045;
public const uint AI_DEBUG = 1046;
public const uint PLAYER_INPUT_MOVER = 1047;
public const uint STUNNABLE = 1048;
public const uint HUNGER = 1049;
public const uint THIRST = 1050;
public const uint FLASHABLE = 1051;
public const uint BUCKLE = 1052;
public const uint PROJECTILE = 1053;
// 1054
public const uint STRAP = 1055;
public const uint DISPOSABLE = 1056;
public const uint GAS_ANALYZER = 1057;
public const uint DO_AFTER = 1058;
public const uint RADIATION_PULSE = 1059;
public const uint BODY = 1060;
public const uint CLIMBING = 1061;
public const uint BOLTACTION_BARREL = 1062;
public const uint PUMP_BARREL = 1063;
public const uint REVOLVER_BARREL = 1064;
public const uint CUFFED = 1065;
public const uint HANDCUFFS = 1066;
public const uint BATTERY_BARREL = 1067;
public const uint SUSPICION_ROLE = 1068;
public const uint ROTATION = 1069;
public const uint MOB_STATE = 1070;
public const uint SLIP = 1071;
public const uint SPACE_VILLAIN_ARCADE = 1072;
public const uint BLOCKGAME_ARCADE = 1073;
public const uint BODY_PART = 1074;
public const uint CRAYONS = 1075;
public const uint PLACEABLE_SURFACE = 1076;
public const uint STORABLE = 1077;
public const uint PULLABLE = 1078;
public const uint GAS_TANK = 1079;
public const uint SINGULARITY = 1080;
public const uint CHARACTERINFO = 1081;
public const uint REAGENT_GRINDER = 1082;
public const uint ACTIONS = 1083;
public const uint DAMAGEABLE = 1084;
public const uint MAGBOOTS = 1085;
public const uint TAG = 1086;
// Used for clientside fake prediction of doors.
public const uint DOOR = 1087;
public const uint SPAWN_AFTER_INTERACT = 1088;
public const uint DISASSEMBLE_ON_ACTIVATE = 1089;
public const uint LIGHT_REPLACER = 1090;
public const uint SINGULARITY_DISTORTION = 1091;
public const uint GRAVITY = 1092;
public const uint STANDING_STATE = 1093;
// Net IDs for integration tests.
public const uint PREDICTION_TEST = 10001;
}
}

View File

@@ -1,19 +1,18 @@
#nullable enable
using System;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Nutrition.Components
{
[NetworkedComponent()]
public abstract class SharedHungerComponent : Component, IMoveSpeedModifier
{
public sealed override string Name => "Hunger";
public sealed override uint? NetID => ContentNetIDs.HUNGER;
[ViewVariables]
public abstract HungerThreshold CurrentHungerThreshold { get; }
@@ -46,7 +45,7 @@ namespace Content.Shared.Nutrition.Components
{
public HungerThreshold CurrentThreshold { get; }
public HungerComponentState(HungerThreshold currentThreshold) : base(ContentNetIDs.HUNGER)
public HungerComponentState(HungerThreshold currentThreshold)
{
CurrentThreshold = currentThreshold;
}

View File

@@ -1,19 +1,18 @@
#nullable enable
using System;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Nutrition.Components
{
[NetworkedComponent()]
public abstract class SharedThirstComponent : Component, IMoveSpeedModifier
{
public sealed override string Name => "Thirst";
public sealed override uint? NetID => ContentNetIDs.THIRST;
[ViewVariables]
public abstract ThirstThreshold CurrentThirstThreshold { get; }
@@ -45,7 +44,7 @@ namespace Content.Shared.Nutrition.Components
{
public ThirstThreshold CurrentThreshold { get; }
public ThirstComponentState(ThirstThreshold currentThreshold) : base(ContentNetIDs.THIRST)
public ThirstComponentState(ThirstThreshold currentThreshold)
{
CurrentThreshold = currentThreshold;
}

View File

@@ -1,17 +1,16 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.PDA
{
[NetworkedComponent()]
public class SharedPDAComponent : Component
{
public override string Name => "PDA";
public override uint? NetID => ContentNetIDs.PDA;
}
[Serializable, NetSerializable]
@@ -177,7 +176,7 @@ namespace Content.Shared.PDA
public UplinkListingData(string listingName,string itemId,
int price, UplinkCategory category,
string description) : base(ContentNetIDs.PDA)
string description)
{
ListingName = listingName;
Price = price;

View File

@@ -1,16 +1,16 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
namespace Content.Shared.Placeable
{
[NetworkedComponent()]
public abstract class SharedPlaceableSurfaceComponent : Component
{
public override string Name => "PlaceableSurface";
public override uint? NetID => ContentNetIDs.PLACEABLE_SURFACE;
public virtual bool IsPlaceable { get; set; }
public virtual bool PlaceCentered { get; set; }
public virtual Vector2 PositionOffset { get; set; }
@@ -23,7 +23,7 @@ namespace Content.Shared.Placeable
public readonly bool PlaceCentered;
public readonly Vector2 PositionOffset;
public PlaceableSurfaceComponentState(bool placeable, bool centered, Vector2 offset) : base(ContentNetIDs.PLACEABLE_SURFACE)
public PlaceableSurfaceComponentState(bool placeable, bool centered, Vector2 offset)
{
IsPlaceable = placeable;
PlaceCentered = centered;

View File

@@ -1,16 +1,16 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Projectiles
{
[NetworkedComponent()]
public abstract class SharedProjectileComponent : Component
{
private bool _ignoreShooter = true;
public override string Name => "Projectile";
public override uint? NetID => ContentNetIDs.PROJECTILE;
public EntityUid Shooter { get; protected set; }
@@ -29,7 +29,7 @@ namespace Content.Shared.Projectiles
[NetSerializable, Serializable]
protected class ProjectileComponentState : ComponentState
{
public ProjectileComponentState(EntityUid shooter, bool ignoreShooter) : base(ContentNetIDs.PROJECTILE)
public ProjectileComponentState(EntityUid shooter, bool ignoreShooter)
{
Shooter = shooter;
IgnoreShooter = ignoreShooter;

View File

@@ -1,13 +1,13 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.ActionBlocker;
using Content.Shared.Alert;
using Content.Shared.Movement;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Content.Shared.Physics.Pull;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Physics;
@@ -17,10 +17,10 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Pulling.Components
{
[NetworkedComponent()]
public abstract class SharedPullableComponent : Component, IRelayMoveInput
{
public override string Name => "Pullable";
public override uint? NetID => ContentNetIDs.PULLABLE;
[ComponentDependency] private readonly PhysicsComponent? _physics = default!;
@@ -381,7 +381,7 @@ namespace Content.Shared.Pulling.Components
{
public readonly EntityUid? Puller;
public PullableComponentState(EntityUid? puller) : base(ContentNetIDs.PULLABLE)
public PullableComponentState(EntityUid? puller)
{
Puller = puller;
}

View File

@@ -1,15 +1,15 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Radiation
{
[NetworkedComponent()]
public abstract class SharedRadiationPulseComponent : Component
{
public override string Name => "RadiationPulse";
public override uint? NetID => ContentNetIDs.RADIATION_PULSE;
public virtual float RadsPerSecond { get; set; }
@@ -36,7 +36,7 @@ namespace Content.Shared.Radiation
public readonly bool Decay;
public readonly TimeSpan EndTime;
public RadiationPulseState(float radsPerSecond, float range, bool draw, bool decay, TimeSpan endTime) : base(ContentNetIDs.RADIATION_PULSE)
public RadiationPulseState(float radsPerSecond, float range, bool draw, bool decay, TimeSpan endTime)
{
RadsPerSecond = radsPerSecond;
Range = range;

View File

@@ -1,15 +1,15 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Research.Components
{
[NetworkedComponent()]
public class SharedResearchConsoleComponent : Component
{
public override string Name => "ResearchConsole";
public override uint? NetID => ContentNetIDs.RESEARCH_CONSOLE;
[NetSerializable, Serializable]
public enum ResearchConsoleUiKey

View File

@@ -2,9 +2,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Content.Shared.Research.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -12,10 +12,10 @@ using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Research.Components
{
[NetworkedComponent()]
public class SharedTechnologyDatabaseComponent : Component, IEnumerable<TechnologyPrototype>, ISerializationHooks
{
public override string Name => "TechnologyDatabase";
public override uint? NetID => ContentNetIDs.TECHNOLOGY_DATABASE;
[DataField("technologies")] private List<string> _technologyIds = new();
@@ -114,12 +114,12 @@ namespace Content.Shared.Research.Components
public class TechnologyDatabaseState : ComponentState
{
public List<string> Technologies;
public TechnologyDatabaseState(List<string> technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE)
public TechnologyDatabaseState(List<string> technologies)
{
Technologies = technologies;
}
public TechnologyDatabaseState(List<TechnologyPrototype> technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE)
public TechnologyDatabaseState(List<TechnologyPrototype> technologies)
{
Technologies = new List<string>();
foreach (var technology in technologies)

View File

@@ -1,16 +1,16 @@
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Singularity.Components
{
[NetworkedComponent]
public abstract class SharedSingularityComponent : Component
{
public override string Name => "Singularity";
public override uint? NetID => ContentNetIDs.SINGULARITY;
[DataField("deleteFixture")] public string? DeleteFixtureId { get; } = default;
@@ -36,7 +36,7 @@ namespace Content.Shared.Singularity.Components
{
public int Level { get; }
public SingularityComponentState(int level) : base(ContentNetIDs.SINGULARITY)
public SingularityComponentState(int level)
{
Level = level;
}

View File

@@ -1,6 +1,6 @@
using System;
using Content.Shared.NetIDs;
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -9,10 +9,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Singularity.Components
{
[RegisterComponent]
[NetworkedComponent]
public class SingularityDistortionComponent : Component
{
public override string Name => "SingularityDistortion";
public override uint? NetID => ContentNetIDs.SINGULARITY_DISTORTION;
[DataField("intensity")]
private float _intensity = 0.25f;
@@ -56,7 +56,7 @@ namespace Content.Shared.Singularity.Components
[Serializable, NetSerializable]
public class SingularityDistortionComponentState : ComponentState
{
public SingularityDistortionComponentState(float intensity, float falloff) : base(ContentNetIDs.SINGULARITY_DISTORTION)
public SingularityDistortionComponentState(float intensity, float falloff)
{
Intensity = intensity;
Falloff = falloff;

View File

@@ -1,15 +1,15 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Shared.Audio;
using Content.Shared.EffectBlocker;
using Content.Shared.Module;
using Content.Shared.NetIDs;
using Content.Shared.Stunnable;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
@@ -24,12 +24,12 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Slippery
{
[RegisterComponent]
[NetworkedComponent()]
public class SlipperyComponent : Component, IStartCollide
{
[Dependency] private IModuleManager _moduleManager = default!;
public sealed override string Name => "Slippery";
public override uint? NetID => ContentNetIDs.SLIP;
private float _paralyzeTime = 3f;
private float _intersectPercentage = 0.3f;
@@ -265,7 +265,7 @@ namespace Content.Shared.Slippery
public string SlipSound { get; }
public readonly EntityUid[] Slipped;
public SlipperyComponentState(float paralyzeTime, float intersectPercentage, float requiredSlipSpeed, float launchForwardsMultiplier, bool slippery, string slipSound, EntityUid[] slipped) : base(ContentNetIDs.SLIP)
public SlipperyComponentState(float paralyzeTime, float intersectPercentage, float requiredSlipSpeed, float launchForwardsMultiplier, bool slippery, string slipSound, EntityUid[] slipped)
{
ParalyzeTime = paralyzeTime;
IntersectPercentage = intersectPercentage;

View File

@@ -1,17 +1,17 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Sound
{
[NetworkedComponent()]
public class SharedLoopingSoundComponent : Component
{
public override string Name => "LoopingSound";
public override uint? NetID => ContentNetIDs.SOUND;
/// <summary>
/// Stops all sounds.

View File

@@ -1,6 +1,6 @@
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -9,10 +9,10 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Stacks
{
[NetworkedComponent()]
public abstract class SharedStackComponent : Component, ISerializationHooks
{
public sealed override string Name => "Stack";
public sealed override uint? NetID => ContentNetIDs.STACK;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<StackPrototype>))]
@@ -48,7 +48,7 @@ namespace Content.Shared.Stacks
public int Count { get; }
public int MaxCount { get; }
public StackComponentState(int count, int maxCount) : base(ContentNetIDs.STACK)
public StackComponentState(int count, int maxCount)
{
Count = count;
MaxCount = maxCount;

View File

@@ -1,7 +1,7 @@
using System;
using Content.Shared.EffectBlocker;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -10,12 +10,11 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Standing
{
[RegisterComponent]
[NetworkedComponent]
public sealed class StandingStateComponent : Component, IEffectBlocker
{
public override string Name => "StandingState";
public override uint? NetID => ContentNetIDs.STANDING_STATE;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("downSoundCollection")]
public string? DownSoundCollection { get; } = "BodyFall";
@@ -45,7 +44,7 @@ namespace Content.Shared.Standing
{
public bool Standing { get; }
public StandingComponentState(bool standing) : base(ContentNetIDs.STANDING_STATE)
public StandingComponentState(bool standing)
{
Standing = standing;
}

View File

@@ -5,18 +5,18 @@ using System.Linq;
using Content.Shared.ActionBlocker;
using Content.Shared.DragDrop;
using Content.Shared.Interaction.Events;
using Content.Shared.NetIDs;
using Content.Shared.Placeable;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Shared.Storage
{
[NetworkedComponent()]
public abstract class SharedStorageComponent : Component, IDraggable
{
public override string Name => "Storage";
public override uint? NetID => ContentNetIDs.INVENTORY;
public abstract IReadOnlyList<IEntity>? StoredEntities { get; }
@@ -65,7 +65,7 @@ namespace Content.Shared.Storage
{
public readonly EntityUid[] StoredEntities;
public StorageComponentState(EntityUid[] storedEntities) : base(ContentNetIDs.INVENTORY)
public StorageComponentState(EntityUid[] storedEntities)
{
StoredEntities = storedEntities;
}

View File

@@ -5,8 +5,8 @@ using Content.Shared.ActionBlocker;
using Content.Shared.Alert;
using Content.Shared.Interaction;
using Content.Shared.Movement.Components;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
@@ -16,12 +16,12 @@ using Robust.Shared.ViewVariables;
namespace Content.Shared.Stunnable
{
[NetworkedComponent()]
public abstract class SharedStunnableComponent : Component, IMoveSpeedModifier, IActionBlocker, IInteractHand
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
public sealed override string Name => "Stunnable";
public override uint? NetID => ContentNetIDs.STUNNABLE;
public (TimeSpan Start, TimeSpan End)? StunnedTimer { get; protected set; }
public (TimeSpan Start, TimeSpan End)? KnockdownTimer { get; protected set; }
@@ -368,7 +368,7 @@ namespace Content.Shared.Stunnable
public StunnableComponentState(
(TimeSpan Start, TimeSpan End)? stunnedTimer, (TimeSpan Start, TimeSpan End)? knockdownTimer,
(TimeSpan Start, TimeSpan End)? slowdownTimer, float walkModifierOverride, float runModifierOverride) : base(ContentNetIDs.STUNNABLE)
(TimeSpan Start, TimeSpan End)? slowdownTimer, float walkModifierOverride, float runModifierOverride)
{
StunnedTimer = stunnedTimer;
KnockdownTimer = knockdownTimer;

View File

@@ -1,15 +1,15 @@
#nullable enable
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Suspicion
{
[NetworkedComponent()]
public abstract class SharedSuspicionRoleComponent : Component
{
public sealed override string Name => "SuspicionRole";
public sealed override uint? NetID => ContentNetIDs.SUSPICION_ROLE;
}
[Serializable, NetSerializable]
@@ -19,7 +19,7 @@ namespace Content.Shared.Suspicion
public readonly bool? Antagonist;
public readonly (string name, EntityUid)[] Allies;
public SuspicionRoleComponentState(string? role, bool? antagonist, (string name, EntityUid)[] allies) : base(ContentNetIDs.SUSPICION_ROLE)
public SuspicionRoleComponentState(string? role, bool? antagonist, (string name, EntityUid)[] allies)
{
Role = role;
Antagonist = antagonist;

View File

@@ -1,6 +1,5 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -9,7 +8,7 @@ namespace Content.Shared.Tag
[Serializable, NetSerializable]
public class TagComponentState : ComponentState
{
public TagComponentState(string[] tags) : base(ContentNetIDs.TAG)
public TagComponentState(string[] tags)
{
Tags = tags;
}

View File

@@ -1,6 +1,5 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -47,7 +46,7 @@ namespace Content.Shared.Tool
{
public ToolQuality Quality { get; }
public MultiToolComponentState(ToolQuality quality) : base(ContentNetIDs.MULTITOOLS)
public MultiToolComponentState(ToolQuality quality)
{
Quality = quality;
}
@@ -61,7 +60,7 @@ namespace Content.Shared.Tool
public bool Activated { get; }
public ToolQuality Quality { get; }
public WelderComponentState(float fuelCapacity, float fuel, bool activated) : base(ContentNetIDs.WELDER)
public WelderComponentState(float fuelCapacity, float fuel, bool activated)
{
FuelCapacity = fuelCapacity;
Fuel = fuel;

View File

@@ -1,17 +1,17 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Shared.NetIDs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.VendingMachines
{
[NetworkedComponent()]
public class SharedVendingMachineComponent : Component
{
public override string Name => "VendingMachine";
public override uint? NetID => ContentNetIDs.VENDING_MACHINE;
[ViewVariables]
public List<VendingMachineInventoryEntry> Inventory = new();

View File

@@ -1,6 +1,5 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -15,8 +14,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components
public BatteryBarrelComponentState(
FireRateSelector fireRateSelector,
(int count, int max)? magazine) :
base(ContentNetIDs.BATTERY_BARREL)
(int count, int max)? magazine)
{
FireRateSelector = fireRateSelector;
Magazine = magazine;

View File

@@ -1,6 +1,5 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -19,8 +18,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components
(bool chambered, bool spent) chamber,
FireRateSelector fireRateSelector,
(int count, int max)? magazine,
string? soundGunshot) :
base(ContentNetIDs.BOLTACTION_BARREL)
string? soundGunshot)
{
Chamber = chamber;
FireRateSelector = fireRateSelector;

View File

@@ -1,6 +1,5 @@
#nullable enable
using System;
using Content.Shared.NetIDs;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -39,8 +38,7 @@ namespace Content.Shared.Weapons.Ranged.Barrels.Components
bool chambered,
FireRateSelector fireRateSelector,
(int count, int max)? magazine,
string? soundGunshot) :
base(ContentNetIDs.MAGAZINE_BARREL)
string? soundGunshot)
{
Chambered = chambered;
FireRateSelector = fireRateSelector;

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