diff --git a/Content.Client/Chat/ChatManager.cs b/Content.Client/Chat/ChatManager.cs index 8553c6ed58..b59d039581 100644 --- a/Content.Client/Chat/ChatManager.cs +++ b/Content.Client/Chat/ChatManager.cs @@ -70,14 +70,12 @@ namespace Content.Client.Chat // Flag Enums for holding filtered channels private ChatChannel _filteredChannels; -#pragma warning disable 649 - [Dependency] private readonly IClientNetManager _netManager; - [Dependency] private readonly IClientConsole _console; - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IEyeManager _eyeManager; - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; + [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private readonly IClientConsole _console = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; [Dependency] private readonly IClientConGroupController _groupController = default!; -#pragma warning restore 649 private ChatBox _currentChatBox; private Control _speechBubbleRoot; @@ -231,7 +229,7 @@ namespace Content.Client.Chat { string locWarning = Loc.GetString("Your message exceeds {0} character limit", _maxMessageLength); _currentChatBox?.AddLine(locWarning, ChatChannel.Server, Color.Orange); - _currentChatBox.ClearOnEnter = false; // The text shouldn't be cleared if it hasn't been sent + _currentChatBox.ClearOnEnter = false; // The text shouldn't be cleared if it hasn't been sent return; } diff --git a/Content.Client/ClientNotifyManager.cs b/Content.Client/ClientNotifyManager.cs index 1a5e6d82a0..4481945b21 100644 --- a/Content.Client/ClientNotifyManager.cs +++ b/Content.Client/ClientNotifyManager.cs @@ -21,14 +21,12 @@ namespace Content.Client { public class ClientNotifyManager : SharedNotifyManager, IClientNotifyManager { -#pragma warning disable 649 - [Dependency] private IPlayerManager _playerManager; - [Dependency] private IUserInterfaceManager _userInterfaceManager; - [Dependency] private IInputManager _inputManager; - [Dependency] private IEyeManager _eyeManager; - [Dependency] private IClientNetManager _netManager; - [Dependency] private IEntityManager _entityManager; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; private readonly List _aliveLabels = new List(); private bool _initialized; diff --git a/Content.Client/ClientPreferencesManager.cs b/Content.Client/ClientPreferencesManager.cs index 5b0296dcde..e1e35704aa 100644 --- a/Content.Client/ClientPreferencesManager.cs +++ b/Content.Client/ClientPreferencesManager.cs @@ -14,9 +14,7 @@ namespace Content.Client /// public class ClientPreferencesManager : SharedPreferencesManager, IClientPreferencesManager { -#pragma warning disable 649 - [Dependency] private readonly IClientNetManager _netManager; -#pragma warning restore 649 + [Dependency] private readonly IClientNetManager _netManager = default!; public event Action OnServerDataLoaded; public GameSettings Settings { get; private set; } diff --git a/Content.Client/Command/CommunicationsConsoleMenu.cs b/Content.Client/Command/CommunicationsConsoleMenu.cs index a04bb56edb..15dfd36b56 100644 --- a/Content.Client/Command/CommunicationsConsoleMenu.cs +++ b/Content.Client/Command/CommunicationsConsoleMenu.cs @@ -12,9 +12,7 @@ namespace Content.Client.Command { public class CommunicationsConsoleMenu : SS14Window { -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _localizationManager; -#pragma warning restore 649 + [Dependency] private readonly ILocalizationManager _localizationManager = default!; protected override Vector2? CustomSize => new Vector2(600, 400); diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index 9b9a487243..089d2245f1 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -22,11 +22,9 @@ namespace Content.Client.Construction { public class ConstructionMenu : SS14Window { -#pragma warning disable CS0649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly IEntitySystemManager _systemManager; -#pragma warning restore + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IEntitySystemManager _systemManager = default!; private readonly Button BuildButton; private readonly Button EraseButton; diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs index ef26c72a49..912440baac 100644 --- a/Content.Client/EntryPoint.cs +++ b/Content.Client/EntryPoint.cs @@ -39,14 +39,12 @@ namespace Content.Client { public class EntryPoint : GameClient { -#pragma warning disable 649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IBaseClient _baseClient; - [Dependency] private readonly IEscapeMenuOwner _escapeMenuOwner; - [Dependency] private readonly IGameController _gameController; - [Dependency] private readonly IStateManager _stateManager; - [Dependency] private readonly IConfigurationManager _configurationManager; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IBaseClient _baseClient = default!; + [Dependency] private readonly IEscapeMenuOwner _escapeMenuOwner = default!; + [Dependency] private readonly IGameController _gameController = default!; + [Dependency] private readonly IStateManager _stateManager = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; public override void Init() { diff --git a/Content.Client/EscapeMenuOwner.cs b/Content.Client/EscapeMenuOwner.cs index 93acf5b298..11a4ebdacb 100644 --- a/Content.Client/EscapeMenuOwner.cs +++ b/Content.Client/EscapeMenuOwner.cs @@ -17,18 +17,16 @@ namespace Content.Client { internal sealed class EscapeMenuOwner : IEscapeMenuOwner { -#pragma warning disable 649 - [Dependency] private readonly IClientConsole _clientConsole; - [Dependency] private readonly IConfigurationManager _configurationManager; - [Dependency] private readonly IInputManager _inputManager; - [Dependency] private readonly IPlacementManager _placementManager; - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly IStateManager _stateManager; - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly ILocalizationManager _localizationManager; -#pragma warning restore 649 + [Dependency] private readonly IClientConsole _clientConsole = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IPlacementManager _placementManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IStateManager _stateManager = default!; + [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly ILocalizationManager _localizationManager = default!; private EscapeMenu _escapeMenu; diff --git a/Content.Client/GameObjects/Components/Access/IdCardConsoleBoundUserInterface.cs b/Content.Client/GameObjects/Components/Access/IdCardConsoleBoundUserInterface.cs index 9df2ab0d16..1c66237da2 100644 --- a/Content.Client/GameObjects/Components/Access/IdCardConsoleBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Access/IdCardConsoleBoundUserInterface.cs @@ -10,10 +10,9 @@ namespace Content.Client.GameObjects.Components.Access { public class IdCardConsoleBoundUserInterface : BoundUserInterface { -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _localizationManager; - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly ILocalizationManager _localizationManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + public IdCardConsoleBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) { } diff --git a/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs b/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs index dfb7e3c796..2ed1e9c1dd 100644 --- a/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs +++ b/Content.Client/GameObjects/Components/Actor/CharacterInfoComponent.cs @@ -14,12 +14,10 @@ namespace Content.Client.GameObjects.Components.Actor [RegisterComponent] public sealed class CharacterInfoComponent : Component, ICharacterUI { - private CharacterInfoControl _control; + [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _loc; - [Dependency] private readonly IResourceCache _resourceCache; -#pragma warning restore 649 + private CharacterInfoControl _control; public override string Name => "CharacterInfo"; diff --git a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs index c2b66a9b07..f776411554 100644 --- a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs +++ b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs @@ -20,12 +20,9 @@ namespace Content.Client.GameObjects.Components.Actor [RegisterComponent] public class CharacterInterface : Component { - public override string Name => "Character Interface Component"; + [Dependency] private readonly IGameHud _gameHud = default!; - [Dependency] -#pragma warning disable 649 - private readonly IGameHud _gameHud; -#pragma warning restore 649 + public override string Name => "Character Interface Component"; /// /// Window to hold each of the character interfaces diff --git a/Content.Client/GameObjects/Components/Cargo/GalacticMarketComponent.cs b/Content.Client/GameObjects/Components/Cargo/GalacticMarketComponent.cs index 1311900514..786c0c3d6e 100644 --- a/Content.Client/GameObjects/Components/Cargo/GalacticMarketComponent.cs +++ b/Content.Client/GameObjects/Components/Cargo/GalacticMarketComponent.cs @@ -10,9 +10,7 @@ namespace Content.Client.GameObjects.Components.Cargo [RegisterComponent] public class GalacticMarketComponent : SharedGalacticMarketComponent { -#pragma warning disable CS0649 - [Dependency] private IPrototypeManager _prototypeManager; -#pragma warning restore + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; /// /// Event called when the database is updated. diff --git a/Content.Client/GameObjects/Components/Chemistry/ChemMaster/ChemMasterWindow.cs b/Content.Client/GameObjects/Components/Chemistry/ChemMaster/ChemMasterWindow.cs index 4bf3482a2c..0524a87ff7 100644 --- a/Content.Client/GameObjects/Components/Chemistry/ChemMaster/ChemMasterWindow.cs +++ b/Content.Client/GameObjects/Components/Chemistry/ChemMaster/ChemMasterWindow.cs @@ -21,9 +21,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster /// public class ChemMasterWindow : SS14Window { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; /// Contains info about the reagent container such as it's contents, if one is loaded into the dispenser. private readonly VBoxContainer ContainerInfo; diff --git a/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserWindow.cs b/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserWindow.cs index 76b168eae3..d32d10f776 100644 --- a/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserWindow.cs +++ b/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserWindow.cs @@ -20,9 +20,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser /// public class ReagentDispenserWindow : SS14Window { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; /// Contains info about the reagent container such as it's contents, if one is loaded into the dispenser. private readonly VBoxContainer ContainerInfo; diff --git a/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs b/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs index 20c060cc3c..e4790a1ae9 100644 --- a/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs @@ -11,12 +11,9 @@ namespace Content.Client.GameObjects.Components.Command { public class CommunicationsConsoleBoundUserInterface : BoundUserInterface { - [ViewVariables] - private CommunicationsConsoleMenu _menu; + [Dependency] private readonly IGameTiming _gameTiming = default!; -#pragma warning disable 649 - [Dependency] private IGameTiming _gameTiming; -#pragma warning restore 649 + [ViewVariables] private CommunicationsConsoleMenu _menu; public bool CountdownStarted { get; private set; } diff --git a/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs b/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs index d08d3e1211..8057ec4d0d 100644 --- a/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs +++ b/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs @@ -18,11 +18,9 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory [UsedImplicitly] public class HumanInventoryInterfaceController : InventoryInterfaceController { -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _loc; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly IItemSlotManager _itemSlotManager; -#pragma warning restore 649 + [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IItemSlotManager _itemSlotManager = default!; private readonly Dictionary> _inventoryButtons = new Dictionary>(); @@ -43,7 +41,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory base.Initialize(); _window = new HumanInventoryWindow(_loc, _resourceCache); - _window.OnClose += () => _gameHud.InventoryButtonDown = false; + _window.OnClose += () => GameHud.InventoryButtonDown = false; foreach (var (slot, button) in _window.Buttons) { button.OnPressed = (e) => AddToInventory(e, slot); @@ -153,7 +151,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory { base.PlayerAttached(); - _gameHud.InventoryQuickButtonContainer.AddChild(_quickButtonsContainer); + GameHud.InventoryQuickButtonContainer.AddChild(_quickButtonsContainer); // Update all the buttons to make sure they check out. @@ -175,7 +173,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory { base.PlayerDetached(); - _gameHud.InventoryQuickButtonContainer.RemoveChild(_quickButtonsContainer); + GameHud.InventoryQuickButtonContainer.RemoveChild(_quickButtonsContainer); foreach (var (slot, list) in _inventoryButtons) { diff --git a/Content.Client/GameObjects/Components/HUD/Inventory/InventoryInterfaceController.cs b/Content.Client/GameObjects/Components/HUD/Inventory/InventoryInterfaceController.cs index 12cf3375c2..73c18852f5 100644 --- a/Content.Client/GameObjects/Components/HUD/Inventory/InventoryInterfaceController.cs +++ b/Content.Client/GameObjects/Components/HUD/Inventory/InventoryInterfaceController.cs @@ -12,9 +12,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory { public abstract class InventoryInterfaceController : IDisposable { -#pragma warning disable 649 - [Dependency] protected readonly IGameHud _gameHud; -#pragma warning restore 649 + [Dependency] protected readonly IGameHud GameHud = default!; protected InventoryInterfaceController(ClientInventoryComponent owner) { @@ -31,8 +29,8 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory public virtual void PlayerAttached() { - _gameHud.InventoryButtonVisible = true; - _gameHud.InventoryButtonToggled = b => + GameHud.InventoryButtonVisible = true; + GameHud.InventoryButtonToggled = b => { if (b) { @@ -47,7 +45,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory public virtual void PlayerDetached() { - _gameHud.InventoryButtonVisible = false; + GameHud.InventoryButtonVisible = false; Window.Close(); } diff --git a/Content.Client/GameObjects/Components/InteractionOutlineComponent.cs b/Content.Client/GameObjects/Components/InteractionOutlineComponent.cs index 5529642be9..b04aa0afb9 100644 --- a/Content.Client/GameObjects/Components/InteractionOutlineComponent.cs +++ b/Content.Client/GameObjects/Components/InteractionOutlineComponent.cs @@ -9,15 +9,13 @@ namespace Content.Client.GameObjects.Components [RegisterComponent] public class InteractionOutlineComponent : Component { + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + private const string ShaderInRange = "SelectionOutlineInrange"; private const string ShaderOutOfRange = "SelectionOutline"; public override string Name => "InteractionOutline"; -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 - private ShaderInstance _selectionShaderInstance; private ShaderInstance _selectionShaderInRangeInstance; diff --git a/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs b/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs index 174b21e5b6..ef909d9009 100644 --- a/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs @@ -20,10 +20,9 @@ namespace Content.Client.GameObjects.Components.Kitchen { public class MicrowaveBoundUserInterface : BoundUserInterface { -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + private MicrowaveMenu _menu; private Dictionary _solids = new Dictionary(); diff --git a/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs b/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs index c294fa68cd..8aae18facf 100644 --- a/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs @@ -24,6 +24,10 @@ namespace Content.Client.GameObjects.Components.Mobs [ComponentReference(typeof(SharedOverlayEffectsComponent))] public sealed class ClientOverlayEffectsComponent : SharedOverlayEffectsComponent//, ICharacterUI { + [Dependency] private readonly IOverlayManager _overlayManager = default!; + [Dependency] private readonly IReflectionManager _reflectionManager = default!; + [Dependency] private readonly IClientNetManager _netManager = default!; + /// /// A list of overlay containers representing the current overlays applied /// @@ -36,13 +40,6 @@ namespace Content.Client.GameObjects.Components.Mobs set => SetEffects(value); } -#pragma warning disable 649 - // Required dependencies - [Dependency] private readonly IOverlayManager _overlayManager; - [Dependency] private readonly IReflectionManager _reflectionManager; - [Dependency] private readonly IClientNetManager _netManager; -#pragma warning restore 649 - public override void Initialize() { base.Initialize(); diff --git a/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs b/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs index 8c9344d5fd..fc2984f3ae 100644 --- a/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs @@ -23,12 +23,10 @@ namespace Content.Client.GameObjects.Components.Mobs [ComponentReference(typeof(SharedStatusEffectsComponent))] public sealed class ClientStatusEffectsComponent : SharedStatusEffectsComponent { -#pragma warning disable 649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; - [Dependency] private readonly IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; private StatusEffectsUI _ui; private Dictionary _status = new Dictionary(); diff --git a/Content.Client/GameObjects/Components/Mobs/CombatModeComponent.cs b/Content.Client/GameObjects/Components/Mobs/CombatModeComponent.cs index bcedfa8487..1612c10960 100644 --- a/Content.Client/GameObjects/Components/Mobs/CombatModeComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/CombatModeComponent.cs @@ -12,10 +12,8 @@ namespace Content.Client.GameObjects.Components.Mobs [ComponentReference(typeof(SharedCombatModeComponent))] public sealed class CombatModeComponent : SharedCombatModeComponent { -#pragma warning disable 649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IGameHud _gameHud; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IGameHud _gameHud = default!; public override bool IsInCombatMode { diff --git a/Content.Client/GameObjects/Components/Observer/GhostComponent.cs b/Content.Client/GameObjects/Components/Observer/GhostComponent.cs index e0f2407a89..077eae387c 100644 --- a/Content.Client/GameObjects/Components/Observer/GhostComponent.cs +++ b/Content.Client/GameObjects/Components/Observer/GhostComponent.cs @@ -12,6 +12,10 @@ namespace Content.Client.GameObjects.Components.Observer [RegisterComponent] public class GhostComponent : SharedGhostComponent { + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IComponentManager _componentManager = default!; + private GhostGui _gui; [ViewVariables(VVAccess.ReadOnly)] @@ -19,12 +23,6 @@ namespace Content.Client.GameObjects.Components.Observer private bool _isAttached; -#pragma warning disable 649 - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private IComponentManager _componentManager; -#pragma warning restore 649 - public override void OnRemove() { base.OnRemove(); diff --git a/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs b/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs index 1c724bceee..e581f8a021 100644 --- a/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs @@ -19,10 +19,9 @@ namespace Content.Client.GameObjects.Components.PDA { public class PDABoundUserInterface : BoundUserInterface { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + private PDAMenu _menu; private PDAMenuPopup failPopup; diff --git a/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs b/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs index 9e318f04a6..923b798e39 100644 --- a/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs @@ -12,10 +12,8 @@ namespace Content.Client.GameObjects.Components.Research { public class LatheBoundUserInterface : BoundUserInterface { -#pragma warning disable CS0649 - [Dependency] - private IPrototypeManager _prototypeManager; -#pragma warning restore + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [ViewVariables] private LatheMenu _menu; [ViewVariables] diff --git a/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs b/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs index 962948e7e8..67163e0e18 100644 --- a/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs +++ b/Content.Client/GameObjects/Components/Research/LatheDatabaseComponent.cs @@ -10,10 +10,7 @@ namespace Content.Client.GameObjects.Components.Research [ComponentReference(typeof(SharedLatheDatabaseComponent))] public class LatheDatabaseComponent : SharedLatheDatabaseComponent { -#pragma warning disable CS0649 - [Dependency] - private IPrototypeManager _prototypeManager; -#pragma warning restore + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override void HandleComponentState(ComponentState curState, ComponentState nextState) { diff --git a/Content.Client/GameObjects/Components/Research/ProtolatheDatabaseComponent.cs b/Content.Client/GameObjects/Components/Research/ProtolatheDatabaseComponent.cs index 71aeb4411f..c10c2bdc65 100644 --- a/Content.Client/GameObjects/Components/Research/ProtolatheDatabaseComponent.cs +++ b/Content.Client/GameObjects/Components/Research/ProtolatheDatabaseComponent.cs @@ -11,10 +11,7 @@ namespace Content.Client.GameObjects.Components.Research [ComponentReference(typeof(SharedLatheDatabaseComponent))] public class ProtolatheDatabaseComponent : SharedProtolatheDatabaseComponent { -#pragma warning disable CS0649 - [Dependency] - private IPrototypeManager _prototypeManager; -#pragma warning restore + [Dependency] private IPrototypeManager _prototypeManager = default!; /// /// Invoked when the database gets updated. diff --git a/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs b/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs index f521c0c3a7..c9caf04338 100644 --- a/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs +++ b/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs @@ -16,11 +16,10 @@ namespace Content.Client.GameObjects.Components.Sound [RegisterComponent] public class LoopingSoundComponent : SharedLoopingSoundComponent { + [Dependency] private readonly IRobustRandom _random = default!; + private readonly Dictionary _audioStreams = new Dictionary(); private AudioSystem _audioSystem; - #pragma warning disable 649 - [Dependency] private readonly IRobustRandom _random; - #pragma warning restore 649 public override void StopAllSounds() { diff --git a/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs b/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs index e40ae0740f..688e3116aa 100644 --- a/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs @@ -15,9 +15,7 @@ namespace Content.Client.GameObjects.EntitySystems.AI #if DEBUG public class ClientAiDebugSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private IEyeManager _eyeManager; -#pragma warning restore 649 + [Dependency] private readonly IEyeManager _eyeManager = default!; private AiDebugMode _tooltips = AiDebugMode.None; private readonly Dictionary _aiBoxes = new Dictionary(); diff --git a/Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs b/Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs index a46f038e67..bdafc4d1a5 100644 --- a/Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs @@ -11,10 +11,8 @@ namespace Content.Client.GameObjects.EntitySystems { public sealed class CharacterInterfaceSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly IPlayerManager _playerManager; -#pragma warning restore 649 + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; public override void Initialize() { diff --git a/Content.Client/GameObjects/EntitySystems/ClientInventorySystem.cs b/Content.Client/GameObjects/EntitySystems/ClientInventorySystem.cs index 80cd1fbb0f..b6ac6bbe2f 100644 --- a/Content.Client/GameObjects/EntitySystems/ClientInventorySystem.cs +++ b/Content.Client/GameObjects/EntitySystems/ClientInventorySystem.cs @@ -11,10 +11,8 @@ namespace Content.Client.GameObjects.EntitySystems { public sealed class ClientInventorySystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly IPlayerManager _playerManager; -#pragma warning restore 649 + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; public override void Initialize() { diff --git a/Content.Client/GameObjects/EntitySystems/CombatModeSystem.cs b/Content.Client/GameObjects/EntitySystems/CombatModeSystem.cs index 9daa25095b..c68f1d8134 100644 --- a/Content.Client/GameObjects/EntitySystems/CombatModeSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/CombatModeSystem.cs @@ -17,11 +17,9 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] public sealed class CombatModeSystem : SharedCombatModeSystem { -#pragma warning disable 649 - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; public override void Initialize() { diff --git a/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs b/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs index 09a4beea42..f079208d85 100644 --- a/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs @@ -24,11 +24,9 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] public class ConstructionSystem : SharedConstructionSystem { -#pragma warning disable 649 - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; private int _nextId; private readonly Dictionary _ghosts = new Dictionary(); diff --git a/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs b/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs index 66a5f1592c..6458c6edbc 100644 --- a/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs @@ -30,6 +30,13 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] public class DragDropSystem : EntitySystem { + [Dependency] private readonly IStateManager _stateManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; + // drag will be triggered when mouse leaves this deadzone around the click position. private const float DragDeadzone = 2f; // how often to recheck possible targets (prevents calling expensive @@ -44,15 +51,6 @@ namespace Content.Client.GameObjects.EntitySystems private const string ShaderDropTargetInRange = "SelectionOutlineInrange"; private const string ShaderDropTargetOutOfRange = "SelectionOutline"; -#pragma warning disable 649 - [Dependency] private readonly IStateManager _stateManager; - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IInputManager _inputManager; - [Dependency] private readonly IEyeManager _eyeManager; - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 - // entity performing the drag action private IEntity _dragger; private IEntity _draggedEntity; diff --git a/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs b/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs index 86f0f9e52d..a9e4fb4187 100644 --- a/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs @@ -25,14 +25,12 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] internal sealed class ExamineSystem : ExamineSystemShared { - public const string StyleClassEntityTooltip = "entity-tooltip"; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; -#pragma warning disable 649 - [Dependency] private IInputManager _inputManager; - [Dependency] private IUserInterfaceManager _userInterfaceManager; - [Dependency] private IEntityManager _entityManager; - [Dependency] private IPlayerManager _playerManager; -#pragma warning restore 649 + public const string StyleClassEntityTooltip = "entity-tooltip"; private Popup _examineTooltipOpen; private CancellationTokenSource _requestCancelTokenSource; diff --git a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs index 901178e9ec..330abf38d8 100644 --- a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs @@ -19,9 +19,7 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] internal sealed class IconSmoothSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly IMapManager _mapManager = default!; private readonly Queue _dirtyEntities = new Queue(); diff --git a/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs b/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs index ca7a9d79e4..1a4b1212ee 100644 --- a/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs @@ -17,9 +17,7 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] public sealed class MeleeWeaponSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override void Initialize() { diff --git a/Content.Client/GameObjects/EntitySystems/RangedWeaponSystem.cs b/Content.Client/GameObjects/EntitySystems/RangedWeaponSystem.cs index 027f6c6014..2fb57315eb 100644 --- a/Content.Client/GameObjects/EntitySystems/RangedWeaponSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/RangedWeaponSystem.cs @@ -17,14 +17,11 @@ namespace Content.Client.GameObjects.EntitySystems { public class RangedWeaponSystem : EntitySystem { - -#pragma warning disable 649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IEyeManager _eyeManager; - [Dependency] private readonly IMapManager _mapManager; - [Dependency] private readonly IInputManager _inputManager; - [Dependency] private readonly IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; private InputSystem _inputSystem; private CombatModeSystem _combatModeSystem; diff --git a/Content.Client/GameObjects/EntitySystems/StatusEffectsSystem.cs b/Content.Client/GameObjects/EntitySystems/StatusEffectsSystem.cs index 367c49f0b9..f7a2388368 100644 --- a/Content.Client/GameObjects/EntitySystems/StatusEffectsSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/StatusEffectsSystem.cs @@ -7,9 +7,7 @@ namespace Content.Client.GameObjects.EntitySystems { public class StatusEffectsSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IGameTiming _gameTiming = default!; public override void FrameUpdate(float frameTime) { diff --git a/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs b/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs index 1cc538fd68..95e0cfe963 100644 --- a/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs @@ -15,12 +15,10 @@ namespace Content.Client.GameObjects.EntitySystems /// internal sealed class SubFloorHideSystem : EntitySystem { - private bool _enableAll; + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; -#pragma warning disable 649 - [Dependency] private readonly IMapManager _mapManager; - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; -#pragma warning restore 649 + private bool _enableAll; [ViewVariables(VVAccess.ReadWrite)] public bool EnableAll diff --git a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs index 486d491d1c..fb9c2c441d 100644 --- a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs @@ -42,16 +42,14 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] public sealed class VerbSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IStateManager _stateManager; - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IInputManager _inputManager; - [Dependency] private readonly IItemSlotManager _itemSlotManager; - [Dependency] private readonly IGameTiming _gameTiming; - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly IStateManager _stateManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IItemSlotManager _itemSlotManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; private EntityList _currentEntityList; private VerbPopup _currentVerbListRoot; diff --git a/Content.Client/GameTicking/ClientGameTicker.cs b/Content.Client/GameTicking/ClientGameTicker.cs index 3eeda60421..be3e791a2a 100644 --- a/Content.Client/GameTicking/ClientGameTicker.cs +++ b/Content.Client/GameTicking/ClientGameTicker.cs @@ -17,10 +17,8 @@ namespace Content.Client.GameTicking { public class ClientGameTicker : SharedGameTicker, IClientGameTicker { -#pragma warning disable 649 - [Dependency] private IClientNetManager _netManager; - [Dependency] private IStateManager _stateManager; -#pragma warning restore 649 + [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private readonly IStateManager _stateManager = default!; [ViewVariables] private bool _initialized; diff --git a/Content.Client/Graphics/Overlays/CircleMaskOverlay.cs b/Content.Client/Graphics/Overlays/CircleMaskOverlay.cs index f16cbf52e4..9e300ce897 100644 --- a/Content.Client/Graphics/Overlays/CircleMaskOverlay.cs +++ b/Content.Client/Graphics/Overlays/CircleMaskOverlay.cs @@ -11,10 +11,8 @@ namespace Content.Client.Graphics.Overlays { public class CircleMaskOverlay : Overlay { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IEyeManager _eyeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; public override OverlaySpace Space => OverlaySpace.WorldSpace; private readonly ShaderInstance _shader; diff --git a/Content.Client/Graphics/Overlays/FlashOverlay.cs b/Content.Client/Graphics/Overlays/FlashOverlay.cs index cf56eb796e..d8c37ad376 100644 --- a/Content.Client/Graphics/Overlays/FlashOverlay.cs +++ b/Content.Client/Graphics/Overlays/FlashOverlay.cs @@ -16,11 +16,9 @@ namespace Content.Client.Graphics.Overlays { public class FlashOverlay : Overlay, IConfigurable { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IClyde _displayManager; - [Dependency] private readonly IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IClyde _displayManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; public override OverlaySpace Space => OverlaySpace.ScreenSpace; private readonly ShaderInstance _shader; diff --git a/Content.Client/Graphics/Overlays/GradientCircleMask.cs b/Content.Client/Graphics/Overlays/GradientCircleMask.cs index 28dce7b66b..5dec976b53 100644 --- a/Content.Client/Graphics/Overlays/GradientCircleMask.cs +++ b/Content.Client/Graphics/Overlays/GradientCircleMask.cs @@ -11,10 +11,9 @@ namespace Content.Client.Graphics.Overlays { public class GradientCircleMaskOverlay : Overlay { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IEyeManager _eyeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + public override OverlaySpace Space => OverlaySpace.WorldSpace; private readonly ShaderInstance _shader; diff --git a/Content.Client/Instruments/InstrumentMenu.cs b/Content.Client/Instruments/InstrumentMenu.cs index 3acacb3f34..166ecfaf04 100644 --- a/Content.Client/Instruments/InstrumentMenu.cs +++ b/Content.Client/Instruments/InstrumentMenu.cs @@ -20,10 +20,8 @@ namespace Content.Client.Instruments { public class InstrumentMenu : SS14Window { -#pragma warning disable 649 - [Dependency] private IMidiManager _midiManager; - [Dependency] private IFileDialogManager _fileDialogManager; -#pragma warning restore 649 + [Dependency] private readonly IMidiManager _midiManager = default!; + [Dependency] private readonly IFileDialogManager _fileDialogManager = default!; private InstrumentBoundUserInterface _owner; private Button midiLoopButton; diff --git a/Content.Client/Parallax/ParallaxManager.cs b/Content.Client/Parallax/ParallaxManager.cs index d289ef16cc..441dbcaf08 100644 --- a/Content.Client/Parallax/ParallaxManager.cs +++ b/Content.Client/Parallax/ParallaxManager.cs @@ -19,11 +19,9 @@ namespace Content.Client.Parallax { internal sealed class ParallaxManager : IParallaxManager, IPostInjectInit { -#pragma warning disable 649 - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly ILogManager _logManager; - [Dependency] private readonly IConfigurationManager _configurationManager; -#pragma warning restore 649 + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; private static readonly ResourcePath ParallaxConfigPath = new ResourcePath("/parallax_config.toml"); diff --git a/Content.Client/Parallax/ParallaxOverlay.cs b/Content.Client/Parallax/ParallaxOverlay.cs index a5dd984b72..c4bc5e8ebf 100644 --- a/Content.Client/Parallax/ParallaxOverlay.cs +++ b/Content.Client/Parallax/ParallaxOverlay.cs @@ -13,12 +13,10 @@ namespace Content.Client.Parallax { public class ParallaxOverlay : Overlay { -#pragma warning disable 649 - [Dependency] private readonly IParallaxManager _parallaxManager; - [Dependency] private readonly IEyeManager _eyeManager; - [Dependency] private readonly IClyde _displayManager; - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IParallaxManager _parallaxManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private readonly IClyde _displayManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override bool AlwaysDirty => true; private const float Slowness = 0.5f; diff --git a/Content.Client/Research/LatheMenu.cs b/Content.Client/Research/LatheMenu.cs index 002f8dd031..c275be681b 100644 --- a/Content.Client/Research/LatheMenu.cs +++ b/Content.Client/Research/LatheMenu.cs @@ -14,9 +14,7 @@ namespace Content.Client.Research { public class LatheMenu : SS14Window { -#pragma warning disable CS0649 - [Dependency] private IPrototypeManager PrototypeManager; -#pragma warning restore + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; private ItemList Items; private ItemList Materials; @@ -174,7 +172,7 @@ namespace Content.Client.Research foreach (var (id, amount) in Owner.Storage) { - if (!PrototypeManager.TryIndex(id, out MaterialPrototype materialPrototype)) continue; + if (!_prototypeManager.TryIndex(id, out MaterialPrototype materialPrototype)) continue; var material = materialPrototype.Material; Materials.AddItem($"{material.Name} {amount} cm³", material.Icon.Frame0(), false); } diff --git a/Content.Client/Research/ResearchConsoleMenu.cs b/Content.Client/Research/ResearchConsoleMenu.cs index 5ece8da8f7..ad86933ede 100644 --- a/Content.Client/Research/ResearchConsoleMenu.cs +++ b/Content.Client/Research/ResearchConsoleMenu.cs @@ -32,9 +32,7 @@ namespace Content.Client.Research private ItemList _unlockableTechnologies; private ItemList _futureTechnologies; -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _localizationManager; -#pragma warning restore 649 + [Dependency] private readonly ILocalizationManager _localizationManager = default!; public Button UnlockButton { get; private set; } public Button ServerSelectionButton { get; private set; } diff --git a/Content.Client/Sandbox/SandboxManager.cs b/Content.Client/Sandbox/SandboxManager.cs index fddcf313cf..4696c6005e 100644 --- a/Content.Client/Sandbox/SandboxManager.cs +++ b/Content.Client/Sandbox/SandboxManager.cs @@ -74,19 +74,18 @@ namespace Content.Client.Sandbox vBox.AddChild(ShowBbButton); } } + internal class SandboxManager : SharedSandboxManager, ISandboxManager { -#pragma warning disable 649 - [Dependency] private readonly IClientConsole _console; - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly IClientNetManager _netManager; - [Dependency] private readonly ILocalizationManager _localization; - [Dependency] private readonly IPlacementManager _placementManager; - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; - [Dependency] private readonly IInputManager _inputManager; -#pragma warning restore 649 + [Dependency] private readonly IClientConsole _console = default!; + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private readonly ILocalizationManager _localization = default!; + [Dependency] private readonly IPlacementManager _placementManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private readonly IInputManager _inputManager = default!; public bool SandboxAllowed { get; private set; } diff --git a/Content.Client/State/GameScreen.cs b/Content.Client/State/GameScreen.cs index 98425026b5..7a00879c55 100644 --- a/Content.Client/State/GameScreen.cs +++ b/Content.Client/State/GameScreen.cs @@ -14,12 +14,10 @@ namespace Content.Client.State { public class GameScreen : GameScreenBase { -#pragma warning disable 649 - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; - [Dependency] private readonly IGameHud _gameHud; - [Dependency] private readonly IInputManager _inputManager; - [Dependency] private readonly IChatManager _chatManager; -#pragma warning restore 649 + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IGameHud _gameHud = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IChatManager _chatManager = default!; [ViewVariables] private ChatBox _gameChat; diff --git a/Content.Client/State/GameScreenBase.cs b/Content.Client/State/GameScreenBase.cs index 64e62d2b16..8b88d26ebc 100644 --- a/Content.Client/State/GameScreenBase.cs +++ b/Content.Client/State/GameScreenBase.cs @@ -28,17 +28,15 @@ namespace Content.Client.State // Instantiated dynamically through the StateManager, Dependencies will be resolved. public partial class GameScreenBase : Robust.Client.State.State { -#pragma warning disable 649 - [Dependency] protected readonly IClientEntityManager EntityManager; - [Dependency] protected readonly IInputManager InputManager; - [Dependency] protected readonly IPlayerManager PlayerManager; - [Dependency] protected readonly IEyeManager EyeManager; - [Dependency] protected readonly IEntitySystemManager EntitySystemManager; - [Dependency] protected readonly IGameTiming Timing; - [Dependency] protected readonly IMapManager MapManager; - [Dependency] protected readonly IUserInterfaceManager UserInterfaceManager; - [Dependency] protected readonly IConfigurationManager ConfigurationManager; -#pragma warning restore 649 + [Dependency] protected readonly IClientEntityManager EntityManager = default!; + [Dependency] protected readonly IInputManager InputManager = default!; + [Dependency] protected readonly IPlayerManager PlayerManager = default!; + [Dependency] protected readonly IEyeManager EyeManager = default!; + [Dependency] protected readonly IEntitySystemManager EntitySystemManager = default!; + [Dependency] protected readonly IGameTiming Timing = default!; + [Dependency] protected readonly IMapManager MapManager = default!; + [Dependency] protected readonly IUserInterfaceManager UserInterfaceManager = default!; + [Dependency] protected readonly IConfigurationManager ConfigurationManager = default!; private IEntity _lastHoveredEntity; diff --git a/Content.Client/State/LauncherConnecting.cs b/Content.Client/State/LauncherConnecting.cs index adfcc5a505..ff1a39ab7a 100644 --- a/Content.Client/State/LauncherConnecting.cs +++ b/Content.Client/State/LauncherConnecting.cs @@ -16,13 +16,11 @@ namespace Content.Client.State { public class LauncherConnecting : Robust.Client.State.State { -#pragma warning disable 649 - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; - [Dependency] private readonly IStylesheetManager _stylesheetManager; - [Dependency] private readonly IClientNetManager _clientNetManager; - [Dependency] private readonly IGameController _gameController; - [Dependency] private readonly IBaseClient _baseClient; -#pragma warning restore 649 + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IStylesheetManager _stylesheetManager = default!; + [Dependency] private readonly IClientNetManager _clientNetManager = default!; + [Dependency] private readonly IGameController _gameController = default!; + [Dependency] private readonly IBaseClient _baseClient = default!; private Control _control; private Label _connectStatus; diff --git a/Content.Client/State/LobbyState.cs b/Content.Client/State/LobbyState.cs index 6f04765caa..3059eb9529 100644 --- a/Content.Client/State/LobbyState.cs +++ b/Content.Client/State/LobbyState.cs @@ -24,19 +24,17 @@ namespace Content.Client.State { public class LobbyState : Robust.Client.State.State { -#pragma warning disable 649 - [Dependency] private readonly IBaseClient _baseClient; - [Dependency] private readonly IClientConsole _console; - [Dependency] private readonly IChatManager _chatManager; - [Dependency] private readonly IInputManager _inputManager; - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly IClientGameTicker _clientGameTicker; - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; - [Dependency] private readonly IClientPreferencesManager _preferencesManager; -#pragma warning restore 649 + [Dependency] private readonly IBaseClient _baseClient = default!; + [Dependency] private readonly IClientConsole _console = default!; + [Dependency] private readonly IChatManager _chatManager = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IClientGameTicker _clientGameTicker = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IClientPreferencesManager _preferencesManager = default!; [ViewVariables] private CharacterSetupGui _characterSetup; [ViewVariables] private LobbyGui _lobby; @@ -215,7 +213,7 @@ namespace Content.Client.State foreach (var session in _playerManager.Sessions.OrderBy(s => s.Name)) { - + var readyState = ""; // Don't show ready state if we're ingame diff --git a/Content.Client/State/MainMenu.cs b/Content.Client/State/MainMenu.cs index d8e12e1b66..06c7e46a3a 100644 --- a/Content.Client/State/MainMenu.cs +++ b/Content.Client/State/MainMenu.cs @@ -27,15 +27,13 @@ namespace Content.Client.State { private const string PublicServerAddress = "server.spacestation14.io"; -#pragma warning disable 649 - [Dependency] private readonly IBaseClient _client; - [Dependency] private readonly IClientNetManager _netManager; - [Dependency] private readonly IConfigurationManager _configurationManager; - [Dependency] private readonly IGameController _controllerProxy; - [Dependency] private readonly ILocalizationManager _loc; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly IUserInterfaceManager userInterfaceManager; -#pragma warning restore 649 + [Dependency] private readonly IBaseClient _client = default!; + [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private readonly IGameController _controllerProxy = default!; + [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; private MainMenuControl _mainMenuControl; private OptionsMenu OptionsMenu; @@ -48,7 +46,7 @@ namespace Content.Client.State public override void Startup() { _mainMenuControl = new MainMenuControl(_resourceCache, _configurationManager); - userInterfaceManager.StateRoot.AddChild(_mainMenuControl); + _userInterfaceManager.StateRoot.AddChild(_mainMenuControl); _mainMenuControl.QuitButton.OnPressed += QuitButtonPressed; _mainMenuControl.OptionsButton.OnPressed += OptionsButtonPressed; @@ -108,7 +106,7 @@ namespace Content.Client.State if (!UsernameHelpers.IsNameValid(inputName, out var reason)) { var invalidReason = _loc.GetString(reason.ToText()); - userInterfaceManager.Popup( + _userInterfaceManager.Popup( _loc.GetString("Invalid username:\n{0}", invalidReason), _loc.GetString("Invalid Username")); return; @@ -130,7 +128,7 @@ namespace Content.Client.State } catch (ArgumentException e) { - userInterfaceManager.Popup($"Unable to connect: {e.Message}", "Connection error."); + _userInterfaceManager.Popup($"Unable to connect: {e.Message}", "Connection error."); Logger.Warning(e.ToString()); _netManager.ConnectFailed -= _onConnectFailed; } @@ -185,7 +183,7 @@ namespace Content.Client.State private void _onConnectFailed(object _, NetConnectFailArgs args) { - userInterfaceManager.Popup($"Failed to connect:\n{args.Reason}"); + _userInterfaceManager.Popup($"Failed to connect:\n{args.Reason}"); _netManager.ConnectFailed -= _onConnectFailed; _setConnectingState(false); } diff --git a/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs b/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs index f5f05f50c0..2298e3807c 100644 --- a/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs +++ b/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs @@ -15,9 +15,7 @@ namespace Content.Client.UserInterface.Cargo { public class CargoConsoleMenu : SS14Window { -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _loc; -#pragma warning restore 649 + [Dependency] private readonly ILocalizationManager _loc = default!; protected override Vector2? CustomSize => (400, 600); @@ -287,7 +285,7 @@ namespace Content.Client.UserInterface.Cargo public void PopulateOrders() { _orders.RemoveAllChildren(); - _requests.RemoveAllChildren(); + _requests.RemoveAllChildren(); foreach (var order in Owner.Orders.Orders) { var row = new CargoOrderRow(); diff --git a/Content.Client/UserInterface/Cargo/CargoConsoleOrderMenu.cs b/Content.Client/UserInterface/Cargo/CargoConsoleOrderMenu.cs index 5c2b4460f0..c093dccca4 100644 --- a/Content.Client/UserInterface/Cargo/CargoConsoleOrderMenu.cs +++ b/Content.Client/UserInterface/Cargo/CargoConsoleOrderMenu.cs @@ -8,9 +8,7 @@ namespace Content.Client.UserInterface.Cargo { class CargoConsoleOrderMenu : SS14Window { -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _loc; -#pragma warning restore 649 + [Dependency] private readonly ILocalizationManager _loc = default!; public LineEdit Requester { get; set; } public LineEdit Reason { get; set; } diff --git a/Content.Client/UserInterface/Cargo/GalacticBankSelectionMenu.cs b/Content.Client/UserInterface/Cargo/GalacticBankSelectionMenu.cs index 25c90ee7f8..b096a2f888 100644 --- a/Content.Client/UserInterface/Cargo/GalacticBankSelectionMenu.cs +++ b/Content.Client/UserInterface/Cargo/GalacticBankSelectionMenu.cs @@ -10,16 +10,14 @@ namespace Content.Client.UserInterface.Cargo { public class GalacticBankSelectionMenu : SS14Window { + [Dependency] private readonly ILocalizationManager _loc = default!; + private ItemList _accounts; private int _accountCount = 0; private string[] _accountNames = new string[] { }; private int[] _accountIds = new int[] { }; private int _selectedAccountId = -1; -#pragma warning disable 649 - [Dependency] private readonly ILocalizationManager _loc; -#pragma warning restore 649 - protected override Vector2? CustomSize => (300, 300); public CargoConsoleBoundUserInterface Owner; diff --git a/Content.Client/UserInterface/GameHud.cs b/Content.Client/UserInterface/GameHud.cs index fa2c6cf000..ced6e8a15b 100644 --- a/Content.Client/UserInterface/GameHud.cs +++ b/Content.Client/UserInterface/GameHud.cs @@ -74,11 +74,9 @@ namespace Content.Client.UserInterface private Button _combatModeButton; private VBoxContainer _combatPanelContainer; -#pragma warning disable 649 - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly ILocalizationManager _loc; - [Dependency] private readonly IInputManager _inputManager; -#pragma warning restore 649 + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private readonly IInputManager _inputManager = default!; public Control HandsContainer { get; private set; } public Control InventoryQuickButtonContainer { get; private set; } diff --git a/Content.Client/UserInterface/HandsGui.cs b/Content.Client/UserInterface/HandsGui.cs index 28301e9e9d..3297fb467b 100644 --- a/Content.Client/UserInterface/HandsGui.cs +++ b/Content.Client/UserInterface/HandsGui.cs @@ -17,11 +17,9 @@ namespace Content.Client.UserInterface { public class HandsGui : Control { -#pragma warning disable 0649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IResourceCache _resourceCache; - [Dependency] private readonly IItemSlotManager _itemSlotManager; -#pragma warning restore 0649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IItemSlotManager _itemSlotManager = default!; private readonly TextureRect _activeHandRect; diff --git a/Content.Client/UserInterface/ItemSlotManager.cs b/Content.Client/UserInterface/ItemSlotManager.cs index 2ac6588f73..e3fcbb3e56 100644 --- a/Content.Client/UserInterface/ItemSlotManager.cs +++ b/Content.Client/UserInterface/ItemSlotManager.cs @@ -21,15 +21,13 @@ namespace Content.Client.UserInterface { public class ItemSlotManager : IItemSlotManager { -#pragma warning disable 0649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IGameTiming _gameTiming; - [Dependency] private readonly IInputManager _inputManager; - [Dependency] private readonly IEntitySystemManager _entitySystemManager; - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IEyeManager _eyeManager; - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 0649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; public bool SetItemSlot(ItemSlotButton button, IEntity entity) { diff --git a/Content.Client/UserInterface/LateJoinGui.cs b/Content.Client/UserInterface/LateJoinGui.cs index 30f662ae80..dfeb49eb81 100644 --- a/Content.Client/UserInterface/LateJoinGui.cs +++ b/Content.Client/UserInterface/LateJoinGui.cs @@ -16,10 +16,8 @@ namespace Content.Client.UserInterface { public sealed class LateJoinGui : SS14Window { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IClientConsole _console; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IClientConsole _console = default!; protected override Vector2? CustomSize => (360, 560); diff --git a/Content.Client/UserInterface/Stylesheets/StylesheetManager.cs b/Content.Client/UserInterface/Stylesheets/StylesheetManager.cs index 49147d841e..c9b8a07047 100644 --- a/Content.Client/UserInterface/Stylesheets/StylesheetManager.cs +++ b/Content.Client/UserInterface/Stylesheets/StylesheetManager.cs @@ -7,10 +7,8 @@ namespace Content.Client.UserInterface.Stylesheets { public sealed class StylesheetManager : IStylesheetManager { -#pragma warning disable 649 - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager; - [Dependency] private readonly IResourceCache _resourceCache; -#pragma warning restore 649 + [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private readonly IResourceCache _resourceCache = default!; public Stylesheet SheetNano { get; private set; } public Stylesheet SheetSpace { get; private set; } diff --git a/Content.Client/VendingMachines/VendingMachineMenu.cs b/Content.Client/VendingMachines/VendingMachineMenu.cs index 4d279144d1..64052c39be 100644 --- a/Content.Client/VendingMachines/VendingMachineMenu.cs +++ b/Content.Client/VendingMachines/VendingMachineMenu.cs @@ -15,17 +15,14 @@ namespace Content.Client.VendingMachines { class VendingMachineMenu : SS14Window { + [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + protected override Vector2? CustomSize => (300, 450); private readonly ItemList _items; private List _cachedInventory; - #pragma warning disable CS0649 - [Dependency] - private IResourceCache _resourceCache; - [Dependency] - private readonly IPrototypeManager _prototypeManager; - #pragma warning restore public VendingMachineBoundUserInterface Owner { get; set; } public VendingMachineMenu() diff --git a/Content.Server/Chat/ChatManager.cs b/Content.Server/Chat/ChatManager.cs index a6e0296b04..b2e13053d8 100644 --- a/Content.Server/Chat/ChatManager.cs +++ b/Content.Server/Chat/ChatManager.cs @@ -33,14 +33,12 @@ namespace Content.Server.Chat /// private const string MaxLengthExceededMessage = "Your message exceeded {0} character limit"; -#pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystemManager; - [Dependency] private readonly IServerNetManager _netManager; - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly ILocalizationManager _localizationManager; - [Dependency] private readonly IMoMMILink _mommiLink; - [Dependency] private readonly IConGroupController _conGroupController; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private readonly IServerNetManager _netManager = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly ILocalizationManager _localizationManager = default!; + [Dependency] private readonly IMoMMILink _mommiLink = default!; + [Dependency] private readonly IConGroupController _conGroupController = default!; public void Initialize() { diff --git a/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs b/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs index aad68a5e9b..3c65da2fd1 100644 --- a/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs +++ b/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs @@ -41,11 +41,9 @@ namespace Content.Server.GameObjects.Components.Body [ComponentReference(typeof(IBodyManagerComponent))] public class BodyManagerComponent : SharedBodyManagerComponent, IBodyPartContainer, IRelayMoveInput { -#pragma warning disable CS0649 [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IBodyNetworkFactory _bodyNetworkFactory = default!; [Dependency] private readonly IReflectionManager _reflectionManager = default!; -#pragma warning restore [ViewVariables] private string _presetName = default!; diff --git a/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs b/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs index 658fcec180..e0149dc1c0 100644 --- a/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs +++ b/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs @@ -147,7 +147,7 @@ namespace Content.Server.GameObjects.Components.Cargo break; } - _prototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product); + PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product); if (product == null!) break; var capacity = _cargoOrderDataManager.GetCapacity(orders.Database.Id); @@ -168,7 +168,7 @@ namespace Content.Server.GameObjects.Components.Cargo // TEMPORARY loop for spawning stuff on top of console foreach (var order in approvedOrders) { - if (!_prototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product)) + if (!PrototypeManager.TryIndex(order.ProductId, out CargoProductPrototype product)) continue; for (var i = 0; i < order.Amount; i++) { diff --git a/Content.Server/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs b/Content.Server/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs index db32f1a3d3..09fff675c2 100644 --- a/Content.Server/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs +++ b/Content.Server/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs @@ -8,9 +8,7 @@ namespace Content.Server.GameObjects.Components.Cargo [RegisterComponent] public class CargoOrderDatabaseComponent : SharedCargoOrderDatabaseComponent { -#pragma warning disable 649 - [Dependency] private readonly ICargoOrderDataManager _cargoOrderDataManager; -#pragma warning restore 649 + [Dependency] private readonly ICargoOrderDataManager _cargoOrderDataManager = default!; public CargoOrderDatabase Database { get; set; } public bool ConnectedToDatabase => Database != null; diff --git a/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs b/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs index 7ff05c4398..0704436578 100644 --- a/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs @@ -20,9 +20,8 @@ namespace Content.Server.GameObjects.Components.Chemistry [ComponentReference(typeof(IAfterInteract))] public class PillComponent : FoodComponent, IUse, IAfterInteract { -#pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystem; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystem = default!; + public override string Name => "Pill"; [ViewVariables] diff --git a/Content.Server/GameObjects/Components/Chemistry/PourableComponent.cs b/Content.Server/GameObjects/Components/Chemistry/PourableComponent.cs index 4f6350f0ab..1a507f2bcb 100644 --- a/Content.Server/GameObjects/Components/Chemistry/PourableComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/PourableComponent.cs @@ -19,9 +19,7 @@ namespace Content.Server.GameObjects.Components.Chemistry [RegisterComponent] class PourableComponent : Component, IInteractUsing { -#pragma warning disable 649 - [Dependency] private readonly IServerNotifyManager _notifyManager; -#pragma warning restore 649 + [Dependency] private readonly IServerNotifyManager _notifyManager = default!; public override string Name => "Pourable"; diff --git a/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs b/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs index 248d18143a..241d103dc9 100644 --- a/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs @@ -29,10 +29,8 @@ namespace Content.Server.GameObjects.Components.Chemistry [RegisterComponent] public class SolutionComponent : SharedSolutionComponent, IExamine { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IEntitySystemManager _entitySystemManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; private IEnumerable _reactions; private AudioSystem _audioSystem; diff --git a/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs b/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs index 5ea60a7fab..d1425cce58 100644 --- a/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs @@ -21,10 +21,8 @@ namespace Content.Server.GameObjects.Components.Damage [ComponentReference(typeof(IDamageableComponent))] public class BreakableComponent : RuinableComponent, IExAct { -#pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystemManager; - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private readonly IRobustRandom _random = default!; public override string Name => "Breakable"; diff --git a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs index 1d62b1670e..7ba91324a5 100644 --- a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs @@ -16,9 +16,7 @@ namespace Content.Server.GameObjects.Components.Damage [ComponentReference(typeof(IDamageableComponent))] public class DestructibleComponent : RuinableComponent, IDestroyAct { -#pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystemManager; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; protected ActSystem ActSystem; diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalJunctionComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalJunctionComponent.cs index f4ad5530fa..0fa5940c45 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalJunctionComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalJunctionComponent.cs @@ -14,9 +14,7 @@ namespace Content.Server.GameObjects.Components.Disposal [ComponentReference(typeof(IDisposalTubeComponent))] public class DisposalJunctionComponent : DisposalTubeComponent { -#pragma warning disable 649 - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 + [Dependency] private readonly IRobustRandom _random = default!; /// /// The angles to connect to. diff --git a/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs b/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs index a3703a5e21..7c454cc792 100644 --- a/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs +++ b/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs @@ -46,9 +46,7 @@ namespace Content.Server.GameObjects.Components.Fluids // based on behaviour (e.g. someone being punched vs slashed with a sword would have different blood sprite) // to check for low volumes for evaporation or whatever -#pragma warning disable 649 - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly IMapManager _mapManager = default!; public override string Name => "Puddle"; diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index a0b86f0625..bc58b80601 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -28,10 +28,8 @@ namespace Content.Server.GameObjects.Components.GUI [RegisterComponent] public class InventoryComponent : SharedInventoryComponent, IExAct, IEffectBlocker, IPressureProtection { -#pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystemManager; - [Dependency] private readonly IServerNotifyManager _serverNotifyManager; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!; [ViewVariables] private readonly Dictionary _slotContainers = new Dictionary(); diff --git a/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs b/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs index b2d6cbb98c..954c1ed639 100644 --- a/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs @@ -14,11 +14,9 @@ namespace Content.Server.GameObjects.Components.Interactable [RegisterComponent] public class TilePryingComponent : Component, IAfterInteract { -#pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystemManager; - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; public override string Name => "TilePrying"; private bool _toolComponentNeeded = true; diff --git a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs index 7de3236ec9..0690744f42 100644 --- a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs @@ -20,9 +20,7 @@ namespace Content.Server.GameObjects.Components.Items.Clothing [ComponentReference(typeof(IItemComponent))] public class ClothingComponent : ItemComponent, IUse { -#pragma warning disable 649 - [Dependency] private readonly IServerNotifyManager _serverNotifyManager; -#pragma warning restore 649 + [Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!; public override string Name => "Clothing"; public override uint? NetID => ContentNetIDs.CLOTHING; diff --git a/Content.Server/GameObjects/Components/Items/DiceComponent.cs b/Content.Server/GameObjects/Components/Items/DiceComponent.cs index ca12cfd0fd..3df295bc0a 100644 --- a/Content.Server/GameObjects/Components/Items/DiceComponent.cs +++ b/Content.Server/GameObjects/Components/Items/DiceComponent.cs @@ -20,10 +20,8 @@ namespace Content.Server.GameObjects.Components.Items [RegisterComponent] public class DiceComponent : Component, IActivate, IUse, ILand, IExamine { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IRobustRandom _random = default!; public override string Name => "Dice"; diff --git a/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs b/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs index 4bab06757b..8321016565 100644 --- a/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs @@ -15,10 +15,8 @@ namespace Content.Server.GameObjects.Components.Items [RegisterComponent] public class FloorTileItemComponent : Component, IAfterInteract { -#pragma warning disable 649 - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; public override string Name => "FloorTile"; private string _outputTile; diff --git a/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs b/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs index 16d2e5557e..3cb63d1aa2 100644 --- a/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs +++ b/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs @@ -15,10 +15,8 @@ namespace Content.Server.GameObjects.Components.Items.RCD [RegisterComponent] public class RCDAmmoComponent : Component, IAfterInteract, IExamine { + [Dependency] private IServerNotifyManager _serverNotifyManager = default!; -#pragma warning disable 649 - [Dependency] private IServerNotifyManager _serverNotifyManager; -#pragma warning restore 649 public override string Name => "RCDAmmo"; //How much ammo we refill diff --git a/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs b/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs index d479c31d02..40f2b36722 100644 --- a/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs +++ b/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs @@ -25,14 +25,12 @@ namespace Content.Server.GameObjects.Components.Items.RCD [RegisterComponent] public class RCDComponent : Component, IAfterInteract, IUse, IExamine { + [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IServerEntityManager _serverEntityManager = default!; + [Dependency] private readonly IServerNotifyManager _serverNotifyManager = default!; -#pragma warning disable 649 - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; - [Dependency] private readonly IEntitySystemManager _entitySystemManager; - [Dependency] private readonly IMapManager _mapManager; - [Dependency] private readonly IServerEntityManager _serverEntityManager; - [Dependency] private IServerNotifyManager _serverNotifyManager; -#pragma warning restore 649 public override string Name => "RCD"; private RcdMode _mode = 0; //What mode are we on? Can be floors, walls, deconstruct. private readonly RcdMode[] _modes = (RcdMode[]) Enum.GetValues(typeof(RcdMode)); diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs index 713154661c..94dabf7576 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs @@ -8,11 +8,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill [RegisterComponent] internal sealed class MedkitFillComponent : Component, IMapInit { - public override string Name => "MedkitFill"; + [Dependency] private readonly IEntityManager _entityManager = default!; -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + public override string Name => "MedkitFill"; void IMapInit.MapInit() { diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs index 2b11eb2503..66b13739e1 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs @@ -10,14 +10,12 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill [RegisterComponent] internal sealed class StorageFillComponent : Component, IMapInit { + [Dependency] private readonly IEntityManager _entityManager = default!; + public override string Name => "StorageFill"; private List _contents = new List(); -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 - public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs index ca3516f5fd..39e74b5556 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs @@ -10,11 +10,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill [RegisterComponent] internal sealed class ToolboxElectricalFillComponent : Component, IMapInit { - public override string Name => "ToolboxElectricalFill"; + [Dependency] private readonly IEntityManager _entityManager = default!; -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + public override string Name => "ToolboxElectricalFill"; void IMapInit.MapInit() { diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs index 31af8f5f8d..1dd6c7a882 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs @@ -10,11 +10,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill [RegisterComponent] internal sealed class ToolboxEmergencyFillComponent : Component, IMapInit { - public override string Name => "ToolboxEmergencyFill"; + [Dependency] private readonly IEntityManager _entityManager = default!; -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + public override string Name => "ToolboxEmergencyFill"; void IMapInit.MapInit() { diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs index 8f6dfdf5ee..11f2a5bfbd 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs @@ -10,11 +10,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill [RegisterComponent] internal sealed class ToolboxGoldFillComponent : Component, IMapInit { - public override string Name => "ToolboxGoldFill"; + [Dependency] private readonly IEntityManager _entityManager = default!; -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + public override string Name => "ToolboxGoldFill"; void IMapInit.MapInit() { diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs index 876d5c9a84..9fe010fe8c 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs @@ -8,11 +8,9 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill [RegisterComponent] internal sealed class UtilityBeltClothingFillComponent : Component, IMapInit { - public override string Name => "UtilityBeltClothingFill"; + [Dependency] private readonly IEntityManager _entityManager = default!; -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + public override string Name => "UtilityBeltClothingFill"; void IMapInit.MapInit() { diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index a82183da4f..93260ae1bb 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -24,13 +24,11 @@ namespace Content.Server.GameObjects.Components.Items.Storage [ComponentReference(typeof(IItemComponent))] public class ItemComponent : StorableComponent, IInteractHand, IExAct, IEquipped, IUnequipped, IItemComponent { + [Dependency] private readonly IMapManager _mapManager = default!; + public override string Name => "Item"; public override uint? NetID => ContentNetIDs.ITEM; - #pragma warning disable 649 - [Dependency] private readonly IMapManager _mapManager; - #pragma warning restore 649 - private string _equippedPrefix; public string EquippedPrefix diff --git a/Content.Server/GameObjects/Components/Items/ToysComponent.cs b/Content.Server/GameObjects/Components/Items/ToysComponent.cs index 73d1c06032..8c379e9b11 100644 --- a/Content.Server/GameObjects/Components/Items/ToysComponent.cs +++ b/Content.Server/GameObjects/Components/Items/ToysComponent.cs @@ -16,10 +16,8 @@ namespace Content.Server.GameObjects.Components.Items [RegisterComponent] public class ToysComponent : Component, IActivate, IUse, ILand { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IRobustRandom _random = default!; public override string Name => "Toys"; diff --git a/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs b/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs index 7521a25650..1e22218ae8 100644 --- a/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs @@ -18,14 +18,12 @@ namespace Content.Server.GameObjects.Components.Markers [RegisterComponent] public class ConditionalSpawnerComponent : Component, IMapInit { - public override string Name => "ConditionalSpawner"; + [Dependency] private readonly IGameTicker _gameTicker = default!; + [Dependency] private readonly IReflectionManager _reflectionManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IRobustRandom _robustRandom = default!; -#pragma warning disable 649 - [Dependency] private IGameTicker _gameTicker; - [Dependency] private IReflectionManager _reflectionManager; - [Dependency] private IEntityManager _entityManager; - [Dependency] private IRobustRandom _robustRandom; -#pragma warning restore 649 + public override string Name => "ConditionalSpawner"; [ViewVariables(VVAccess.ReadWrite)] public List Prototypes { get; set; } = new List(); diff --git a/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs b/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs index c1eed02761..a2d145ec49 100644 --- a/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/SpawnPointComponent.cs @@ -12,9 +12,7 @@ namespace Content.Server.GameObjects.Components.Markers [ComponentReference(typeof(SharedSpawnPointComponent))] public sealed class SpawnPointComponent : SharedSpawnPointComponent { -#pragma warning disable 649 - [Dependency] private IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [ViewVariables(VVAccess.ReadWrite)] private SpawnPointType _spawnType; diff --git a/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs b/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs index 96aa996204..a374a35816 100644 --- a/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs @@ -15,10 +15,8 @@ namespace Content.Server.GameObjects.Components.Markers [RegisterComponent] public class TimedSpawnerComponent : Component { -#pragma warning disable 649 - [Dependency] private IEntityManager _entityManager; - [Dependency] private IRobustRandom _robustRandom; -#pragma warning restore 649 + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IRobustRandom _robustRandom = default!; public override string Name => "TimedSpawner"; diff --git a/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs b/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs index 0476fb8b99..1a193b4974 100644 --- a/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs @@ -14,12 +14,10 @@ namespace Content.Server.GameObjects.Components.Markers [RegisterComponent] public class TrashSpawnerComponent : ConditionalSpawnerComponent { - public override string Name => "TrashSpawner"; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IRobustRandom _robustRandom = default!; -#pragma warning disable 649 - [Dependency] private IEntityManager _entityManager; - [Dependency] private IRobustRandom _robustRandom; -#pragma warning restore 649 + public override string Name => "TrashSpawner"; [ViewVariables(VVAccess.ReadWrite)] public List RarePrototypes { get; set; } = new List(); diff --git a/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs b/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs index 10e9e2c592..d9c1051e27 100644 --- a/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs +++ b/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs @@ -20,9 +20,7 @@ namespace Content.Server.GameObjects.Components.Metabolism [RegisterComponent] public class MetabolismComponent : Component { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override string Name => "Metabolism"; diff --git a/Content.Server/GameObjects/Components/Mining/AsteroidRockComponent.cs b/Content.Server/GameObjects/Components/Mining/AsteroidRockComponent.cs index 298b5858ec..eb289fdc40 100644 --- a/Content.Server/GameObjects/Components/Mining/AsteroidRockComponent.cs +++ b/Content.Server/GameObjects/Components/Mining/AsteroidRockComponent.cs @@ -17,13 +17,11 @@ namespace Content.Server.GameObjects.Components.Mining [RegisterComponent] public class AsteroidRockComponent : Component, IInteractUsing { + [Dependency] private readonly IRobustRandom _random = default!; + public override string Name => "AsteroidRock"; private static readonly string[] SpriteStates = {"0", "1", "2", "3", "4"}; -#pragma warning disable 649 - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 - public override void Initialize() { base.Initialize(); diff --git a/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs b/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs index 1a29536a5f..82d42a098e 100644 --- a/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs @@ -12,9 +12,7 @@ namespace Content.Server.GameObjects.Components.Mobs [ComponentReference(typeof(SharedStunnableComponent))] public class StunnableComponent : SharedStunnableComponent { -#pragma warning disable 649 - [Dependency] private IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IGameTiming _gameTiming = default!; protected override void OnKnockdown() { diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs index 7c8963544c..630437f04e 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs @@ -22,12 +22,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups public class NodeGroupFactory : INodeGroupFactory { - private readonly Dictionary _groupTypes = new Dictionary(); + [Dependency] private readonly IReflectionManager _reflectionManager = default!; + [Dependency] private readonly IDynamicTypeFactory _typeFactory = default!; -#pragma warning disable 649 - [Dependency] private readonly IReflectionManager _reflectionManager; - [Dependency] private readonly IDynamicTypeFactory _typeFactory; -#pragma warning restore 649 + private readonly Dictionary _groupTypes = new Dictionary(); public void Initialize() { diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs index 69c39b1ec9..64557b3c34 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs @@ -29,6 +29,8 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups [NodeGroup(NodeGroupID.HVPower, NodeGroupID.MVPower)] public class PowerNetNodeGroup : BaseNetConnectorNodeGroup, IPowerNet { + [Dependency] private readonly IPowerNetManager _powerNetManager = default!; + [ViewVariables] private readonly List _suppliers = new List(); @@ -43,10 +45,6 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups public static readonly IPowerNet NullNet = new NullPowerNet(); -#pragma warning disable 649 - [Dependency] private readonly IPowerNetManager _powerNetManager; -#pragma warning restore 649 - public PowerNetNodeGroup() { foreach (Priority priority in Enum.GetValues(typeof(Priority))) diff --git a/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs b/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs index 5bfbebb9b1..73e7efaf20 100644 --- a/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs @@ -29,10 +29,9 @@ namespace Content.Server.GameObjects.Components.Nutrition [ComponentReference(typeof(IAfterInteract))] public class DrinkComponent : Component, IUse, IAfterInteract, ISolutionChange, IExamine, ILand { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IRobustRandom _random = default!; + public override string Name => "Drink"; [ViewVariables] diff --git a/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs b/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs index 7769fbba05..24fd20008d 100644 --- a/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs @@ -22,10 +22,9 @@ namespace Content.Server.GameObjects.Components.Nutrition [RegisterComponent] public sealed class FoodContainer : SharedFoodContainerComponent, IUse { -#pragma warning disable 649 - [Dependency] private readonly IRobustRandom _random; - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + public override string Name => "FoodContainer"; private AppearanceComponent _appearance; diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/LightBulbComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/LightBulbComponent.cs index 461698422d..ed4748fbf1 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/LightBulbComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/LightBulbComponent.cs @@ -34,11 +34,8 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece [RegisterComponent] public class LightBulbComponent : Component, ILand { - -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IRobustRandom _random = default!; /// /// Invoked whenever the state of the light bulb changes. diff --git a/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs b/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs index 81333b2e07..bed8295a06 100644 --- a/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs +++ b/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs @@ -14,10 +14,8 @@ namespace Content.Server.GameObjects.Components.Power [RegisterComponent] internal class WirePlacerComponent : Component, IAfterInteract { -#pragma warning disable 649 - [Dependency] private readonly IServerEntityManager _entityManager; - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly IServerEntityManager _entityManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; /// public override string Name => "WirePlacer"; diff --git a/Content.Server/GameObjects/Components/Research/LatheComponent.cs b/Content.Server/GameObjects/Components/Research/LatheComponent.cs index f9e434929f..987f6846c9 100644 --- a/Content.Server/GameObjects/Components/Research/LatheComponent.cs +++ b/Content.Server/GameObjects/Components/Research/LatheComponent.cs @@ -70,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Research switch (message.Message) { case LatheQueueRecipeMessage msg: - _prototypeManager.TryIndex(msg.ID, out LatheRecipePrototype recipe); + PrototypeManager.TryIndex(msg.ID, out LatheRecipePrototype recipe); if (recipe != null!) for (var i = 0; i < msg.Quantity; i++) { diff --git a/Content.Server/GameObjects/Components/Rotatable/RotatableComponent.cs b/Content.Server/GameObjects/Components/Rotatable/RotatableComponent.cs index 6a754cadac..564decbb9c 100644 --- a/Content.Server/GameObjects/Components/Rotatable/RotatableComponent.cs +++ b/Content.Server/GameObjects/Components/Rotatable/RotatableComponent.cs @@ -13,9 +13,8 @@ namespace Content.Server.GameObjects.Components.Rotatable [RegisterComponent] public class RotatableComponent : Component { -#pragma warning disable 649 - [Dependency] private readonly IServerNotifyManager _notifyManager; -#pragma warning restore 649 + [Dependency] private readonly IServerNotifyManager _notifyManager = default!; + public override string Name => "Rotatable"; private void TryRotate(IEntity user, Angle angle) diff --git a/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs b/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs index 56e8eb19ce..dc6c2eebd9 100644 --- a/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs +++ b/Content.Server/GameObjects/Components/Sound/FootstepModifierComponent.cs @@ -17,13 +17,10 @@ namespace Content.Server.GameObjects.Components.Sound [RegisterComponent] public class FootstepModifierComponent : Component { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IRobustRandom _footstepRandom; -#pragma warning restore 649 - /// - /// + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IRobustRandom _footstepRandom = default!; + /// public override string Name => "FootstepModifier"; public string _soundCollectionName; diff --git a/Content.Server/GameObjects/Components/Stack/StackComponent.cs b/Content.Server/GameObjects/Components/Stack/StackComponent.cs index d5105efdeb..b6c5d37b9b 100644 --- a/Content.Server/GameObjects/Components/Stack/StackComponent.cs +++ b/Content.Server/GameObjects/Components/Stack/StackComponent.cs @@ -19,9 +19,7 @@ namespace Content.Server.GameObjects.Components.Stack [RegisterComponent] public class StackComponent : SharedStackComponent, IInteractUsing, IExamine { -#pragma warning disable 649 - [Dependency] private readonly ISharedNotifyManager _sharedNotifyManager; -#pragma warning restore 649 + [Dependency] private readonly ISharedNotifyManager _sharedNotifyManager = default!; private bool _throwIndividually = false; diff --git a/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs b/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs index 406e7d0535..4093af2b95 100644 --- a/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs +++ b/Content.Server/GameObjects/Components/Trigger/TimerTrigger/OnUseTimerTriggerComponent.cs @@ -13,9 +13,7 @@ namespace Content.Server.GameObjects.Components.Trigger.TimerTrigger [RegisterComponent] public class OnUseTimerTriggerComponent : Component, IUse { - #pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystemManager; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; public override string Name => "OnUseTimerTrigger"; diff --git a/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs b/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs index da8f272b28..b530ce5d22 100644 --- a/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs +++ b/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs @@ -19,10 +19,8 @@ namespace Content.Server.GameObjects.Components.Utensil [RegisterComponent] public class UtensilComponent : SharedUtensilComponent, IAfterInteract { -#pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystem; - [Dependency] private readonly IRobustRandom _random; -#pragma warning restore 649 + [Dependency] private readonly IEntitySystemManager _entitySystem = default!; + [Dependency] private readonly IRobustRandom _random = default!; protected UtensilType _types = UtensilType.None; diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs index 96468e6e7f..104e20924d 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/FlashComponent.cs @@ -22,10 +22,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee [RegisterComponent] public class FlashComponent : MeleeWeaponComponent, IUse, IExamine { -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly ISharedNotifyManager _notifyManager; -#pragma warning restore 649 + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly ISharedNotifyManager _notifyManager = default!; public override string Name => "Flash"; diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index 5d055f8d4a..ce4a5bf376 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -23,15 +23,13 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee [RegisterComponent] public class MeleeWeaponComponent : Component, IAttack { + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private readonly IPhysicsManager _physicsManager = default!; + public override string Name => "MeleeWeapon"; private TimeSpan _lastAttackTime; -#pragma warning disable 649 - [Dependency] private readonly IMapManager _mapManager; - [Dependency] private readonly IEntitySystemManager _entitySystemManager; - [Dependency] private readonly IPhysicsManager _physicsManager; -#pragma warning restore 649 - private int _damage; private float _range; private float _arcWidth; diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs index 8da76dd33a..6ede88e76a 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs @@ -30,10 +30,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee [RegisterComponent] public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing { -#pragma warning disable 649 - [Dependency] private IRobustRandom _robustRandom; - [Dependency] private readonly ISharedNotifyManager _notifyManager; -#pragma warning restore 649 + [Dependency] private readonly IRobustRandom _robustRandom = default!; + [Dependency] private readonly ISharedNotifyManager _notifyManager = default!; public override string Name => "Stunbaton"; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs index dfc2f61b8a..dfccb1307e 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs @@ -39,10 +39,8 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels { // There's still some of py01 and PJB's work left over, especially in underlying shooting logic, // it's just when I re-organised it changed me as the contributor -#pragma warning disable 649 - [Dependency] private IGameTiming _gameTiming; - [Dependency] private IRobustRandom _robustRandom; -#pragma warning restore 649 + [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly IRobustRandom _robustRandom = default!; public override FireRateSelector FireRateSelector => _fireRateSelector; private FireRateSelector _fireRateSelector; diff --git a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs index 3531dcdde1..3470365282 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs @@ -36,11 +36,9 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible * There's probably a better data structure to use though you'd need to benchmark multiple ones to compare, * at the very least on the memory side it could definitely be better. */ + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; -#pragma warning disable 649 - [Dependency] private IMapManager _mapmanager; - [Dependency] private IGameTiming _gameTiming; -#pragma warning restore 649 private PathfindingSystem _pathfindingSystem; /// @@ -87,7 +85,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible #if DEBUG SubscribeLocalEvent(SendDebugMessage); #endif - _mapmanager.OnGridRemoved += GridRemoved; + _mapManager.OnGridRemoved += GridRemoved; } private void GridRemoved(GridId gridId) @@ -161,7 +159,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible /// public bool CanAccess(IEntity entity, IEntity target, float range = 0.0f) { - var targetTile = _mapmanager.GetGrid(target.Transform.GridID).GetTileRef(target.Transform.GridPosition); + var targetTile = _mapManager.GetGrid(target.Transform.GridID).GetTileRef(target.Transform.GridPosition); var targetNode = _pathfindingSystem.GetNode(targetTile); var collisionMask = 0; @@ -199,7 +197,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible return false; } - var entityTile = _mapmanager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition); + var entityTile = _mapManager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition); var entityNode = _pathfindingSystem.GetNode(entityTile); var entityRegion = GetRegion(entityNode); var targetRegion = GetRegion(targetNode); @@ -409,7 +407,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible /// public PathfindingRegion GetRegion(IEntity entity) { - var entityTile = _mapmanager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition); + var entityTile = _mapManager.GetGrid(entity.Transform.GridID).GetTileRef(entity.Transform.GridPosition); var entityNode = _pathfindingSystem.GetNode(entityTile); return GetRegion(entityNode); } @@ -686,7 +684,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible private void SendRegionsDebugMessage(GridId gridId) { - var grid = _mapmanager.GetGrid(gridId); + var grid = _mapManager.GetGrid(gridId); // Chunk / Regions / Nodes var debugResult = new Dictionary>>(); var chunkIdx = 0; @@ -709,7 +707,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible foreach (var node in region.Nodes) { - var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapmanager); + var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapManager); debugRegionNodes.Add(nodeVector); } @@ -729,7 +727,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible /// private void SendRegionCacheMessage(GridId gridId, IEnumerable regions, bool cached) { - var grid = _mapmanager.GetGrid(gridId); + var grid = _mapManager.GetGrid(gridId); var debugResult = new Dictionary>(); foreach (var region in regions) @@ -738,7 +736,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible foreach (var node in region.Nodes) { - var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapmanager); + var nodeVector = grid.GridTileToLocal(node.TileRef.GridIndices).ToMapPos(_mapManager); debugResult[_runningCacheIdx].Add(nodeVector); } diff --git a/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs index 2411fcc984..fbb36045ab 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs @@ -25,11 +25,9 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering public sealed class AiSteeringSystem : EntitySystem { // http://www.red3d.com/cwr/papers/1999/gdc99steer.html for a steering overview + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IPauseManager _pauseManager = default!; -#pragma warning disable 649 - [Dependency] private IMapManager _mapManager; - [Dependency] private IPauseManager _pauseManager; -#pragma warning restore 649 private PathfindingSystem _pathfindingSystem; /// @@ -255,7 +253,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering } var entitySteering = steeringRequest as EntityTargetSteeringRequest; - + if (entitySteering != null && entitySteering.Target.Deleted) { controller.VelocityDir = Vector2.Zero; @@ -279,10 +277,10 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering // Check if we have arrived var targetDistance = (entity.Transform.MapPosition.Position - steeringRequest.TargetMap.Position).Length; steeringRequest.TimeUntilInteractionCheck -= frameTime; - + if (targetDistance <= steeringRequest.ArrivalDistance && steeringRequest.TimeUntilInteractionCheck <= 0.0f) { - if (!steeringRequest.RequiresInRangeUnobstructed || + if (!steeringRequest.RequiresInRangeUnobstructed || InteractionChecks.InRangeUnobstructed(entity, steeringRequest.TargetMap, steeringRequest.ArrivalDistance, ignoredEnt: entity)) { // TODO: Need cruder LOS checks for ranged weaps @@ -353,7 +351,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering if (entitySteering != null) { // Check if target's moved too far - if (_entityTargetPosition.TryGetValue(entity, out var targetGrid) && + if (_entityTargetPosition.TryGetValue(entity, out var targetGrid) && (entitySteering.TargetGrid.Position - targetGrid.Position).Length >= entitySteering.TargetMaxMove) { // We'll just repath and keep following the existing one until we get a new one diff --git a/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs index 1b83b0b3fe..969b1a28a7 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs @@ -11,9 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click { public class ExamineSystem : ExamineSystemShared { -#pragma warning disable 649 - [Dependency] private IEntityManager _entityManager; -#pragma warning restore 649 + [Dependency] private IEntityManager _entityManager = default!; private static readonly FormattedMessage _entityNotFoundMessage; diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index d607e79d59..c46ffa7bb7 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -39,9 +39,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click [UsedImplicitly] public sealed class InteractionSystem : SharedInteractionSystem { -#pragma warning disable 649 - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly IMapManager _mapManager = default!; public override void Initialize() { diff --git a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs index 2138e559dc..e766994372 100644 --- a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs @@ -36,10 +36,8 @@ namespace Content.Server.GameObjects.EntitySystems [UsedImplicitly] internal class ConstructionSystem : SharedConstructionSystem { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IMapManager _mapManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IMapManager _mapManager = default!; private readonly Dictionary _craftRecipes = new Dictionary(); diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index 8243fca463..68d95e7028 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -27,10 +27,8 @@ namespace Content.Server.GameObjects.EntitySystems [UsedImplicitly] internal sealed class HandsSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IMapManager _mapManager; - [Dependency] private readonly IServerNotifyManager _notifyManager; -#pragma warning restore 649 + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IServerNotifyManager _notifyManager = default!; private const float ThrowForce = 1.5f; // Throwing force of mobs in Newtons diff --git a/Content.Server/GameObjects/EntitySystems/NodeGroupSystem.cs b/Content.Server/GameObjects/EntitySystems/NodeGroupSystem.cs index c1c719ad22..9b455e8cec 100644 --- a/Content.Server/GameObjects/EntitySystems/NodeGroupSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/NodeGroupSystem.cs @@ -6,9 +6,7 @@ namespace Content.Server.GameObjects.EntitySystems { public class NodeGroupSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly INodeGroupManager _groupManager; -#pragma warning restore 649 + [Dependency] private readonly INodeGroupManager _groupManager = default!; public override void Update(float frameTime) { diff --git a/Content.Server/GameObjects/EntitySystems/PowerNetSystem.cs b/Content.Server/GameObjects/EntitySystems/PowerNetSystem.cs index 74297f8670..40244597f5 100644 --- a/Content.Server/GameObjects/EntitySystems/PowerNetSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/PowerNetSystem.cs @@ -6,9 +6,7 @@ namespace Content.Server.GameObjects.EntitySystems { public class PowerNetSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IPowerNetManager _powerNetManager; -#pragma warning restore 649 + [Dependency] private readonly IPowerNetManager _powerNetManager = default!; public override void Update(float frameTime) { diff --git a/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs b/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs index 9077e94184..f912a63ec5 100644 --- a/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs @@ -10,10 +10,8 @@ namespace Content.Server.GameObjects.EntitySystems { public class RoundEndSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private IGameTicker _gameTicker; - [Dependency] private IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IGameTicker _gameTicker = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; private CancellationTokenSource _roundEndCancellationTokenSource = new CancellationTokenSource(); public bool IsRoundEndCountdownStarted { get; private set; } diff --git a/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs b/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs index c34a502b21..dd02a67a76 100644 --- a/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs @@ -21,11 +21,9 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents // Somewhat based off of TG's implementation of events public sealed class StationEventSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IServerNetManager _netManager; - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IGameTicker _gameTicker; -#pragma warning restore 649 + [Dependency] private readonly IServerNetManager _netManager = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IGameTicker _gameTicker = default!; public StationEvent CurrentEvent { get; private set; } public IReadOnlyCollection StationEvents => _stationEvents; @@ -33,7 +31,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents private List _stationEvents = new List(); private const float MinimumTimeUntilFirstEvent = 600; - + /// /// How long until the next check for an event runs /// @@ -77,7 +75,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents return result.ToString(); } - + /// /// Admins can forcibly run events by passing in the Name /// @@ -88,14 +86,14 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents // Could use a dictionary but it's such a minor thing, eh. // Wasn't sure on whether to localize this given it's a command var upperName = name.ToUpperInvariant(); - + foreach (var stationEvent in _stationEvents) { if (stationEvent.Name.ToUpperInvariant() != upperName) { continue; } - + CurrentEvent?.Shutdown(); CurrentEvent = stationEvent; stationEvent.Startup(); @@ -114,12 +112,12 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents { var availableEvents = AvailableEvents(true); var randomEvent = FindEvent(availableEvents); - + if (randomEvent == null) { return Loc.GetString("No valid events available"); } - + CurrentEvent?.Shutdown(); CurrentEvent = randomEvent; CurrentEvent.Startup(); @@ -134,7 +132,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents public string StopEvent() { string resultText; - + if (CurrentEvent == null) { resultText = Loc.GetString("No event running currently"); @@ -145,11 +143,11 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents CurrentEvent.Shutdown(); CurrentEvent = null; } - + ResetTimer(); return resultText; } - + public override void Initialize() { base.Initialize(); @@ -212,7 +210,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents if (CurrentEvent != null) { CurrentEvent.Update(frameTime); - + // Shutdown the event and set the timer for the next event if (!CurrentEvent.Running) { @@ -262,14 +260,14 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents { return null; } - + var sumOfWeights = 0; foreach (var stationEvent in availableEvents) { sumOfWeights += (int) stationEvent.Weight; } - + var robustRandom = IoCManager.Resolve(); sumOfWeights = robustRandom.Next(sumOfWeights); @@ -295,7 +293,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents { TimeSpan currentTime; var playerCount = IoCManager.Resolve().PlayerCount; - + // playerCount does a lock so we'll just keep the variable here if (!ignoreEarliestStart) { @@ -346,7 +344,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents CurrentEvent.Shutdown(); CurrentEvent = null; } - + foreach (var stationEvent in _stationEvents) { stationEvent.Occurrences = 0; diff --git a/Content.Server/GameObjects/EntitySystems/VerbSystem.cs b/Content.Server/GameObjects/EntitySystems/VerbSystem.cs index 63775b3e44..6b625cdf25 100644 --- a/Content.Server/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/VerbSystem.cs @@ -14,9 +14,7 @@ namespace Content.Server.GameObjects.EntitySystems { public class VerbSystem : EntitySystem { -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + [Dependency] private readonly IEntityManager _entityManager = default!; public override void Initialize() { diff --git a/Content.Server/GameTicking/GamePresets/PresetDeathMatch.cs b/Content.Server/GameTicking/GamePresets/PresetDeathMatch.cs index 04e663b6da..163f3a0d85 100644 --- a/Content.Server/GameTicking/GamePresets/PresetDeathMatch.cs +++ b/Content.Server/GameTicking/GamePresets/PresetDeathMatch.cs @@ -8,9 +8,7 @@ namespace Content.Server.GameTicking.GamePresets { public sealed class PresetDeathMatch : GamePreset { -#pragma warning disable 649 - [Dependency] private readonly IGameTicker _gameTicker; -#pragma warning restore 649 + [Dependency] private readonly IGameTicker _gameTicker = default!; public override bool Start(IReadOnlyList readyPlayers, bool force = false) { diff --git a/Content.Server/GameTicking/GamePresets/PresetSandbox.cs b/Content.Server/GameTicking/GamePresets/PresetSandbox.cs index 7ceebaf108..4c8c61267a 100644 --- a/Content.Server/GameTicking/GamePresets/PresetSandbox.cs +++ b/Content.Server/GameTicking/GamePresets/PresetSandbox.cs @@ -7,9 +7,7 @@ namespace Content.Server.GameTicking.GamePresets { public sealed class PresetSandbox : GamePreset { -#pragma warning disable 649 - [Dependency] private readonly ISandboxManager _sandboxManager; -#pragma warning restore 649 + [Dependency] private readonly ISandboxManager _sandboxManager = default!; public override bool Start(IReadOnlyList readyPlayers, bool force = false) { diff --git a/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs b/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs index f79abde6b2..81eeb43d22 100644 --- a/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs +++ b/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs @@ -21,13 +21,11 @@ namespace Content.Server.GameTicking.GamePresets { public class PresetSuspicion : GamePreset { -#pragma warning disable 649 - [Dependency] private readonly IChatManager _chatManager; - [Dependency] private readonly IGameTicker _gameTicker; - [Dependency] private readonly IRobustRandom _random; - [Dependency] private readonly IConfigurationManager _cfg; - [Dependency] private IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IChatManager _chatManager = default!; + [Dependency] private readonly IGameTicker _gameTicker = default!; + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public int MinPlayers { get; set; } public int MinTraitors { get; set; } diff --git a/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs b/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs index cd108324e0..7c59c9dd04 100644 --- a/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs +++ b/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs @@ -21,12 +21,10 @@ namespace Content.Server.GameTicking.GameRules { private static readonly TimeSpan DeadCheckDelay = TimeSpan.FromSeconds(5); -#pragma warning disable 649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IChatManager _chatManager; - [Dependency] private readonly IGameTicker _gameTicker; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IChatManager _chatManager = default!; + [Dependency] private readonly IGameTicker _gameTicker = default!; private CancellationTokenSource _checkTimerCancel; diff --git a/Content.Server/GameTicking/GameRules/RuleSuspicion.cs b/Content.Server/GameTicking/GameRules/RuleSuspicion.cs index 326614c2dd..f004eed7d4 100644 --- a/Content.Server/GameTicking/GameRules/RuleSuspicion.cs +++ b/Content.Server/GameTicking/GameRules/RuleSuspicion.cs @@ -25,11 +25,9 @@ namespace Content.Server.GameTicking.GameRules { private static readonly TimeSpan DeadCheckDelay = TimeSpan.FromSeconds(1); -#pragma warning disable 649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IChatManager _chatManager; - [Dependency] private readonly IGameTicker _gameTicker; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IChatManager _chatManager = default!; + [Dependency] private readonly IGameTicker _gameTicker = default!; private readonly CancellationTokenSource _checkTimerCancel = new CancellationTokenSource(); diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index da6f17c9da..a38aad78c2 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -980,22 +980,20 @@ The current game mode is: [color=white]{0}[/color]. return preset; } -#pragma warning disable 649 - [Dependency] private IEntityManager _entityManager; - [Dependency] private IMapManager _mapManager; - [Dependency] private IMapLoader _mapLoader; - [Dependency] private IGameTiming _gameTiming; - [Dependency] private IConfigurationManager _configurationManager; - [Dependency] private IChatManager _chatManager; - [Dependency] private IServerNetManager _netManager; - [Dependency] private IDynamicTypeFactory _dynamicTypeFactory; - [Dependency] private IPrototypeManager _prototypeManager; - [Dependency] private readonly ILocalizationManager _localization; - [Dependency] private readonly IRobustRandom _robustRandom; - [Dependency] private readonly IServerPreferencesManager _prefsManager; - [Dependency] private readonly IBaseServer _baseServer; - [Dependency] private readonly IWatchdogApi _watchdogApi; -#pragma warning restore 649 + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IMapLoader _mapLoader = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private IConfigurationManager _configurationManager = default!; + [Dependency] private IChatManager _chatManager = default!; + [Dependency] private IServerNetManager _netManager = default!; + [Dependency] private IDynamicTypeFactory _dynamicTypeFactory = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly ILocalizationManager _localization = default!; + [Dependency] private readonly IRobustRandom _robustRandom = default!; + [Dependency] private readonly IServerPreferencesManager _prefsManager = default!; + [Dependency] private readonly IBaseServer _baseServer = default!; + [Dependency] private readonly IWatchdogApi _watchdogApi = default!; } public enum GameRunLevel diff --git a/Content.Server/GameTicking/GameTickerCommands.cs b/Content.Server/GameTicking/GameTickerCommands.cs index a43f2d9498..2e3b0d78d0 100644 --- a/Content.Server/GameTicking/GameTickerCommands.cs +++ b/Content.Server/GameTicking/GameTickerCommands.cs @@ -183,9 +183,8 @@ namespace Content.Server.GameTicking class JoinGameCommand : IClientCommand { -#pragma warning disable 649 - [Dependency] private IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + public string Command => "joingame"; public string Description => ""; public string Help => ""; diff --git a/Content.Server/MoMMILink.cs b/Content.Server/MoMMILink.cs index 318d98151a..0ea3befd25 100644 --- a/Content.Server/MoMMILink.cs +++ b/Content.Server/MoMMILink.cs @@ -18,12 +18,10 @@ namespace Content.Server { internal sealed class MoMMILink : IMoMMILink, IPostInjectInit { -#pragma warning disable 649 - [Dependency] private readonly IConfigurationManager _configurationManager; - [Dependency] private readonly IStatusHost _statusHost; - [Dependency] private readonly IChatManager _chatManager; - [Dependency] private readonly ITaskManager _taskManager; -#pragma warning restore 649 + [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private readonly IStatusHost _statusHost = default!; + [Dependency] private readonly IChatManager _chatManager = default!; + [Dependency] private readonly ITaskManager _taskManager = default!; private readonly HttpClient _httpClient = new HttpClient(); diff --git a/Content.Server/Mobs/Commands.cs b/Content.Server/Mobs/Commands.cs index a759d8d5b4..81efc2a4eb 100644 --- a/Content.Server/Mobs/Commands.cs +++ b/Content.Server/Mobs/Commands.cs @@ -51,9 +51,7 @@ namespace Content.Server.Mobs public class AddRoleCommand : IClientCommand { -#pragma warning disable 649 - [Dependency] private IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public string Command => "addrole"; @@ -85,10 +83,7 @@ namespace Content.Server.Mobs public class RemoveRoleCommand : IClientCommand { - -#pragma warning disable 649 - [Dependency] private IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public string Command => "rmrole"; diff --git a/Content.Server/PDA/PDAUplinkManager.cs b/Content.Server/PDA/PDAUplinkManager.cs index 0d93c95dc5..ab2b63213a 100644 --- a/Content.Server/PDA/PDAUplinkManager.cs +++ b/Content.Server/PDA/PDAUplinkManager.cs @@ -14,10 +14,8 @@ namespace Content.Server.PDA { public class PDAUplinkManager : IPDAUplinkManager { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; private List _accounts; private List _listings; diff --git a/Content.Server/Preferences/ServerPreferencesManager.cs b/Content.Server/Preferences/ServerPreferencesManager.cs index ac9e944f56..f673a4e7b2 100644 --- a/Content.Server/Preferences/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/ServerPreferencesManager.cs @@ -19,11 +19,10 @@ namespace Content.Server.Preferences /// public class ServerPreferencesManager : SharedPreferencesManager, IServerPreferencesManager { -#pragma warning disable 649 - [Dependency] private readonly IServerNetManager _netManager; - [Dependency] private readonly IConfigurationManager _configuration; - [Dependency] private readonly IResourceManager _resourceManager; -#pragma warning restore 649 + [Dependency] private readonly IServerNetManager _netManager = default!; + [Dependency] private readonly IConfigurationManager _configuration = default!; + [Dependency] private readonly IResourceManager _resourceManager = default!; + private PreferencesDatabase _preferencesDb; private Task _prefsDbLoadTask; diff --git a/Content.Server/Sandbox/SandboxManager.cs b/Content.Server/Sandbox/SandboxManager.cs index 76cfc201f0..78b89871dd 100644 --- a/Content.Server/Sandbox/SandboxManager.cs +++ b/Content.Server/Sandbox/SandboxManager.cs @@ -19,15 +19,13 @@ namespace Content.Server.Sandbox { internal sealed class SandboxManager : SharedSandboxManager, ISandboxManager { -#pragma warning disable 649 - [Dependency] private readonly IPlayerManager _playerManager; - [Dependency] private readonly IServerNetManager _netManager; - [Dependency] private readonly IGameTicker _gameTicker; - [Dependency] private readonly IPlacementManager _placementManager; - [Dependency] private readonly IConGroupController _conGroupController; - [Dependency] private readonly IEntityManager _entityManager; - [Dependency] private readonly IConsoleShell _shell; -#pragma warning restore 649 + [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly IServerNetManager _netManager = default!; + [Dependency] private readonly IGameTicker _gameTicker = default!; + [Dependency] private readonly IPlacementManager _placementManager = default!; + [Dependency] private readonly IConGroupController _conGroupController = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IConsoleShell _shell = default!; private bool _isSandboxEnabled; diff --git a/Content.Server/ServerNotifyManager.cs b/Content.Server/ServerNotifyManager.cs index c4e8068106..ee3129d4c1 100644 --- a/Content.Server/ServerNotifyManager.cs +++ b/Content.Server/ServerNotifyManager.cs @@ -15,9 +15,7 @@ namespace Content.Server { public class ServerNotifyManager : SharedNotifyManager, IServerNotifyManager { -#pragma warning disable 649 - [Dependency] private IServerNetManager _netManager; -#pragma warning restore 649 + [Dependency] private readonly IServerNetManager _netManager = default!; private bool _initialized; diff --git a/Content.Shared/Chemistry/ReagentPrototype.cs b/Content.Shared/Chemistry/ReagentPrototype.cs index 1f476c47fc..e863895650 100644 --- a/Content.Shared/Chemistry/ReagentPrototype.cs +++ b/Content.Shared/Chemistry/ReagentPrototype.cs @@ -14,9 +14,7 @@ namespace Content.Shared.Chemistry { private const float CelsiusToKelvin = 273.15f; -#pragma warning disable 649 - [Dependency] private readonly IModuleManager _moduleManager; -#pragma warning restore 649 + [Dependency] private readonly IModuleManager _moduleManager = default!; private string _id; private string _name; diff --git a/Content.Shared/EntryPoint.cs b/Content.Shared/EntryPoint.cs index 25976f6379..ad446b324d 100644 --- a/Content.Shared/EntryPoint.cs +++ b/Content.Shared/EntryPoint.cs @@ -16,11 +16,9 @@ namespace Content.Shared // If you want to change your codebase's language, do it here. private const string Culture = "en-US"; -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; - [Dependency] private readonly ILocalizationManager _localizationManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private readonly ILocalizationManager _localizationManager = default!; public override void PreInit() { diff --git a/Content.Shared/GameObjects/Components/Cargo/SharedCargoConsoleComponent.cs b/Content.Shared/GameObjects/Components/Cargo/SharedCargoConsoleComponent.cs index 66f5041184..b8d3088e64 100644 --- a/Content.Shared/GameObjects/Components/Cargo/SharedCargoConsoleComponent.cs +++ b/Content.Shared/GameObjects/Components/Cargo/SharedCargoConsoleComponent.cs @@ -9,15 +9,12 @@ namespace Content.Shared.GameObjects.Components.Cargo { public class SharedCargoConsoleComponent : Component { -#pragma warning disable CS0649 - [Dependency] - protected IPrototypeManager _prototypeManager; -#pragma warning restore + [Dependency] protected readonly IPrototypeManager PrototypeManager = default!; public sealed override string Name => "CargoConsole"; /// - /// Sends away or requests shuttle + /// Sends away or requests shuttle /// [Serializable, NetSerializable] public class CargoConsoleShuttleMessage : BoundUserInterfaceMessage diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs index 0c11e7393a..1d324ba7d4 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs @@ -14,9 +14,7 @@ namespace Content.Shared.GameObjects.Components.Mobs { public abstract class SharedStunnableComponent : Component, IMoveSpeedModifier, IActionBlocker, IInteractHand { -#pragma warning disable 649 - [Dependency] private IGameTiming _gameTiming; -#pragma warning restore 649 + [Dependency] private readonly IGameTiming _gameTiming = default!; public sealed override string Name => "Stunnable"; public override uint? NetID => ContentNetIDs.STUNNABLE; diff --git a/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs b/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs index d83b7b89d9..013b40e59e 100644 --- a/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs +++ b/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs @@ -16,9 +16,7 @@ namespace Content.Shared.GameObjects.Components.Movement { public abstract class SharedSlipperyComponent : Component, ICollideBehavior { -#pragma warning disable 649 - [Dependency] private readonly IEntityManager _entityManager; -#pragma warning restore 649 + [Dependency] private readonly IEntityManager _entityManager = default!; public sealed override string Name => "Slippery"; diff --git a/Content.Shared/GameObjects/Components/Research/SharedLatheComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedLatheComponent.cs index 94480ea9db..79ae8e0d61 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedLatheComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedLatheComponent.cs @@ -11,14 +11,11 @@ namespace Content.Shared.GameObjects.Components.Research { public class SharedLatheComponent : Component { + [Dependency] protected readonly IPrototypeManager PrototypeManager = default!; + public override string Name => "Lathe"; public override uint? NetID => ContentNetIDs.LATHE; -#pragma warning disable CS0649 - [Dependency] - protected IPrototypeManager _prototypeManager; -#pragma warning restore - public bool CanProduce(LatheRecipePrototype recipe, int quantity = 1) { if (!Owner.TryGetComponent(out SharedMaterialStorageComponent storage) @@ -36,7 +33,7 @@ namespace Content.Shared.GameObjects.Components.Research public bool CanProduce(string ID, int quantity = 1) { - return _prototypeManager.TryIndex(ID, out LatheRecipePrototype recipe) && CanProduce(recipe, quantity); + return PrototypeManager.TryIndex(ID, out LatheRecipePrototype recipe) && CanProduce(recipe, quantity); } /// diff --git a/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs b/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs index ca1fc0a5b9..610b414c65 100644 --- a/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/SharedInteractionSystem.cs @@ -17,9 +17,7 @@ namespace Content.Shared.GameObjects.EntitySystems [UsedImplicitly] public class SharedInteractionSystem : EntitySystem { - #pragma warning disable 649 - [Dependency] private readonly IPhysicsManager _physicsManager; - #pragma warning restore 649 + [Dependency] private readonly IPhysicsManager _physicsManager = default!; public const float InteractionRange = 2; public const float InteractionRangeSquared = InteractionRange * InteractionRange; diff --git a/Content.Shared/Kitchen/RecipeManager.cs b/Content.Shared/Kitchen/RecipeManager.cs index c5f7657a69..08c30cb646 100644 --- a/Content.Shared/Kitchen/RecipeManager.cs +++ b/Content.Shared/Kitchen/RecipeManager.cs @@ -5,12 +5,10 @@ using Robust.Shared.Prototypes; namespace Content.Shared.Kitchen { - public class RecipeManager { -#pragma warning disable 649 - [Dependency] private readonly IPrototypeManager _prototypeManager; -#pragma warning restore 649 + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + public List Recipes { get; private set; } public void Initialize() diff --git a/Content.Shared/Physics/SlipController.cs b/Content.Shared/Physics/SlipController.cs index f5f3004a3f..4339e3de47 100644 --- a/Content.Shared/Physics/SlipController.cs +++ b/Content.Shared/Physics/SlipController.cs @@ -6,9 +6,7 @@ namespace Content.Shared.Physics { public class SlipController : VirtualController { -#pragma warning disable 649 - [Dependency] private readonly IPhysicsManager _physicsManager; -#pragma warning restore 649 + [Dependency] private readonly IPhysicsManager _physicsManager = default!; public SlipController() { diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings index 632333c3cc..9a4d47bb02 100644 --- a/SpaceStation14.sln.DotSettings +++ b/SpaceStation14.sln.DotSettings @@ -78,6 +78,7 @@ True True True + True True True True