From ceb8cc8421a3f54680af416f6382728d91cb53fc Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Wed, 31 Jul 2019 15:02:36 +0200 Subject: [PATCH] Use automatic component registration. --- Content.Client/EntryPoint.cs | 182 ++++++---------- .../Actor/CharacterInfoComponent.cs | 1 + .../Components/Actor/CharacterInterface.cs | 1 + .../Components/Clothing/ClothingComponent.cs | 6 +- .../ConstructionGhostComponent.cs | 1 + .../Construction/ConstructorComponent.cs | 1 + .../Components/DamageableComponent.cs | 5 +- .../HUD/Inventory/ClientInventoryComponent.cs | 1 + .../IconSmoothing/IconSmoothComponent.cs | 1 + .../Components/Items/ClientHandsComponent.cs | 2 + .../Components/Items/ItemComponent.cs | 5 +- .../Components/LowWallComponent.cs | 3 + .../Components/Mobs/CameraRecoilComponent.cs | 2 + .../GameObjects/Components/Mobs/SpeciesUI.cs | 20 +- .../Components/Power/PowerDebugTool.cs | 3 +- .../Research/LatheDatabaseComponent.cs | 4 +- .../Research/MaterialStorageComponent.cs | 4 +- .../Components/Sound/SoundComponent.cs | 3 +- .../Storage/ClientStorageComponent.cs | 1 + .../Components/SubFloorHideComponent.cs | 1 + .../Ranged/ClientRangedWeaponComponent.cs | 3 +- .../GameObjects/Components/WindowComponent.cs | 1 + Content.Server/EntryPoint.cs | 201 ++---------------- .../Components/CatwalkComponent.cs | 1 + .../Components/Chemistry/SolutionComponent.cs | 4 +- .../Construction/ConstructionComponent.cs | 1 + .../Construction/ConstructorComponent.cs | 5 +- .../Components/Damage/DamageableComponent.cs | 10 +- .../Damage/DestructibleComponent.cs | 14 +- .../Components/Doors/ServerDoorComponent.cs | 2 + .../Explosion/ExplosiveComponent.cs | 21 +- .../Components/GUI/InventoryComponent.cs | 3 +- .../Components/GUI/ServerHandsComponent.cs | 6 +- .../Components/Healing/HealingComponent.cs | 17 +- .../Interactable/HandheldLightComponent.cs | 1 + .../Interactable/Tools/CrowbarComponent.cs | 2 + .../Interactable/Tools/MultitoolComponent.cs | 7 +- .../Tools/ScrewdriverComponent.cs | 7 +- .../Interactable/Tools/WelderComponent.cs | 9 +- .../Interactable/Tools/WirecutterComponent.cs | 7 +- .../Interactable/Tools/WrenchComponent.cs | 7 +- .../Items/Clothing/ClothingComponent.cs | 9 +- .../Components/Items/DiceComponent.cs | 2 +- .../Items/Storage/EntityStorageComponent.cs | 15 +- .../Storage/Fill/ToolLockerFillComponent.cs | 1 + .../Fill/ToolboxElectricalFillComponent.cs | 1 + .../Components/Items/Storage/ItemComponent.cs | 15 +- .../Items/Storage/ServerStorageComponent.cs | 21 +- .../Items/Storage/StoreableComponent.cs | 1 + .../Components/Markers/SpawnPointComponent.cs | 3 +- .../Components/Mobs/CameraRecoilComponent.cs | 3 + .../Components/Mobs/CombatModeComponent.cs | 1 + .../Mobs/HeatResistanceComponent.cs | 3 +- .../Components/Mobs/MindComponent.cs | 11 +- .../Components/Mobs/SpeciesComponent.cs | 1 + .../Movement/AiControllerComponent.cs | 1 + .../Movement/PlayerInputMoverComponent.cs | 2 + .../Movement/ServerPortalComponent.cs | 2 + .../Movement/ServerTeleporterComponent.cs | 2 +- .../Movement/TeleportableComponent.cs | 2 +- .../Components/PlaceableSurfaceComponent.cs | 1 + .../Components/Power/ApcComponent.cs | 6 +- .../Components/Power/LightBulbComponent.cs | 3 +- .../Components/Power/PowerCellComponent.cs | 3 + .../Components/Power/PowerDebugTool.cs | 3 +- .../Components/Power/PowerDevice.cs | 17 +- .../Power/PowerGeneratorComponent.cs | 7 +- .../Components/Power/PowerNodeComponent.cs | 6 +- .../Power/PowerProviderComponent.cs | 12 +- .../Power/PowerStorageNetComponent.cs | 3 + .../Power/PowerTransferComponent.cs | 12 +- .../Components/Power/PoweredLightComponent.cs | 1 + .../Components/Power/SmesComponent.cs | 4 +- .../Projectiles/ProjectileComponent.cs | 7 +- .../Projectiles/ThrownItemComponent.cs | 1 + .../Components/Research/LatheComponent.cs | 5 +- .../Research/LatheDatabaseComponent.cs | 3 +- .../Research/MaterialStorageComponent.cs | 3 +- .../Sound/EmitSoundOnUseComponent].cs | 21 +- .../Sound/FootstepModifierComponent.cs | 20 +- .../Components/Sound/SoundComponent.cs | 7 +- .../Components/Stack/StackComponent.cs | 1 + .../Temperature/TemperatureComponent.cs | 11 +- .../OnUseTimerTriggerComponent.cs | 11 +- .../Weapon/Melee/MeleeWeaponComponent.cs | 11 +- .../HitscanWeaponCapacitorComponent.cs | 6 +- .../Ranged/Hitscan/HitscanWeaponComponent.cs | 17 +- .../Projectile/BallisticBulletComponent.cs | 1 + .../Projectile/BallisticMagazineComponent.cs | 1 + .../BallisticMagazineWeaponComponent.cs | 2 + .../Components/Weapon/Ranged/RangedWeapon.cs | 5 +- Content.Shared/Chemistry/Solution.cs | 8 +- .../Components/Materials/MaterialComponent.cs | 1 + .../Components/Mobs/ExaminerComponent.cs | 1 + 94 files changed, 353 insertions(+), 540 deletions(-) diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs index 01be9dbffd..bf830edbae 100644 --- a/Content.Client/EntryPoint.cs +++ b/Content.Client/EntryPoint.cs @@ -1,29 +1,15 @@ using System; using Content.Client.Chat; -using Content.Client.GameObjects; -using Content.Client.GameObjects.Components; using Content.Client.GameObjects.Components.Actor; -using Content.Client.GameObjects.Components.Clothing; -using Content.Client.GameObjects.Components.Construction; -using Content.Client.GameObjects.Components.IconSmoothing; -using Content.Client.GameObjects.Components.Mobs; -using Content.Client.GameObjects.Components.Power; -using Content.Client.GameObjects.Components.Research; -using Content.Client.GameObjects.Components.Sound; -using Content.Client.GameObjects.Components.Storage; -using Content.Client.GameObjects.Components.Weapons.Ranged; using Content.Client.GameTicking; using Content.Client.Input; using Content.Client.Interfaces; using Content.Client.Interfaces.Chat; -using Content.Client.Interfaces.GameObjects; using Content.Client.Interfaces.Parallax; using Content.Client.Parallax; using Content.Client.UserInterface; using Content.Shared.GameObjects.Components.Chemistry; using Content.Shared.GameObjects.Components.Markers; -using Content.Shared.GameObjects.Components.Materials; -using Content.Shared.GameObjects.Components.Mobs; using Content.Shared.GameObjects.Components.Research; using Content.Shared.Interfaces; using Robust.Client; @@ -51,115 +37,74 @@ namespace Content.Client var factory = IoCManager.Resolve(); var prototypes = IoCManager.Resolve(); - factory.RegisterIgnore("Interactable"); - factory.RegisterIgnore("Destructible"); - factory.RegisterIgnore("Temperature"); - factory.RegisterIgnore("PowerTransfer"); - factory.RegisterIgnore("PowerNode"); - factory.RegisterIgnore("PowerProvider"); - factory.RegisterIgnore("PowerDevice"); - factory.RegisterIgnore("PowerStorage"); - factory.RegisterIgnore("PowerGenerator"); + factory.DoAutoRegistrations(); - factory.RegisterIgnore("Explosive"); - factory.RegisterIgnore("OnUseTimerTrigger"); + var registerIgnore = new[] + { + "Interactable", + "Destructible", + "Temperature", + "PowerTransfer", + "PowerNode", + "PowerProvider", + "PowerDevice", + "PowerStorage", + "PowerGenerator", + "Explosive", + "OnUseTimerTrigger", + "ToolboxElectricalFill", + "ToolLockerFill", + "EmitSoundOnUse", + "FootstepModifier", + "HeatResistance", + "CombatMode", + "Teleportable", + "ItemTeleporter", + "Portal", + "EntityStorage", + "PlaceableSurface", + "Wirecutter", + "Screwdriver", + "Multitool", + "Welder", + "Wrench", + "Crowbar", + "HitscanWeapon", + "ProjectileWeapon", + "Projectile", + "MeleeWeapon", + "Storeable", + "Stack", + "Dice", + "Construction", + "Apc", + "Door", + "PoweredLight", + "Smes", + "Powercell", + "HandheldLight", + "LightBulb", + "Healing", + "Catwalk", + "BallisticMagazine", + "BallisticMagazineWeapon", + "BallisticBullet", + "HitscanWeaponCapacitor", + "PowerCell", + "AiController", + "PlayerInputMover", + }; - factory.RegisterIgnore("ToolboxElectricalFill"); - factory.RegisterIgnore("ToolLockerFill"); - - factory.RegisterIgnore("EmitSoundOnUse"); - factory.RegisterIgnore("FootstepModifier"); - - factory.RegisterIgnore("HeatResistance"); - factory.RegisterIgnore("CombatMode"); - - factory.RegisterIgnore("Teleportable"); - factory.RegisterIgnore("ItemTeleporter"); - factory.RegisterIgnore("Portal"); - - factory.RegisterIgnore("EntityStorage"); - factory.RegisterIgnore("PlaceableSurface"); - - factory.RegisterIgnore("Wirecutter"); - factory.RegisterIgnore("Screwdriver"); - factory.RegisterIgnore("Multitool"); - factory.RegisterIgnore("Welder"); - factory.RegisterIgnore("Wrench"); - factory.RegisterIgnore("Crowbar"); - factory.Register(); - factory.RegisterIgnore("HitscanWeapon"); - factory.RegisterIgnore("ProjectileWeapon"); - factory.RegisterIgnore("Projectile"); - factory.RegisterIgnore("MeleeWeapon"); - - factory.RegisterIgnore("Storeable"); - - factory.RegisterIgnore("Stack"); - - factory.RegisterIgnore("Dice"); - - factory.Register(); - factory.RegisterReference(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.RegisterReference(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.RegisterReference(); - - factory.RegisterReference(); - - factory.Register(); - factory.Register(); - - factory.RegisterIgnore("Construction"); - factory.RegisterIgnore("Apc"); - factory.RegisterIgnore("Door"); - factory.RegisterIgnore("PoweredLight"); - factory.RegisterIgnore("Smes"); - factory.RegisterIgnore("Powercell"); - factory.RegisterIgnore("HandheldLight"); - factory.RegisterIgnore("LightBulb"); - factory.RegisterIgnore("Healing"); - factory.RegisterIgnore("Catwalk"); - factory.RegisterIgnore("BallisticMagazine"); - factory.RegisterIgnore("BallisticMagazineWeapon"); - factory.RegisterIgnore("BallisticBullet"); - factory.RegisterIgnore("HitscanWeaponCapacitor"); - - prototypes.RegisterIgnore("material"); - - factory.RegisterIgnore("PowerCell"); - - factory.Register(); + foreach (var ignoreName in registerIgnore) + { + factory.RegisterIgnore(ignoreName); + } factory.Register(); - factory.Register(); + factory.Register(); + factory.Register(); - factory.RegisterReference(); - - factory.Register(); - factory.RegisterReference(); - - factory.Register(); - - factory.RegisterIgnore("AiController"); - factory.RegisterIgnore("PlayerInputMover"); - - factory.Register(); - factory.Register(); - - factory.Register(); + prototypes.RegisterIgnore("material"); IoCManager.Register(); IoCManager.Register(); @@ -188,6 +133,7 @@ namespace Content.Client _escapeMenuOwner.Initialize(); } + /// /// Subscribe events to the player manager after the player manager is set up /// diff --git a/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs b/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs index aa8faec6c3..18b939d90b 100644 --- a/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs +++ b/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs @@ -10,6 +10,7 @@ using Robust.Shared.Localization; namespace Content.Client.GameObjects.Components.Actor { + [RegisterComponent] public sealed class CharacterInfoComponent : Component, ICharacterUI { private CharacterInfoControl _control; diff --git a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs index fe2d2a5063..b468e9ffdc 100644 --- a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs +++ b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs @@ -18,6 +18,7 @@ namespace Content.Client.GameObjects.Components.Actor /// A semi-abstract component which gets added to entities upon attachment and collects all character /// user interfaces into a single window and keybind for the user /// + [RegisterComponent] public class CharacterInterface : Component { public override string Name => "Character Interface Component"; diff --git a/Content.Client/GameObjects/Components/Clothing/ClothingComponent.cs b/Content.Client/GameObjects/Components/Clothing/ClothingComponent.cs index 8a9eb99b9d..57ffb68a17 100644 --- a/Content.Client/GameObjects/Components/Clothing/ClothingComponent.cs +++ b/Content.Client/GameObjects/Components/Clothing/ClothingComponent.cs @@ -1,13 +1,15 @@ -using Content.Shared.GameObjects; +using System; +using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Inventory; using Content.Shared.GameObjects.Components.Items; using Robust.Client.Graphics; using Robust.Shared.GameObjects; using Robust.Shared.ViewVariables; -using System; namespace Content.Client.GameObjects.Components.Clothing { + [RegisterComponent] + [ComponentReference(typeof(ItemComponent))] public class ClothingComponent : ItemComponent { public override string Name => "Clothing"; diff --git a/Content.Client/GameObjects/Components/Construction/ConstructionGhostComponent.cs b/Content.Client/GameObjects/Components/Construction/ConstructionGhostComponent.cs index 1f9a0f1531..6abd5846a5 100644 --- a/Content.Client/GameObjects/Components/Construction/ConstructionGhostComponent.cs +++ b/Content.Client/GameObjects/Components/Construction/ConstructionGhostComponent.cs @@ -6,6 +6,7 @@ using Robust.Shared.ViewVariables; namespace Content.Client.GameObjects.Components.Construction { + [RegisterComponent] public class ConstructionGhostComponent : Component { public override string Name => "ConstructionGhost"; diff --git a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs index 9d948a8498..f5b5edaf34 100644 --- a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs @@ -15,6 +15,7 @@ using Robust.Shared.Maths; namespace Content.Client.GameObjects.Components.Construction { + [RegisterComponent] public class ConstructorComponent : SharedConstructorComponent { #pragma warning disable 649 diff --git a/Content.Client/GameObjects/Components/DamageableComponent.cs b/Content.Client/GameObjects/Components/DamageableComponent.cs index 311f89e80c..bde34e4d96 100644 --- a/Content.Client/GameObjects/Components/DamageableComponent.cs +++ b/Content.Client/GameObjects/Components/DamageableComponent.cs @@ -1,6 +1,6 @@ -using Content.Shared.GameObjects; +using System.Collections.Generic; +using Content.Shared.GameObjects; using Robust.Shared.GameObjects; -using System.Collections.Generic; namespace Content.Client.GameObjects { @@ -8,6 +8,7 @@ namespace Content.Client.GameObjects /// Fuck I really hate doing this /// TODO: make sure the client only gets damageable component on the clientside entity for its player mob /// + [RegisterComponent] public class DamageableComponent : SharedDamageableComponent { /// diff --git a/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs b/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs index 0d672b28d2..bdaeedcc82 100644 --- a/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs +++ b/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs @@ -18,6 +18,7 @@ namespace Content.Client.GameObjects /// /// A character UI which shows items the user has equipped within his inventory /// + [RegisterComponent] public class ClientInventoryComponent : SharedInventoryComponent { private readonly Dictionary _slots = new Dictionary(); diff --git a/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs index 74352642b8..6abe1145a7 100644 --- a/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs +++ b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs @@ -25,6 +25,7 @@ namespace Content.Client.GameObjects.Components.IconSmoothing /// To use, set base equal to the prefix of the corner states in the sprite base RSI. /// Any objects with the same key will connect. /// + [RegisterComponent] public class IconSmoothComponent : Component { private string _smoothKey; diff --git a/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs b/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs index 62158c0e0d..4e0899724c 100644 --- a/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs +++ b/Content.Client/GameObjects/Components/Items/ClientHandsComponent.cs @@ -15,6 +15,8 @@ using Robust.Shared.ViewVariables; namespace Content.Client.GameObjects { + [RegisterComponent] + [ComponentReference(typeof(IHandsComponent))] public class HandsComponent : SharedHandsComponent, IHandsComponent { private HandsGui _gui; diff --git a/Content.Client/GameObjects/Components/Items/ItemComponent.cs b/Content.Client/GameObjects/Components/Items/ItemComponent.cs index 574f25b50d..80eed4d948 100644 --- a/Content.Client/GameObjects/Components/Items/ItemComponent.cs +++ b/Content.Client/GameObjects/Components/Items/ItemComponent.cs @@ -1,4 +1,5 @@ -using Content.Shared.GameObjects; +using System; +using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Items; using Robust.Client.Graphics; using Robust.Client.Interfaces.ResourceManagement; @@ -9,10 +10,10 @@ using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; -using System; namespace Content.Client.GameObjects { + [RegisterComponent] public class ItemComponent : Component { public override string Name => "Item"; diff --git a/Content.Client/GameObjects/Components/LowWallComponent.cs b/Content.Client/GameObjects/Components/LowWallComponent.cs index 2f1b6e3868..c183beb568 100644 --- a/Content.Client/GameObjects/Components/LowWallComponent.cs +++ b/Content.Client/GameObjects/Components/LowWallComponent.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Content.Client.GameObjects.Components.IconSmoothing; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Maths; using static Robust.Client.GameObjects.SpriteComponent; @@ -14,6 +15,8 @@ namespace Content.Client.GameObjects.Components /// /// Override of icon smoothing to handle the specific complexities of low walls. /// + [RegisterComponent] + [ComponentReference(typeof(IconSmoothComponent))] public class LowWallComponent : IconSmoothComponent { public override string Name => "LowWall"; diff --git a/Content.Client/GameObjects/Components/Mobs/CameraRecoilComponent.cs b/Content.Client/GameObjects/Components/Mobs/CameraRecoilComponent.cs index 6745d2a271..92a8b6f87e 100644 --- a/Content.Client/GameObjects/Components/Mobs/CameraRecoilComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/CameraRecoilComponent.cs @@ -8,6 +8,8 @@ using Robust.Shared.Maths; namespace Content.Client.GameObjects.Components.Mobs { + [RegisterComponent] + [ComponentReference(typeof(SharedCameraRecoilComponent))] public sealed class CameraRecoilComponent : SharedCameraRecoilComponent { // Maximum rate of magnitude restore towards 0 kick. diff --git a/Content.Client/GameObjects/Components/Mobs/SpeciesUI.cs b/Content.Client/GameObjects/Components/Mobs/SpeciesUI.cs index c590245f90..2999ede1bf 100644 --- a/Content.Client/GameObjects/Components/Mobs/SpeciesUI.cs +++ b/Content.Client/GameObjects/Components/Mobs/SpeciesUI.cs @@ -1,31 +1,31 @@ -using Content.Client.GameObjects.Components.Actor; -using Content.Client.GameObjects.Components.Mobs; +using System.Collections.Generic; +using Content.Client.GameObjects.Components.Actor; using Content.Client.Graphics.Overlays; +using Content.Client.UserInterface; +using Content.Client.Utility; using Content.Shared.GameObjects; +using Content.Shared.GameObjects.Components.Mobs; using Robust.Client.GameObjects; +using Robust.Client.Graphics; +using Robust.Client.Graphics.Overlays; using Robust.Client.Interfaces.Graphics.Overlays; using Robust.Client.Interfaces.ResourceManagement; +using Robust.Client.Interfaces.UserInterface; using Robust.Client.Player; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects.Components.Renderable; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; -using System.Collections.Generic; -using Content.Client.UserInterface; -using Content.Client.Utility; -using Content.Shared.GameObjects.Components.Mobs; -using Robust.Client.Graphics; -using Robust.Client.Graphics.Overlays; -using Robust.Client.Interfaces.UserInterface; -using Robust.Shared.GameObjects.Components.Renderable; namespace Content.Client.GameObjects { /// /// A character UI component which shows the current damage state of the mob (living/dead) /// + [RegisterComponent] public class SpeciesUI : SharedSpeciesComponent//, ICharacterUI { private StatusEffectsUI _ui; diff --git a/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs b/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs index d36d3be317..21e7452068 100644 --- a/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs +++ b/Content.Client/GameObjects/Components/Power/PowerDebugTool.cs @@ -1,14 +1,13 @@ using Content.Shared.GameObjects.Components.Power; -using Robust.Client.Interfaces.Graphics; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Network; -using Robust.Shared.IoC; namespace Content.Client.GameObjects.Components.Power { + [RegisterComponent] public class PowerDebugTool : SharedPowerDebugTool { SS14Window LastWindow; diff --git a/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs b/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs index b40d96319d..962948e7e8 100644 --- a/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs +++ b/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs @@ -1,13 +1,13 @@ using Content.Shared.GameObjects.Components.Research; using Content.Shared.Research; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; using Robust.Shared.Prototypes; namespace Content.Client.GameObjects.Components.Research { + [RegisterComponent] + [ComponentReference(typeof(SharedLatheDatabaseComponent))] public class LatheDatabaseComponent : SharedLatheDatabaseComponent { #pragma warning disable CS0649 diff --git a/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs b/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs index de32c6f55c..62dfd8c18d 100644 --- a/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs +++ b/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs @@ -2,11 +2,11 @@ using System; using System.Collections.Generic; using Content.Shared.GameObjects.Components.Research; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Network; namespace Content.Client.GameObjects.Components.Research { + [RegisterComponent] + [ComponentReference(typeof(SharedMaterialStorageComponent))] public class MaterialStorageComponent : SharedMaterialStorageComponent { protected override Dictionary Storage { get; set; } = new Dictionary(); diff --git a/Content.Client/GameObjects/Components/Sound/SoundComponent.cs b/Content.Client/GameObjects/Components/Sound/SoundComponent.cs index e8a47f1643..cfed2998ee 100644 --- a/Content.Client/GameObjects/Components/Sound/SoundComponent.cs +++ b/Content.Client/GameObjects/Components/Sound/SoundComponent.cs @@ -5,14 +5,13 @@ using Robust.Client.GameObjects.EntitySystems; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Network; -using Robust.Shared.Interfaces.Timers; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Serialization; using Robust.Shared.Timers; namespace Content.Client.GameObjects.Components.Sound { + [RegisterComponent] public class SoundComponent : SharedSoundComponent { private readonly List _schedules = new List(); diff --git a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs index d757397753..ad8501cc64 100644 --- a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs +++ b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs @@ -17,6 +17,7 @@ namespace Content.Client.GameObjects.Components.Storage /// /// Client version of item storage containers, contains a UI which displays stored entities and their size /// + [RegisterComponent] public class ClientStorageComponent : SharedStorageComponent { private Dictionary StoredEntities { get; set; } = new Dictionary(); diff --git a/Content.Client/GameObjects/Components/SubFloorHideComponent.cs b/Content.Client/GameObjects/Components/SubFloorHideComponent.cs index 45d6c366d0..b5cabd00dd 100644 --- a/Content.Client/GameObjects/Components/SubFloorHideComponent.cs +++ b/Content.Client/GameObjects/Components/SubFloorHideComponent.cs @@ -10,6 +10,7 @@ namespace Content.Client.GameObjects.Components /// is not a sub floor (plating). /// /// + [RegisterComponent] public sealed class SubFloorHideComponent : Component { private SnapGridComponent _snapGridComponent; diff --git a/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs b/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs index 3c7c76c5e4..291e05e4c1 100644 --- a/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs +++ b/Content.Client/GameObjects/Components/Weapons/Ranged/ClientRangedWeaponComponent.cs @@ -1,12 +1,13 @@ using System; using Content.Shared.GameObjects.Components.Weapons.Ranged; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Map; namespace Content.Client.GameObjects.Components.Weapons.Ranged { + [RegisterComponent] public sealed class ClientRangedWeaponComponent : SharedRangedWeaponComponent { private TimeSpan _lastFireTime; diff --git a/Content.Client/GameObjects/Components/WindowComponent.cs b/Content.Client/GameObjects/Components/WindowComponent.cs index f92c7b4f20..f4ae19448f 100644 --- a/Content.Client/GameObjects/Components/WindowComponent.cs +++ b/Content.Client/GameObjects/Components/WindowComponent.cs @@ -8,6 +8,7 @@ using static Content.Client.GameObjects.Components.IconSmoothing.IconSmoothCompo namespace Content.Client.GameObjects.Components { + [RegisterComponent] public sealed class WindowComponent : Component { public override string Name => "Window"; diff --git a/Content.Server/EntryPoint.cs b/Content.Server/EntryPoint.cs index df458d5127..7d3a279492 100644 --- a/Content.Server/EntryPoint.cs +++ b/Content.Server/EntryPoint.cs @@ -1,73 +1,22 @@ using Content.Server.Chat; -using Content.Server.GameObjects; -using Content.Server.GameObjects.Components; -using Content.Server.GameObjects.Components.Power; -using Content.Server.GameObjects.Components.Interactable.Tools; -using Content.Server.Interfaces.GameObjects; -using Content.Server.Placement; -using Robust.Server; -using Robust.Server.Interfaces; -using Robust.Server.Interfaces.Maps; -using Robust.Server.Interfaces.Player; -using Robust.Server.Player; -using Robust.Shared.Console; -using Robust.Shared.ContentPack; -using Robust.Shared.Enums; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Map; -using Robust.Shared.Interfaces.Timers; -using Robust.Shared.IoC; -using Robust.Shared.Log; -using Robust.Shared.Map; -using Robust.Shared.Timers; -using Robust.Shared.Interfaces.Timing; -using Robust.Shared.Maths; -using Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan; -using Content.Server.GameObjects.Components.Weapon.Ranged.Projectile; -using Content.Server.GameObjects.Components.Projectiles; -using Content.Server.GameObjects.Components.Weapon.Melee; -using Content.Server.GameObjects.Components.Stack; -using Content.Server.GameObjects.Components.Construction; -using Content.Server.GameObjects.Components.Mobs; -using Content.Server.GameObjects.EntitySystems; -using Content.Server.Mobs; -using Content.Server.Players; -using Content.Server.GameObjects.Components.Interactable; -using Content.Server.GameObjects.Components.Markers; -using Content.Server.GameObjects.Components.Sound; -using Content.Server.GameObjects.Components.Weapon.Ranged; using Content.Server.GameTicking; using Content.Server.Interfaces; -using Content.Server.Interfaces.GameTicking; -using Content.Shared.GameObjects.Components.Chemistry; -using Content.Shared.GameObjects.Components.Materials; -using Content.Shared.GameObjects.Components.Inventory; -using Content.Shared.GameObjects.Components.Markers; -using Content.Shared.GameObjects.Components.Mobs; -using Content.Shared.Interfaces; -using Robust.Server.Interfaces.ServerStatus; -using Robust.Shared.Timing; -using Content.Server.GameObjects.Components.Destructible; -using Content.Server.GameObjects.Components.Items.Storage; -using Content.Server.GameObjects.Components.Items.Storage.Fill; -using Content.Server.GameObjects.Components.Movement; using Content.Server.Interfaces.Chat; -using Content.Server.Interfaces.GameObjects.Components.Movement; -using Content.Server.GameObjects.Components.Research; -using Content.Shared.GameObjects.Components.Research; +using Content.Server.Interfaces.GameTicking; +using Content.Shared.Interfaces; +using Robust.Server.Interfaces.Player; +using Robust.Shared.ContentPack; +using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Log; -using Content.Server.GameObjects.Components.Explosive; -using Content.Server.GameObjects.Components.Items; -using Content.Server.GameObjects.Components.Triggers; -using Content.Shared.GameObjects.Components.Movement; -using SolutionComponent = Content.Server.GameObjects.Components.Chemistry.SolutionComponent; +using Robust.Shared.IoC; +using Robust.Shared.Log; +using Robust.Shared.Timing; namespace Content.Server { public class EntryPoint : GameServer { private IGameTicker _gameTicker; - private IMoMMILink _mommiLink; private StatusShell _statusShell; /// @@ -77,129 +26,19 @@ namespace Content.Server var factory = IoCManager.Resolve(); - factory.Register(); - factory.RegisterReference(); + factory.DoAutoRegistrations(); - factory.Register(); + var registerIgnore = new[] + { + "ConstructionGhost", + "IconSmooth", + "SubFloorHide" + }; - factory.Register(); - factory.Register(); - factory.RegisterReference(); - factory.Register(); - factory.RegisterReference(); - factory.RegisterReference(); - factory.Register(); - - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.RegisterReference(); - - factory.Register(); - - //Power Components - factory.Register(); - factory.Register(); - factory.RegisterReference(); - factory.Register(); - factory.Register(); - factory.RegisterReference(); - factory.Register(); - factory.RegisterReference(); - factory.Register(); - factory.Register(); - factory.Register(); - - //Tools - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - - factory.Register(); - factory.Register(); - - factory.Register(); - - factory.Register(); - factory.RegisterReference(); - factory.RegisterReference(); - factory.Register(); - factory.RegisterReference(); - factory.RegisterReference(); - - factory.Register(); - factory.Register(); - - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.RegisterReference(); - factory.Register(); - factory.Register(); - factory.Register(); - factory.RegisterReference(); - - factory.Register(); - factory.Register(); - factory.RegisterIgnore("ConstructionGhost"); - - factory.Register(); - factory.Register(); - factory.Register(); - - factory.Register(); - factory.RegisterReference(); - - factory.Register(); - factory.RegisterReference(); - factory.Register(); - - factory.RegisterReference(); - - factory.Register(); - factory.Register(); - - factory.Register(); - - factory.Register(); - factory.RegisterReference(); - - factory.RegisterIgnore("IconSmooth"); - factory.RegisterIgnore("SubFloorHide"); - - factory.Register(); - factory.RegisterReference(); - - factory.Register(); - factory.Register(); - factory.Register(); - factory.Register(); - - factory.Register(); - - factory.Register(); - - factory.Register(); - factory.Register(); - - factory.Register(); - factory.Register(); - - factory.Register(); - - factory.Register(); + foreach (var ignoreName in registerIgnore) + { + factory.RegisterIgnore(ignoreName); + } IoCManager.Register(); IoCManager.Register(); @@ -218,8 +57,6 @@ namespace Content.Server IoCManager.Resolve().Initialize(); IoCManager.Resolve().Initialize(); - _mommiLink = IoCManager.Resolve(); - var playerManager = IoCManager.Resolve(); _statusShell = new StatusShell(); diff --git a/Content.Server/GameObjects/Components/CatwalkComponent.cs b/Content.Server/GameObjects/Components/CatwalkComponent.cs index 4e1769b210..4027c5045d 100644 --- a/Content.Server/GameObjects/Components/CatwalkComponent.cs +++ b/Content.Server/GameObjects/Components/CatwalkComponent.cs @@ -5,6 +5,7 @@ namespace Content.Server.GameObjects.Components /// /// Literally just a marker component for footsteps for now. /// + [RegisterComponent] public sealed class CatwalkComponent : Component { public override string Name => "Catwalk"; diff --git a/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs b/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs index a052eea348..7398bd83c6 100644 --- a/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs @@ -1,6 +1,7 @@ using System; using Content.Shared.Chemistry; using Content.Shared.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; namespace Content.Server.GameObjects.Components.Chemistry @@ -8,6 +9,7 @@ namespace Content.Server.GameObjects.Components.Chemistry /// /// Shared ECS component that manages a liquid solution of reagents. /// + [RegisterComponent] internal class SolutionComponent : Shared.GameObjects.Components.Chemistry.SolutionComponent { /// @@ -131,7 +133,7 @@ namespace Content.Server.GameObjects.Components.Chemistry // pulling from an empty container, pointless to continue if (transferQuantity <= 0) return; - + var transferSolution = component.SplitSolution(transferQuantity); handSolutionComp.TryAddSolution(transferSolution); } diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index 4e35820fd6..86e64d2b5c 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -17,6 +17,7 @@ using static Content.Shared.Construction.ConstructionStepTool; namespace Content.Server.GameObjects.Components.Construction { + [RegisterComponent] public class ConstructionComponent : Component, IAttackBy { public override string Name => "Construction"; diff --git a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs index 2c58b26c14..8f13d8cf23 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs @@ -3,13 +3,11 @@ using Content.Server.GameObjects.Components.Stack; using Content.Server.GameObjects.EntitySystems; using Content.Shared.Construction; using Content.Shared.GameObjects.Components.Construction; -using Robust.Server.GameObjects; using Robust.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.Map; using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.GameObjects.Components; +using Robust.Shared.Interfaces.Map; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; using Robust.Shared.Map; @@ -18,6 +16,7 @@ using Robust.Shared.Prototypes; namespace Content.Server.GameObjects.Components.Construction { + [RegisterComponent] public class ConstructorComponent : SharedConstructorComponent { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Damage/DamageableComponent.cs b/Content.Server/GameObjects/Components/Damage/DamageableComponent.cs index 52b3c663c2..46909bf75f 100644 --- a/Content.Server/GameObjects/Components/Damage/DamageableComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DamageableComponent.cs @@ -1,12 +1,9 @@ -using Content.Server.Interfaces.GameObjects; -using System; +using System; using System.Collections.Generic; -using Robust.Shared.Maths; -using Robust.Shared.GameObjects; -using Robust.Shared.Utility; -using YamlDotNet.RepresentationModel; using Content.Server.Interfaces; +using Content.Server.Interfaces.GameObjects; using Content.Shared.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -18,6 +15,7 @@ namespace Content.Server.GameObjects /// A component that handles receiving damage and healing, /// as well as informing other components of it. /// + [RegisterComponent] public class DamageableComponent : SharedDamageableComponent, IDamageableComponent { /// diff --git a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs index daa1355754..d5efd91802 100644 --- a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs @@ -1,21 +1,21 @@ using System; using System.Collections.Generic; +using Content.Server.GameObjects.EntitySystems; +using Content.Server.Interfaces; +using Content.Shared.GameObjects; using Robust.Shared.GameObjects; -using Robust.Shared.Serialization; -using Robust.Shared.ViewVariables; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Maths; -using Content.Server.Interfaces; -using Content.Server.GameObjects.EntitySystems; -using Content.Shared.GameObjects; +using Robust.Shared.Serialization; +using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Destructible { /// /// Deletes the entity once a certain damage threshold has been reached. /// + [RegisterComponent] public class DestructibleComponent : Component, IOnDamageBehavior, IDestroyAct, IExAct { #pragma warning disable 649 @@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Destructible /// void IOnDamageBehavior.OnDamageThresholdPassed(object obj, DamageThresholdPassedEventArgs e) - { + { if (e.Passed && e.DamageThreshold == Threshold && destroyed == false) { destroyed = true; diff --git a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs index 6f9957d617..3ddee7f3bf 100644 --- a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs @@ -10,6 +10,8 @@ using Robust.Shared.Timers; namespace Content.Server.GameObjects { + [RegisterComponent] + [ComponentReference(typeof(IActivate))] public class ServerDoorComponent : Component, IActivate { public override string Name => "Door"; diff --git a/Content.Server/GameObjects/Components/Explosion/ExplosiveComponent.cs b/Content.Server/GameObjects/Components/Explosion/ExplosiveComponent.cs index a5e401efd6..656ccd4c5a 100644 --- a/Content.Server/GameObjects/Components/Explosion/ExplosiveComponent.cs +++ b/Content.Server/GameObjects/Components/Explosion/ExplosiveComponent.cs @@ -1,28 +1,27 @@ using System; using System.Linq; -using System.Collections.Generic; using Content.Server.GameObjects.Components.Mobs; -using Robust.Server.Interfaces.GameObjects; +using Content.Server.GameObjects.EntitySystems; +using Content.Shared.Maps; using Robust.Server.GameObjects.EntitySystems; -using Robust.Shared.GameObjects.EntitySystemMessages; +using Robust.Server.Interfaces.GameObjects; +using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.Timing; -using Robust.Shared.Interfaces.Map; +using Robust.Shared.GameObjects.EntitySystemMessages; using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.Map; +using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization; -using Content.Server.GameObjects.EntitySystems; -using Content.Shared.GameObjects; -using Content.Shared.Maps; -using Robust.Server.Interfaces.Player; namespace Content.Server.GameObjects.Components.Explosive { + [RegisterComponent] public class ExplosiveComponent : Component, ITimerTrigger, IDestroyAct { -#pragma warning disable 649 +#pragma warning disable 649 [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; [Dependency] private readonly IMapManager _mapManager; [Dependency] private readonly IServerEntityManager _serverEntityManager; @@ -66,7 +65,7 @@ namespace Content.Server.GameObjects.Components.Explosive if (distanceFromEntity < DevastationRange) { severity = ExplosionSeverity.Destruction; - } + } else if (distanceFromEntity < HeavyImpactRange) { severity = ExplosionSeverity.Heavy; diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index 69c14bcb5d..54b01700b3 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -5,8 +5,8 @@ using Content.Shared.GameObjects; using Robust.Server.GameObjects.Components.Container; using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; using Robust.Shared.Utility; @@ -16,6 +16,7 @@ using static Content.Shared.GameObjects.SharedInventoryComponent.ClientInventory namespace Content.Server.GameObjects { + [RegisterComponent] public class InventoryComponent : SharedInventoryComponent { [ViewVariables] diff --git a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs index a2477d2d2a..7b42e79451 100644 --- a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs @@ -3,16 +3,12 @@ using System.Collections.Generic; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects; using Content.Shared.GameObjects; -using Content.Shared.Input; -using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.EntitySystemMessages; using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; -using Robust.Shared.Input; using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; using Robust.Shared.Log; @@ -24,6 +20,8 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects { + [RegisterComponent] + [ComponentReference(typeof(IHandsComponent))] public class HandsComponent : SharedHandsComponent, IHandsComponent { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Healing/HealingComponent.cs b/Content.Server/GameObjects/Components/Healing/HealingComponent.cs index 82b5420fe6..5fb3bdc7cc 100644 --- a/Content.Server/GameObjects/Components/Healing/HealingComponent.cs +++ b/Content.Server/GameObjects/Components/Healing/HealingComponent.cs @@ -1,21 +1,12 @@ -using System; -using Content.Server.GameObjects.Components.Stack; -using Robust.Shared.GameObjects; +using Content.Server.GameObjects.Components.Stack; using Content.Server.GameObjects.EntitySystems; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Map; -using Robust.Shared.IoC; -using Robust.Server.GameObjects; -using Robust.Shared.Maths; -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Timing; -using Robust.Shared.GameObjects.EntitySystemMessages; -using Robust.Shared.Serialization; -using Robust.Shared.Interfaces.GameObjects.Components; using Content.Shared.GameObjects; +using Robust.Shared.GameObjects; +using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Weapon.Melee { + [RegisterComponent] public class HealingComponent : Component, IAfterAttack, IUse { public override string Name => "Healing"; diff --git a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs index b662990f1a..8f7817f775 100644 --- a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs @@ -16,6 +16,7 @@ namespace Content.Server.GameObjects.Components.Interactable /// /// Component that represents a handheld lightsource which can be toggled on and off. /// + [RegisterComponent] internal class HandheldLightComponent : Component, IUse, IExamine, IAttackBy, IMapInit { public const float Wattage = 10; diff --git a/Content.Server/GameObjects/Components/Interactable/Tools/CrowbarComponent.cs b/Content.Server/GameObjects/Components/Interactable/Tools/CrowbarComponent.cs index 3b7c0af218..2f61ad57ed 100644 --- a/Content.Server/GameObjects/Components/Interactable/Tools/CrowbarComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/Tools/CrowbarComponent.cs @@ -1,6 +1,7 @@ using Content.Server.GameObjects.EntitySystems; using Content.Shared.Maps; using Robust.Server.GameObjects.EntitySystems; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; @@ -8,6 +9,7 @@ using Robust.Shared.Map; namespace Content.Server.GameObjects.Components.Interactable.Tools { + [RegisterComponent] public class CrowbarComponent : ToolComponent, IAfterAttack { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Interactable/Tools/MultitoolComponent.cs b/Content.Server/GameObjects/Components/Interactable/Tools/MultitoolComponent.cs index 92f1972962..7493374f57 100644 --- a/Content.Server/GameObjects/Components/Interactable/Tools/MultitoolComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/Tools/MultitoolComponent.cs @@ -1,10 +1,13 @@ -namespace Content.Server.GameObjects.Components.Interactable.Tools +using Robust.Shared.GameObjects; + +namespace Content.Server.GameObjects.Components.Interactable.Tools { /// /// Tool used for interfacing/hacking into configurable computers /// + [RegisterComponent] public class MultitoolComponent : ToolComponent { public override string Name => "Multitool"; } -} \ No newline at end of file +} diff --git a/Content.Server/GameObjects/Components/Interactable/Tools/ScrewdriverComponent.cs b/Content.Server/GameObjects/Components/Interactable/Tools/ScrewdriverComponent.cs index 9095a3b2c8..8f69c1b2c7 100644 --- a/Content.Server/GameObjects/Components/Interactable/Tools/ScrewdriverComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/Tools/ScrewdriverComponent.cs @@ -1,5 +1,8 @@ -namespace Content.Server.GameObjects.Components.Interactable.Tools +using Robust.Shared.GameObjects; + +namespace Content.Server.GameObjects.Components.Interactable.Tools { + [RegisterComponent] public class ScrewdriverComponent : ToolComponent { /// @@ -7,4 +10,4 @@ /// public override string Name => "Screwdriver"; } -} \ No newline at end of file +} diff --git a/Content.Server/GameObjects/Components/Interactable/Tools/WelderComponent.cs b/Content.Server/GameObjects/Components/Interactable/Tools/WelderComponent.cs index cb1e6597b7..a7de418d8f 100644 --- a/Content.Server/GameObjects/Components/Interactable/Tools/WelderComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/Tools/WelderComponent.cs @@ -1,12 +1,10 @@ using System; -using System.Text; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Utility; -using YamlDotNet.RepresentationModel; -using Robust.Server.GameObjects; using Content.Server.GameObjects.EntitySystems; +using Robust.Server.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Serialization; +using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Interactable.Tools @@ -14,6 +12,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools /// /// Tool used to weld metal together, light things on fire, or melt into constituent parts /// + [RegisterComponent] class WelderComponent : ToolComponent, EntitySystems.IUse, EntitySystems.IExamine { SpriteComponent spriteComponent; diff --git a/Content.Server/GameObjects/Components/Interactable/Tools/WirecutterComponent.cs b/Content.Server/GameObjects/Components/Interactable/Tools/WirecutterComponent.cs index 8f7edaa0d3..bc7568c381 100644 --- a/Content.Server/GameObjects/Components/Interactable/Tools/WirecutterComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/Tools/WirecutterComponent.cs @@ -1,10 +1,13 @@ -namespace Content.Server.GameObjects.Components.Interactable.Tools +using Robust.Shared.GameObjects; + +namespace Content.Server.GameObjects.Components.Interactable.Tools { /// /// Tool that can be used for some cutting interactions such as wires or hacking /// + [RegisterComponent] public class WirecutterComponent : ToolComponent { public override string Name => "Wirecutter"; } -} \ No newline at end of file +} diff --git a/Content.Server/GameObjects/Components/Interactable/Tools/WrenchComponent.cs b/Content.Server/GameObjects/Components/Interactable/Tools/WrenchComponent.cs index 1b69b39ee9..8bb24680d9 100644 --- a/Content.Server/GameObjects/Components/Interactable/Tools/WrenchComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/Tools/WrenchComponent.cs @@ -1,10 +1,13 @@ -namespace Content.Server.GameObjects.Components.Interactable.Tools +using Robust.Shared.GameObjects; + +namespace Content.Server.GameObjects.Components.Interactable.Tools { /// /// Wrenches bolts, and interacts with things that have been bolted /// + [RegisterComponent] public class WrenchComponent : ToolComponent { public override string Name => "Wrench"; } -} \ No newline at end of file +} diff --git a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs index 6235e24ee0..4a216d5b12 100644 --- a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs @@ -1,15 +1,18 @@ +using System; +using System.Collections.Generic; +using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Items; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; -using System; -using System.Collections.Generic; -using Content.Server.GameObjects.EntitySystems; using Robust.Shared.Utility; using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines; namespace Content.Server.GameObjects { + [RegisterComponent] + [ComponentReference(typeof(ItemComponent))] + [ComponentReference(typeof(StoreableComponent))] public class ClothingComponent : ItemComponent, IUse { public override string Name => "Clothing"; diff --git a/Content.Server/GameObjects/Components/Items/DiceComponent.cs b/Content.Server/GameObjects/Components/Items/DiceComponent.cs index 78915e44de..ef9b10afb2 100644 --- a/Content.Server/GameObjects/Components/Items/DiceComponent.cs +++ b/Content.Server/GameObjects/Components/Items/DiceComponent.cs @@ -6,7 +6,6 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Maths; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -15,6 +14,7 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Items { + [RegisterComponent] public class DiceComponent : Component, IActivate, IUse, ILand, IExamine { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index fdf6029fbc..7ea736315b 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -1,4 +1,9 @@ -using Content.Server.GameObjects.EntitySystems; +using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components.Sound; +using Content.Server.GameObjects.EntitySystems; +using Content.Shared.GameObjects.Components.Storage; +using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; @@ -7,14 +12,12 @@ using Robust.Shared.Interfaces.Network; using Robust.Shared.Maths; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; -using System.Linq; -using Content.Server.GameObjects.Components.Items.Storage; -using Content.Server.GameObjects.Components.Sound; -using Content.Shared.GameObjects.Components.Storage; -using Robust.Server.GameObjects; namespace Content.Server.GameObjects.Components { + [RegisterComponent] + [ComponentReference(typeof(IActivate))] + [ComponentReference(typeof(IStorageComponent))] public class EntityStorageComponent : Component, IActivate, IStorageComponent { public override string Name => "EntityStorage"; diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs index 7071481fa1..d84e55d2f8 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs @@ -7,6 +7,7 @@ using Robust.Shared.Maths; namespace Content.Server.GameObjects.Components.Items.Storage.Fill { + [RegisterComponent] internal sealed class ToolLockerFillComponent : Component, IMapInit { public override string Name => "ToolLockerFill"; diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs index 40161e7c88..95227b7141 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs @@ -7,6 +7,7 @@ using Robust.Shared.Maths; namespace Content.Server.GameObjects.Components.Items.Storage.Fill { + [RegisterComponent] internal sealed class ToolboxElectricalFillComponent : Component, IMapInit { public override string Name => "ToolboxElectricalFill"; diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index 85f1668b5f..a5d61d955d 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -1,17 +1,18 @@ -using Content.Server.Interfaces.GameObjects; -using Robust.Server.Interfaces.GameObjects; -using Content.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; +using System; using Content.Server.GameObjects.EntitySystems; -using Robust.Shared.GameObjects; -using System; +using Content.Server.Interfaces.GameObjects; +using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Items; -using Content.Server.GameObjects.Components; using Robust.Server.GameObjects; +using Robust.Server.Interfaces.GameObjects; +using Robust.Shared.GameObjects; +using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Maths; namespace Content.Server.GameObjects { + [RegisterComponent] + [ComponentReference(typeof(StoreableComponent))] public class ItemComponent : StoreableComponent, IAttackHand { public override string Name => "Item"; diff --git a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs index f9a4b57b2c..f03d04cf91 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs @@ -1,32 +1,33 @@ -using System.Linq; +using System.Collections.Generic; +using System.Linq; +using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects.Components.Storage; +using Content.Shared.Interfaces; using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; +using Robust.Server.GameObjects.EntitySystemMessages; using Robust.Server.Interfaces.Player; using Robust.Server.Player; using Robust.Shared.Enums; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; +using Robust.Shared.Interfaces.Map; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Serialization; -using System.Collections.Generic; -using Content.Shared.Interfaces; -using Robust.Shared.GameObjects.EntitySystemMessages; -using Robust.Shared.Interfaces.Map; -using Robust.Shared.ViewVariables; -using Content.Server.GameObjects.Components; -using Content.Server.GameObjects.Components.Items.Storage; -using Robust.Server.GameObjects.EntitySystemMessages; namespace Content.Server.GameObjects { /// /// Storage component for containing entities within this one, matches a UI on the client which shows stored entities /// + [RegisterComponent] + [ComponentReference(typeof(IActivate))] + [ComponentReference(typeof(IStorageComponent))] public class ServerStorageComponent : SharedStorageComponent, IAttackBy, IUse, IActivate, IStorageComponent, IDestroyAct { #pragma warning disable 649 @@ -149,7 +150,7 @@ namespace Content.Server.GameObjects { return false; } - + //Check that we can drop the item from our hands first otherwise we obviously cant put it inside if (CanInsert(hands.GetActiveHand.Owner) && hands.Drop(hands.ActiveIndex)) { diff --git a/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs index b800fc58fa..7f25245112 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs @@ -3,6 +3,7 @@ using Robust.Shared.Serialization; namespace Content.Server.GameObjects { + [RegisterComponent] public class StoreableComponent : Component { public override string Name => "Storeable"; diff --git a/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs b/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs index 318931dbd8..7c8ea4f4e4 100644 --- a/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs @@ -1,4 +1,3 @@ -using System; using Content.Shared.GameObjects.Components.Markers; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -6,6 +5,8 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Markers { + [RegisterComponent] + [ComponentReference(typeof(SharedSpawnPointComponent))] public sealed class SpawnPointComponent : SharedSpawnPointComponent { private SpawnPointType _spawnType; diff --git a/Content.Server/GameObjects/Components/Mobs/CameraRecoilComponent.cs b/Content.Server/GameObjects/Components/Mobs/CameraRecoilComponent.cs index ce2c3e76ed..42fc2fba63 100644 --- a/Content.Server/GameObjects/Components/Mobs/CameraRecoilComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/CameraRecoilComponent.cs @@ -1,8 +1,11 @@ using Content.Shared.GameObjects.Components.Mobs; +using Robust.Shared.GameObjects; using Robust.Shared.Maths; namespace Content.Server.GameObjects.Components.Mobs { + [RegisterComponent] + [ComponentReference(typeof(SharedCameraRecoilComponent))] public sealed class CameraRecoilComponent : SharedCameraRecoilComponent { public override void Kick(Vector2 recoil) diff --git a/Content.Server/GameObjects/Components/Mobs/CombatModeComponent.cs b/Content.Server/GameObjects/Components/Mobs/CombatModeComponent.cs index 3b962f03d7..d5078ec107 100644 --- a/Content.Server/GameObjects/Components/Mobs/CombatModeComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/CombatModeComponent.cs @@ -8,6 +8,7 @@ namespace Content.Server.GameObjects.Components.Mobs /// This is used to differentiate between regular item interactions or /// using *everything* as a weapon. /// + [RegisterComponent] public sealed class CombatModeComponent : Component { public override string Name => "CombatMode"; diff --git a/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs b/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs index 193d215d9a..8d3283fe25 100644 --- a/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs @@ -1,9 +1,10 @@ using System; -using Robust.Shared.GameObjects; using Content.Shared.GameObjects.Components.Inventory; +using Robust.Shared.GameObjects; namespace Content.Server.GameObjects { + [RegisterComponent] public class HeatResistanceComponent : Component { public override string Name => "HeatResistance"; diff --git a/Content.Server/GameObjects/Components/Mobs/MindComponent.cs b/Content.Server/GameObjects/Components/Mobs/MindComponent.cs index 061d2d5315..882d827969 100644 --- a/Content.Server/GameObjects/Components/Mobs/MindComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/MindComponent.cs @@ -1,14 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Content.Server.Mobs; -using Robust.Server.GameObjects; +using Content.Server.Mobs; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Network; -using Robust.Shared.Log; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Mobs @@ -16,6 +8,7 @@ namespace Content.Server.GameObjects.Components.Mobs /// /// Stores a on a mob. /// + [RegisterComponent] public class MindComponent : Component { /// diff --git a/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs b/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs index 86029362a9..f703d53cea 100644 --- a/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs @@ -12,6 +12,7 @@ using Robust.Shared.Serialization; namespace Content.Server.GameObjects { + [RegisterComponent] public class SpeciesComponent : SharedSpeciesComponent, IActionBlocker, IOnDamageBehavior, IExAct { /// diff --git a/Content.Server/GameObjects/Components/Movement/AiControllerComponent.cs b/Content.Server/GameObjects/Components/Movement/AiControllerComponent.cs index 1c0647e244..686b097f46 100644 --- a/Content.Server/GameObjects/Components/Movement/AiControllerComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/AiControllerComponent.cs @@ -5,6 +5,7 @@ using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Movement { + [RegisterComponent] public class AiControllerComponent : Component, IMoverComponent { private string _logicName; diff --git a/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs b/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs index 645463a437..889a0d08ac 100644 --- a/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs @@ -12,6 +12,8 @@ namespace Content.Server.GameObjects.Components.Movement /// /// Moves the entity based on input from a KeyBindingInputComponent. /// + [RegisterComponent] + [ComponentReference(typeof(IMoverComponent))] public class PlayerInputMoverComponent : Component, IMoverComponent { private bool _movingUp; diff --git a/Content.Server/GameObjects/Components/Movement/ServerPortalComponent.cs b/Content.Server/GameObjects/Components/Movement/ServerPortalComponent.cs index 70eb876a8e..f76a8aea58 100644 --- a/Content.Server/GameObjects/Components/Movement/ServerPortalComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/ServerPortalComponent.cs @@ -4,6 +4,7 @@ using Content.Shared.GameObjects.Components.Movement; using Robust.Server.GameObjects; using Robust.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Serialization; @@ -12,6 +13,7 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Movement { + [RegisterComponent] public class ServerPortalComponent : SharedPortalComponent { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Movement/ServerTeleporterComponent.cs b/Content.Server/GameObjects/Components/Movement/ServerTeleporterComponent.cs index 78d97a2125..fca5b45b79 100644 --- a/Content.Server/GameObjects/Components/Movement/ServerTeleporterComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/ServerTeleporterComponent.cs @@ -9,7 +9,6 @@ using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization; @@ -19,6 +18,7 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Movement { + [RegisterComponent] public class ServerTeleporterComponent : Component, IAfterAttack { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Movement/TeleportableComponent.cs b/Content.Server/GameObjects/Components/Movement/TeleportableComponent.cs index f5f0701ca4..a20b672cc9 100644 --- a/Content.Server/GameObjects/Components/Movement/TeleportableComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/TeleportableComponent.cs @@ -1,8 +1,8 @@ using Robust.Shared.GameObjects; -using Robust.Shared.Log; namespace Content.Server.GameObjects.Components.Movement { + [RegisterComponent] public class TeleportableComponent : Component { public override string Name => "Teleportable"; diff --git a/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs b/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs index 7d8a624f1a..c27c5874ec 100644 --- a/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs +++ b/Content.Server/GameObjects/Components/PlaceableSurfaceComponent.cs @@ -4,6 +4,7 @@ using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components { + [RegisterComponent] public class PlaceableSurfaceComponent : Component, IAttackBy { public override string Name => "PlaceableSurface"; diff --git a/Content.Server/GameObjects/Components/Power/ApcComponent.cs b/Content.Server/GameObjects/Components/Power/ApcComponent.cs index 62206488fb..3e0b233f27 100644 --- a/Content.Server/GameObjects/Components/Power/ApcComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcComponent.cs @@ -3,15 +3,15 @@ using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects.Components.Power; using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.UserInterface; -using Robust.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.Audio; +using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components.UserInterface; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.IoC; namespace Content.Server.GameObjects.Components.Power { + [RegisterComponent] + [ComponentReference(typeof(IActivate))] public sealed class ApcComponent : SharedApcComponent, IActivate { PowerStorageComponent Storage; diff --git a/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs b/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs index 11cdb8cb42..9316dd6be9 100644 --- a/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs +++ b/Content.Server/GameObjects/Components/Power/LightBulbComponent.cs @@ -1,9 +1,9 @@ using System; +using Robust.Server.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; -using SpriteComponent = Robust.Server.GameObjects.SpriteComponent; namespace Content.Server.GameObjects.Components.Power { @@ -23,6 +23,7 @@ namespace Content.Server.GameObjects.Components.Power /// /// Component that represents a light bulb. Can be broken, or burned, which turns them mostly useless. /// + [RegisterComponent] public class LightBulbComponent : Component { diff --git a/Content.Server/GameObjects/Components/Power/PowerCellComponent.cs b/Content.Server/GameObjects/Components/Power/PowerCellComponent.cs index 5c25236961..fdaaf412be 100644 --- a/Content.Server/GameObjects/Components/Power/PowerCellComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerCellComponent.cs @@ -1,8 +1,11 @@ using Content.Shared.GameObjects.Components.Power; using Robust.Server.GameObjects; +using Robust.Shared.GameObjects; namespace Content.Server.GameObjects.Components.Power { + [RegisterComponent] + [ComponentReference(typeof(PowerStorageComponent))] public class PowerCellComponent : PowerStorageComponent { public override string Name => "PowerCell"; diff --git a/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs b/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs index ef06753a2a..47d744180a 100644 --- a/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs +++ b/Content.Server/GameObjects/Components/Power/PowerDebugTool.cs @@ -3,12 +3,13 @@ using System.Text; using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects.Components.Power; using Robust.Server.Interfaces.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; -using Robust.Shared.Map; namespace Content.Server.GameObjects.Components.Power { + [RegisterComponent] public class PowerDebugTool : SharedPowerDebugTool, IAfterAttack { void IAfterAttack.AfterAttack(AfterAttackEventArgs eventArgs) diff --git a/Content.Server/GameObjects/Components/Power/PowerDevice.cs b/Content.Server/GameObjects/Components/Power/PowerDevice.cs index 53a28dea75..f93930cc6c 100644 --- a/Content.Server/GameObjects/Components/Power/PowerDevice.cs +++ b/Content.Server/GameObjects/Components/Power/PowerDevice.cs @@ -1,22 +1,19 @@ -using Content.Server.GameObjects.EntitySystems; -using Robust.Server.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.GameObjects.Components; -using Robust.Shared.IoC; -using Robust.Shared.Serialization; -using Robust.Shared.Utility; -using System; +using System; using System.Collections.Generic; using System.Linq; +using Content.Server.GameObjects.EntitySystems; +using Robust.Shared.GameObjects; +using Robust.Shared.Interfaces.GameObjects.Components; +using Robust.Shared.Serialization; +using Robust.Shared.Utility; using Robust.Shared.ViewVariables; -using YamlDotNet.RepresentationModel; namespace Content.Server.GameObjects.Components.Power { /// /// Component that requires power to function /// + [RegisterComponent] public class PowerDeviceComponent : Component, EntitySystems.IExamine { public override string Name => "PowerDevice"; diff --git a/Content.Server/GameObjects/Components/Power/PowerGeneratorComponent.cs b/Content.Server/GameObjects/Components/Power/PowerGeneratorComponent.cs index c469974411..c2ac6203a6 100644 --- a/Content.Server/GameObjects/Components/Power/PowerGeneratorComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerGeneratorComponent.cs @@ -1,18 +1,13 @@ using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Serialization; -using Robust.Shared.Utility; -using System; using Robust.Shared.ViewVariables; -using YamlDotNet.RepresentationModel; namespace Content.Server.GameObjects.Components.Power { /// /// Component that creates power and supplies it to the powernet /// + [RegisterComponent] public class PowerGeneratorComponent : Component { public override string Name => "PowerGenerator"; diff --git a/Content.Server/GameObjects/Components/Power/PowerNodeComponent.cs b/Content.Server/GameObjects/Components/Power/PowerNodeComponent.cs index 7a4bbb39e9..e44ee1d910 100644 --- a/Content.Server/GameObjects/Components/Power/PowerNodeComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerNodeComponent.cs @@ -1,10 +1,9 @@ -using Robust.Server.GameObjects; +using System; +using System.Linq; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.IoC; -using System; -using System.Linq; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Power @@ -12,6 +11,7 @@ namespace Content.Server.GameObjects.Components.Power /// /// Component that connects to the powernet /// + [RegisterComponent] public class PowerNodeComponent : Component { public override string Name => "PowerNode"; diff --git a/Content.Server/GameObjects/Components/Power/PowerProviderComponent.cs b/Content.Server/GameObjects/Components/Power/PowerProviderComponent.cs index 78ff050583..3d91440636 100644 --- a/Content.Server/GameObjects/Components/Power/PowerProviderComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerProviderComponent.cs @@ -1,22 +1,20 @@ -using Robust.Server.GameObjects; +using System.Collections.Generic; +using System.Linq; using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Serialization; -using Robust.Shared.Utility; -using System; -using System.Collections.Generic; -using System.Linq; using Robust.Shared.ViewVariables; -using YamlDotNet.RepresentationModel; namespace Content.Server.GameObjects.Components.Power { /// /// Component that wirelessly connects and powers devices, connects to powernet via node and can be combined with internal storage component /// + [RegisterComponent] + [ComponentReference(typeof(PowerDeviceComponent))] public class PowerProviderComponent : PowerDeviceComponent { public override string Name => "PowerProvider"; diff --git a/Content.Server/GameObjects/Components/Power/PowerStorageNetComponent.cs b/Content.Server/GameObjects/Components/Power/PowerStorageNetComponent.cs index 6b8ad3cd97..e2e661dbb9 100644 --- a/Content.Server/GameObjects/Components/Power/PowerStorageNetComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerStorageNetComponent.cs @@ -1,3 +1,4 @@ +using Robust.Shared.GameObjects; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -6,6 +7,8 @@ namespace Content.Server.GameObjects.Components.Power /// /// Feeds energy from the powernet and may have the ability to supply back into it /// + [RegisterComponent] + [ComponentReference(typeof(PowerStorageComponent))] public class PowerStorageNetComponent : PowerStorageComponent { public override string Name => "PowerStorage"; diff --git a/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs b/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs index cd0588c5b9..79771febfa 100644 --- a/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs @@ -1,20 +1,18 @@ -using Content.Server.GameObjects.EntitySystems; -using Robust.Server.GameObjects; +using System.Linq; +using Content.Server.GameObjects.Components.Interactable.Tools; +using Content.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using System.Linq; -using Robust.Shared.Interfaces.GameObjects; -using Content.Server.GameObjects.Components.Interactable.Tools; using Robust.Shared.Interfaces.GameObjects.Components; +using Robust.Shared.IoC; using Robust.Shared.ViewVariables; -using System; namespace Content.Server.GameObjects.Components.Power { /// /// Component to transfer power to nearby components, can create powernets and connect to nodes /// + [RegisterComponent] public class PowerTransferComponent : Component, IAttackBy { public override string Name => "PowerTransfer"; diff --git a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs index 651c129bf1..5804722fc0 100644 --- a/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PoweredLightComponent.cs @@ -17,6 +17,7 @@ namespace Content.Server.GameObjects.Components.Power /// /// Component that represents a wall light. It has a light bulb that can be replaced when broken. /// + [RegisterComponent] public class PoweredLightComponent : Component, IAttackHand, IAttackBy { public override string Name => "PoweredLight"; diff --git a/Content.Server/GameObjects/Components/Power/SmesComponent.cs b/Content.Server/GameObjects/Components/Power/SmesComponent.cs index 9576980b79..eba642ef27 100644 --- a/Content.Server/GameObjects/Components/Power/SmesComponent.cs +++ b/Content.Server/GameObjects/Components/Power/SmesComponent.cs @@ -1,5 +1,4 @@ -using System; -using Content.Shared.GameObjects.Components.Power; +using Content.Shared.GameObjects.Components.Power; using Content.Shared.Utility; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; @@ -11,6 +10,7 @@ namespace Content.Server.GameObjects.Components.Power /// This is operations that are specific to the SMES, like UI and visuals. /// Code interfacing with the powernet is handled in . /// + [RegisterComponent] public class SmesComponent : Component { public override string Name => "Smes"; diff --git a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs index eb21642190..48051aa31d 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs @@ -1,14 +1,15 @@ using System.Collections.Generic; +using Content.Server.GameObjects.Components.Mobs; +using Content.Shared.GameObjects; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Physics; using Robust.Shared.Interfaces.GameObjects.Components; -using Content.Server.GameObjects.Components.Mobs; -using Content.Shared.GameObjects; +using Robust.Shared.Interfaces.Physics; namespace Content.Server.GameObjects.Components.Projectiles { + [RegisterComponent] public class ProjectileComponent : Component, ICollideSpecial, ICollideBehavior { public override string Name => "Projectile"; diff --git a/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs index dd1f1198e6..4d3e716150 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ThrownItemComponent.cs @@ -11,6 +11,7 @@ using Robust.Shared.IoC; namespace Content.Server.GameObjects.Components { + [RegisterComponent] class ThrownItemComponent : ProjectileComponent, ICollideBehavior { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Research/LatheComponent.cs b/Content.Server/GameObjects/Components/Research/LatheComponent.cs index 437a89fbd0..dad97a3d91 100644 --- a/Content.Server/GameObjects/Components/Research/LatheComponent.cs +++ b/Content.Server/GameObjects/Components/Research/LatheComponent.cs @@ -6,15 +6,16 @@ using Content.Shared.GameObjects.Components.Research; using Content.Shared.Research; using Robust.Server.GameObjects.Components.UserInterface; using Robust.Server.Interfaces.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components.UserInterface; -using Robust.Shared.IoC; -using Robust.Shared.Prototypes; using Robust.Shared.Timers; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Research { + [RegisterComponent] + [ComponentReference(typeof(IActivate))] public class LatheComponent : SharedLatheComponent, IAttackBy, IActivate { public const int VolumePerSheet = 3750; diff --git a/Content.Server/GameObjects/Components/Research/LatheDatabaseComponent.cs b/Content.Server/GameObjects/Components/Research/LatheDatabaseComponent.cs index f6fcb395d5..d43d5e052f 100644 --- a/Content.Server/GameObjects/Components/Research/LatheDatabaseComponent.cs +++ b/Content.Server/GameObjects/Components/Research/LatheDatabaseComponent.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using Content.Shared.GameObjects.Components.Research; using Content.Shared.Research; using Robust.Shared.GameObjects; @@ -6,6 +5,8 @@ using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Research { + [RegisterComponent] + [ComponentReference(typeof(SharedLatheDatabaseComponent))] public class LatheDatabaseComponent : SharedLatheDatabaseComponent { /// diff --git a/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs b/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs index 2d1d22f061..47c3958cd4 100644 --- a/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs @@ -1,11 +1,12 @@ using System.Collections.Generic; using Content.Shared.GameObjects.Components.Research; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.Network; using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Research { + [RegisterComponent] + [ComponentReference(typeof(SharedMaterialStorageComponent))] public class MaterialStorageComponent : SharedMaterialStorageComponent { protected override Dictionary Storage { get; set; } = new Dictionary(); diff --git a/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent].cs b/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent].cs index 05b6383eb5..96059435a7 100644 --- a/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent].cs +++ b/Content.Server/GameObjects/Components/Sound/EmitSoundOnUseComponent].cs @@ -1,29 +1,18 @@ -using System; -using System.Collections.Generic; -using Robust.Shared.GameObjects; -using Robust.Shared.Log; -using Robust.Shared.Utility; -using YamlDotNet.RepresentationModel; -using Content.Server.Interfaces; -using Content.Shared.GameObjects; -using Robust.Shared.Serialization; -using Robust.Shared.ViewVariables; -using Content.Server.GameObjects.EntitySystems; -using Robust.Server.GameObjects.EntitySystems; -using Content.Shared.Audio; -using Robust.Shared.Prototypes; -using Robust.Shared.IoC; +using Content.Server.GameObjects.EntitySystems; using Robust.Shared.Audio; +using Robust.Shared.GameObjects; +using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Sound { /// /// Simple sound emitter that emits sound on use in hand /// + [RegisterComponent] public class EmitSoundOnUseComponent : Component, IUse { /// - /// + /// public override string Name => "EmitSoundOnUse"; public string _soundName; diff --git a/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs b/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs index f7ed7e3aa4..1cf60c0bc5 100644 --- a/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs +++ b/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs @@ -1,33 +1,25 @@ using System; -using System.Collections.Generic; -using Robust.Shared.GameObjects; -using Robust.Shared.Log; -using Robust.Shared.Utility; -using YamlDotNet.RepresentationModel; -using Content.Server.Interfaces; -using Content.Shared.GameObjects; -using Robust.Shared.Serialization; -using Robust.Shared.ViewVariables; -using Content.Server.GameObjects.EntitySystems; -using Robust.Server.GameObjects.EntitySystems; using Content.Shared.Audio; -using Robust.Shared.Prototypes; +using Robust.Shared.Audio; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; -using Robust.Shared.Audio; +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Sound { /// /// Changes footstep sound /// + [RegisterComponent] public class FootstepModifierComponent : Component { #pragma warning disable 649 [Dependency] private readonly IPrototypeManager _prototypeManager; #pragma warning restore 649 /// - /// + /// private Random _footstepRandom; public override string Name => "FootstepModifier"; diff --git a/Content.Server/GameObjects/Components/Sound/SoundComponent.cs b/Content.Server/GameObjects/Components/Sound/SoundComponent.cs index 9a136031ea..975d90abbc 100644 --- a/Content.Server/GameObjects/Components/Sound/SoundComponent.cs +++ b/Content.Server/GameObjects/Components/Sound/SoundComponent.cs @@ -1,16 +1,11 @@ -using System.Collections.Generic; using Content.Shared.GameObjects.Components.Sound; -using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.Audio; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Network; -using Robust.Shared.Log; -using Robust.Shared.Map; -using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Sound { + [RegisterComponent] public class SoundComponent : SharedSoundComponent { /// diff --git a/Content.Server/GameObjects/Components/Stack/StackComponent.cs b/Content.Server/GameObjects/Components/Stack/StackComponent.cs index c3cdc59077..40fbf6eb83 100644 --- a/Content.Server/GameObjects/Components/Stack/StackComponent.cs +++ b/Content.Server/GameObjects/Components/Stack/StackComponent.cs @@ -10,6 +10,7 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Stack { // TODO: Naming and presentation and such could use some improvement. + [RegisterComponent] public class StackComponent : Component, IAttackBy, IExamine { private const string SerializationCache = "stack"; diff --git a/Content.Server/GameObjects/Components/Temperature/TemperatureComponent.cs b/Content.Server/GameObjects/Components/Temperature/TemperatureComponent.cs index 811b102a65..5ab4fbbe4b 100644 --- a/Content.Server/GameObjects/Components/Temperature/TemperatureComponent.cs +++ b/Content.Server/GameObjects/Components/Temperature/TemperatureComponent.cs @@ -1,10 +1,8 @@ -using Content.Server.Interfaces.GameObjects; -using Content.Shared.Maths; -using System; -using Robust.Shared.GameObjects; -using Robust.Shared.Utility; -using YamlDotNet.RepresentationModel; +using System; +using Content.Server.Interfaces.GameObjects; using Content.Shared.GameObjects; +using Content.Shared.Maths; +using Robust.Shared.GameObjects; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -15,6 +13,7 @@ namespace Content.Server.GameObjects /// informing others of the current temperature, /// and taking fire damage from high temperature. /// + [RegisterComponent] public class TemperatureComponent : Component, ITemperatureComponent { /// diff --git a/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs b/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs index b41bd35bbd..19d77f4ad7 100644 --- a/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs +++ b/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs @@ -1,14 +1,15 @@ using System; +using Content.Server.GameObjects.EntitySystems; +using Content.Shared.GameObjects.Components.Triggers; using Robust.Server.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Serialization; -using Robust.Shared.GameObjects; -using Content.Server.GameObjects.EntitySystems; -using Content.Shared.GameObjects.Components.Triggers; namespace Content.Server.GameObjects.Components.Triggers { + [RegisterComponent] public class OnUseTimerTriggerComponent : Component, IUse { #pragma warning disable 649 @@ -28,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Triggers public override void Initialize() { - base.Initialize(); + base.Initialize(); } bool IUse.UseEntity(UseEntityEventArgs eventArgs) @@ -41,4 +42,4 @@ namespace Content.Server.GameObjects.Components.Triggers return true; } } -} \ No newline at end of file +} diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index e37772a956..6f9cb85961 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -1,14 +1,15 @@ -using Robust.Shared.GameObjects; -using Content.Server.GameObjects.EntitySystems; +using Content.Server.GameObjects.EntitySystems; +using Content.Shared.GameObjects; +using Robust.Server.Interfaces.GameObjects; +using Robust.Shared.GameObjects; +using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; using Robust.Shared.Maths; -using Robust.Server.Interfaces.GameObjects; using Robust.Shared.Serialization; -using Content.Shared.GameObjects; -using Robust.Shared.Interfaces.Map; namespace Content.Server.GameObjects.Components.Weapon.Melee { + [RegisterComponent] public class MeleeWeaponComponent : Component, IAttack { #pragma warning disable 649 diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponCapacitorComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponCapacitorComponent.cs index 6a58ff3a46..5df47f000b 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponCapacitorComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponCapacitorComponent.cs @@ -1,11 +1,13 @@ using System; -using Content.Shared.GameObjects.Components.Power; using Content.Server.GameObjects.Components.Power; -using Robust.Shared.Serialization; +using Content.Shared.GameObjects.Components.Power; using Robust.Server.GameObjects; +using Robust.Shared.GameObjects; +using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan { + [RegisterComponent] public class HitscanWeaponCapacitorComponent : PowerCellComponent { private AppearanceComponent _appearance; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs index b5cb365b9b..1d4998b3ea 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs @@ -1,6 +1,13 @@ -using Content.Shared.GameObjects; +using System; +using Content.Server.GameObjects.Components.Power; +using Content.Server.GameObjects.Components.Sound; +using Content.Server.GameObjects.EntitySystems; +using Content.Shared.GameObjects; +using Content.Shared.Interfaces; +using Content.Shared.Physics; using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.Audio; +using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.EntitySystemMessages; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Physics; @@ -10,16 +17,10 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Serialization; -using System; -using Content.Server.GameObjects.Components.Sound; -using Robust.Shared.GameObjects; -using Content.Server.GameObjects.EntitySystems; -using Content.Server.GameObjects.Components.Power; -using Content.Shared.Interfaces; -using Content.Shared.Physics; namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan { + [RegisterComponent] public class HitscanWeaponComponent : Component, IAttackBy { private const float MaxLength = 20; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticBulletComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticBulletComponent.cs index adbacdd85a..93176615a1 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticBulletComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticBulletComponent.cs @@ -3,6 +3,7 @@ using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile { + [RegisterComponent] public class BallisticBulletComponent : Component { public override string Name => "BallisticBullet"; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineComponent.cs index 4ee7e2a16a..8595fbf30b 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineComponent.cs @@ -11,6 +11,7 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile { + [RegisterComponent] public class BallisticMagazineComponent : Component, IMapInit { public override string Name => "BallisticMagazine"; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineWeaponComponent.cs index ff56a12062..7b6dccfe06 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Projectile/BallisticMagazineWeaponComponent.cs @@ -8,6 +8,7 @@ using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.Audio; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Serialization; @@ -16,6 +17,7 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile { + [RegisterComponent] public class BallisticMagazineWeaponComponent : BallisticWeaponComponent, IUse, IAttackBy, IMapInit { public override string Name => "BallisticMagazineWeapon"; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs index 0c82bd11cc..fe03f74eb8 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/RangedWeapon.cs @@ -1,18 +1,17 @@ using System; -using Robust.Shared.GameObjects; -using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects.Components.Weapons.Ranged; using Robust.Server.Interfaces.Player; +using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Network; using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Timers; namespace Content.Server.GameObjects.Components.Weapon.Ranged { + [RegisterComponent] public sealed class RangedWeaponComponent : SharedRangedWeaponComponent { private TimeSpan _lastFireTime; diff --git a/Content.Shared/Chemistry/Solution.cs b/Content.Shared/Chemistry/Solution.cs index ef305605fe..472503b4df 100644 --- a/Content.Shared/Chemistry/Solution.cs +++ b/Content.Shared/Chemistry/Solution.cs @@ -55,7 +55,7 @@ namespace Content.Shared.Chemistry } /// - /// Adds a given quantity of a reagent directly into the solution. + /// Adds a given quantity of a reagent directly into the solution. /// /// The prototype ID of the reagent to add. /// The quantity in milli-units. @@ -193,7 +193,7 @@ namespace Content.Shared.Chemistry return newSolution; } - + public void AddSolution(Solution otherSolution) { for (var i = 0; i < otherSolution._contents.Count; i++) @@ -232,7 +232,7 @@ namespace Content.Shared.Chemistry newSolution._contents.Add(reagent); volume += reagent.Quantity; } - + newSolution.TotalVolume = volume; return newSolution; } @@ -257,7 +257,7 @@ namespace Content.Shared.Chemistry } #region Enumeration - + public IEnumerator GetEnumerator() { return _contents.GetEnumerator(); diff --git a/Content.Shared/GameObjects/Components/Materials/MaterialComponent.cs b/Content.Shared/GameObjects/Components/Materials/MaterialComponent.cs index 2514c9cdfc..63e07d9b16 100644 --- a/Content.Shared/GameObjects/Components/Materials/MaterialComponent.cs +++ b/Content.Shared/GameObjects/Components/Materials/MaterialComponent.cs @@ -14,6 +14,7 @@ namespace Content.Shared.GameObjects.Components.Materials /// Component to store data such as "this object is made out of steel". /// This is not a storage system for say smelteries. /// + [RegisterComponent] public class MaterialComponent : Component { public const string SerializationCache = "mat"; diff --git a/Content.Shared/GameObjects/Components/Mobs/ExaminerComponent.cs b/Content.Shared/GameObjects/Components/Mobs/ExaminerComponent.cs index 536a4f573a..9d3f01becf 100644 --- a/Content.Shared/GameObjects/Components/Mobs/ExaminerComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/ExaminerComponent.cs @@ -7,6 +7,7 @@ namespace Content.Shared.GameObjects.Components.Mobs /// /// Component required for a player to be able to examine things. /// + [RegisterComponent] public sealed class ExaminerComponent : Component { public override string Name => "Examiner";