From 83c2a1be11e306b4bdab5535e9a3365cca5d1c8c Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 8 May 2026 12:38:33 +0200 Subject: [PATCH] [Dependency] source generator part 2 (#6550) * [Dependency] source generator No more reflection, no more codegen at runtime Also various changes to Roslyn helpers to make this easier to write. Requires all types with dependencies to be partial and not have readonly dependency fields. An analyzer enforces this at warning level, the previous injection strategies have remained in the code *for now* as a fallback. No fallback is available for [field: Dependency] properties, due to a Roslyn bug. Code Fixes exist. We love Roslyn * Apply dependencies generator changes to all code * Release notes * Preprocessor got hands * Handle nullable dependencies These are bad but gotta deal with it. * Apply suggestions from code review Co-authored-by: Moony * Fine, let's not use collection expressions --------- Co-authored-by: Moony --- .../Cef/WebViewManagerCef.BrowserWindow.cs | 2 +- .../Cef/WebViewManagerCef.Control.cs | 4 +- .../Cef/WebViewManagerCef.cs | 16 +- Robust.Client.WebView/WebViewControl.cs | 4 +- Robust.Client/Audio/AudioManager.cs | 8 +- Robust.Client/Audio/AudioSystem.cs | 20 +- .../Audio/Midi/Commands/MidiPanicCommand.cs | 4 +- Robust.Client/Audio/Midi/MidiManager.cs | 18 +- Robust.Client/Audio/ShowAudioCommand.cs | 10 +- Robust.Client/BaseClient.cs | 20 +- .../ComponentTrees/SpriteTreeSystem.cs | 4 +- .../ClientNetConfigurationManager.cs | 8 +- Robust.Client/Console/ClientConsoleHost.cs | 10 +- .../Console/Commands/AddCompCommand.cs | 12 +- .../Console/Commands/ClientSpawnCommand.cs | 6 +- Robust.Client/Console/Commands/Debug.cs | 124 ++++----- .../Console/Commands/DebugAnchoredCommand.cs | 4 +- .../Console/Commands/GridChunkBBCommand.cs | 4 +- .../Console/Commands/LauncherAuthCommand.cs | 6 +- .../Console/Commands/LightBBCommand.cs | 4 +- .../Console/Commands/MonitorCommands.cs | 12 +- .../Commands/PhysicsOverlayCommands.cs | 4 +- .../Commands/ProfileEntitySpawningCommand.cs | 4 +- Robust.Client/Console/Commands/QuitCommand.cs | 4 +- .../Commands/ReloadLocalizationsCommand.cs | 4 +- Robust.Client/Console/Commands/Scripting.cs | 4 +- .../Console/Commands/SendGarbageCommand.cs | 4 +- .../Commands/SetInputContextCommand.cs | 4 +- .../Commands/ShowPlayerVelocityCommand.cs | 4 +- .../Console/Commands/ViewportDebugCommands.cs | 10 +- Robust.Client/Console/ScriptClient.cs | 4 +- Robust.Client/Console/ScriptConsoleClient.cs | 11 +- .../Debugging/DebugAnchoringSystem.cs | 12 +- Robust.Client/Debugging/DebugDrawingSystem.cs | 20 +- Robust.Client/Debugging/DebugPhysicsSystem.cs | 20 +- .../Debugging/DebugRayDrawingSystem.cs | 6 +- Robust.Client/Debugging/OverlayCommand.cs | 10 +- .../Debugging/Overlays/TileDebugOverlay.cs | 14 +- .../GameController.Standalone.cs | 4 +- .../GameController/GameController.cs | 98 +++---- .../GameObjects/ClientEntityManager.cs | 12 +- .../Renderable/SpriteBoundsOverlay.cs | 8 +- .../Components/Renderable/SpriteComponent.cs | 8 +- .../EntitySystems/AnimationPlayerSystem.cs | 4 +- .../EntitySystems/AppearanceSystem.cs | 4 +- .../EntitySystems/ClientOccluderSystem.cs | 6 +- .../EntitySystems/ContainerSystem.cs | 12 +- .../EntitySystems/DebugEntityLookupSystem.cs | 4 +- .../GameObjects/EntitySystems/EyeSystem.cs | 4 +- .../EntitySystems/GenericVisualizerSystem.cs | 6 +- .../GridChunkBoundsDebugSystem.cs | 12 +- .../GameObjects/EntitySystems/InputSystem.cs | 22 +- .../GameObjects/EntitySystems/MidiSystem.cs | 4 +- .../EntitySystems/PointLightSystem.cs | 6 +- .../ShowPlayerVelocityDebugSystem.cs | 10 +- .../GameObjects/EntitySystems/SpriteSystem.cs | 20 +- .../EntitySystems/TransformSystem.cs | 2 +- .../EntitySystems/VisualizerSystem.cs | 12 +- Robust.Client/GameStates/ClientDirtySystem.cs | 6 +- .../GameStates/ClientGameStateManager.cs | 52 ++-- Robust.Client/GameStates/NetEntityOverlay.cs | 12 +- Robust.Client/GameStates/NetGraphOverlay.cs | 44 +-- Robust.Client/GameStates/NetInterpOverlay.cs | 18 +- .../Graphics/ClientEye/EyeManager.cs | 8 +- Robust.Client/Graphics/Clyde/Clyde.Sprite.cs | 2 +- Robust.Client/Graphics/Clyde/Clyde.cs | 38 +-- .../Graphics/Clyde/Windowing/Sdl3.cs | 4 +- .../SystemFontDebugWindow.xaml.cs | 2 +- .../Graphics/LoadingScreenManager.cs | 18 +- .../Graphics/Overlays/OverlayManager.cs | 4 +- Robust.Client/Graphics/SystemFontManager.cs | 8 +- Robust.Client/HWId/BasicHWId.cs | 6 +- Robust.Client/Input/ClydeInputManager.cs | 4 +- Robust.Client/Input/InputManager.cs | 46 ++-- .../Localization/ClientLocalizationManager.cs | 4 +- .../Map/ClydeTileDefinitionManager.cs | 22 +- .../Physics/DebugPhysicsIslandSystem.cs | 14 +- Robust.Client/Physics/GridFixtureSystem.cs | 16 +- .../Physics/GridSplitVisualsCommand.cs | 4 +- Robust.Client/Physics/PhysicsSystem.cs | 6 +- Robust.Client/Placement/PlacementManager.cs | 30 +-- Robust.Client/Player/FilterSystem.cs | 6 +- Robust.Client/Player/PlayerManager.cs | 20 +- .../Profiling/LiveProfileViewControl.cs | 6 +- Robust.Client/Profiling/ProfViewManager.cs | 8 +- .../Prototypes/ClientPrototypeManager.cs | 10 +- .../Replays/Commands/ReplayCommand.cs | 8 +- .../Replays/Commands/ReplayLoadCommand.cs | 10 +- .../Replays/Commands/ReplaySkipCommand.cs | 4 +- .../Replays/Commands/ReplayToggleUiCommand.cs | 4 +- .../Replays/Loading/ReplayLoadManager.cs | 24 +- .../Replays/Playback/ReplayPlaybackManager.cs | 32 +-- .../Replays/ReplayRecordingManager.cs | 12 +- .../Replays/UI/ReplayControlWidget.cs | 4 +- .../ResourceCache.Preload.cs | 13 +- .../Serialization/ClientRobustSerializer.cs | 2 +- Robust.Client/State/StateManager.cs | 10 +- Robust.Client/Timing/ClientGameTiming.cs | 4 +- .../Upload/Commands/UploadFileCommand.cs | 8 +- .../Upload/Commands/UploadFolderCommand.cs | 22 +- .../Upload/NetworkResourceManager.cs | 4 +- .../EntitySpawningUIController.cs | 31 +-- .../TileSpawningUIController.cs | 10 +- .../UserInterface/Controllers/UIController.cs | 8 +- .../Controls/ColorSelectorSliders.cs | 4 +- .../UserInterface/Controls/LineEdit.cs | 12 +- .../UserInterface/Controls/OSWindow.cs | 8 +- .../UserInterface/Controls/OutputPanel.cs | 4 +- .../UserInterface/Controls/RichTextLabel.cs | 4 +- .../UserInterface/Controls/TextEdit.cs | 252 +++++++++--------- .../CustomControls/DebugConsole.xaml.cs | 8 +- .../DebugMonitorControls/DebugClydePanel.cs | 6 +- .../DebugMonitorControls/DebugCoordsPanel.cs | 16 +- .../DebugMonitorControls/DebugInputPanel.cs | 4 +- .../DebugMonitorControls/DebugMonitors.cs | 12 +- .../CustomControls/EntitySpawnWindow.xaml.cs | 4 +- .../CustomControls/ViewportContainer.cs | 12 +- .../DevWindow/DevWindowTabPerf.xaml.cs | 2 +- .../DevWindowTabRenderTargets.xaml.cs | 4 +- .../DevWindow/DevWindowTabTextures.xaml.cs | 4 +- .../DevWindow/DevWindowTabUI.xaml.cs | 4 +- .../UserInterface/DevWindow/ProfGraphView.cs | 10 +- .../DevWindow/ProfSettings.xaml.cs | 2 +- .../UserInterface/DevWindow/ProfTree.xaml.cs | 4 +- .../UserInterface/RichText/BoldItalicTag.cs | 6 +- .../UserInterface/RichText/BoldTag.cs | 6 +- .../UserInterface/RichText/CommandLinkTag.cs | 4 +- .../UserInterface/RichText/FontTag.cs | 8 +- .../RichText/FontTagHijackHolder.cs | 4 +- .../UserInterface/RichText/HeadingTag.cs | 6 +- .../UserInterface/RichText/ItalicTag.cs | 6 +- .../RichText/MarkupTagManager.cs | 10 +- .../DebugBuiltinConnectionScreen.xaml.cs | 8 +- Robust.Client/UserInterface/UiCommands.cs | 4 +- .../UserInterface/UserInterfaceManager.cs | 36 +-- .../XAML/Proxy/XamlHotReloadManager.cs | 12 +- .../XAML/Proxy/XamlProxyHelper.cs | 2 +- .../XAML/Proxy/XamlProxyManager.cs | 6 +- Robust.Client/Utility/DiscordRichPresence.cs | 10 +- Robust.Client/Utility/ReloadManager.cs | 12 +- .../ClientViewVariablesManager.cs | 10 +- .../Editors/VVPropEditorEntProtoId.cs | 4 +- .../Editors/VVPropEditorKeyValuePair.cs | 8 +- .../Editors/VVPropEditorNullableEntProtoId.cs | 4 +- .../Editors/VVPropEditorProtoId.cs | 6 +- .../Editors/VVPropEditorReference.cs | 6 +- .../Editors/VVPropEditorTuple.cs | 6 +- .../ViewVariableControlFactory.cs | 64 ++--- .../ViewVariables/ViewVariablesCommand.cs | 8 +- Robust.Server/Audio/AudioSystem.cs | 4 +- Robust.Server/BaseServer.cs | 86 +++--- .../ServerNetConfigurationManager.cs | 6 +- .../Console/Commands/AddComponentCommand.cs | 6 +- Robust.Server/Console/Commands/MapCommands.cs | 38 +-- .../Console/Commands/PlayerCommands.cs | 10 +- .../Commands/ProfileEntitySpawningCommand.cs | 4 +- .../Commands/ReloadLocalizationsCommand.cs | 4 +- .../Commands/RemoveComponentCommand.cs | 6 +- Robust.Server/Console/Commands/SpinCommand.cs | 4 +- Robust.Server/Console/Commands/SysCommands.cs | 14 +- .../Console/Commands/ViewSubscriberCommand.cs | 8 +- Robust.Server/Console/ServerConsoleHost.cs | 16 +- Robust.Server/Console/SystemConsoleManager.cs | 22 +- .../MetricsManager.UpdateMetrics.cs | 2 +- Robust.Server/DataMetrics/MetricsManager.cs | 8 +- .../GameObjects/EntitySystems/InputSystem.cs | 4 +- .../GameObjects/EntitySystems/MapSystem.cs | 6 +- .../EntitySystems/PhysicsSystem.cs | 4 +- .../EntitySystems/PointLightSystem.cs | 6 +- .../EntitySystems/ServerOccluderSystem.cs | 6 +- .../EntitySystems/VisibilitySystem.cs | 6 +- .../GameObjects/ServerEntityManager.cs | 16 +- Robust.Server/GameStates/PvsOverrideSystem.cs | 6 +- Robust.Server/GameStates/PvsSystem.Dirty.cs | 2 +- .../GameStates/PvsSystem.Serialize.cs | 2 +- Robust.Server/GameStates/PvsSystem.cs | 26 +- .../GameStates/ServerGameStateManager.cs | 8 +- .../Physics/Commands/BoxStackCommand.cs | 4 +- Robust.Server/Physics/GridFixtureSystem.cs | 14 +- Robust.Server/Physics/MergeGridsCommand.cs | 4 +- Robust.Server/Placement/PlacementManager.cs | 20 +- Robust.Server/Player/PlayerManager.cs | 58 ++-- .../Prototypes/ServerPrototypeManager.cs | 10 +- .../Replays/ReplayRecordingManager.cs | 4 +- Robust.Server/Scripting/ScriptHost.cs | 22 +- .../ServerHub/AdvertiseNowCommand.cs | 4 +- Robust.Server/ServerHub/HubManager.cs | 8 +- Robust.Server/ServerStatus/StatusHost.cs | 10 +- Robust.Server/ServerStatus/WatchdogApi.cs | 12 +- .../Commands/Players/PlayersCommand.cs | 4 +- .../Upload/GamePrototypeLoadManager.cs | 10 +- .../Upload/NetworkResourceManager.cs | 12 +- .../Upload/UploadedContentManager.cs | 10 +- .../ServerViewVariablesManager.cs | 16 +- .../GameObjects/EntitySystemManager_Tests.cs | 20 +- .../Systems/AnchoredSystemTests.cs | 4 +- .../Physics/CollisionPredictionTest.cs | 6 +- .../ScriptGlobalsShared.cs | 21 +- Robust.Shared.Tests/IoC/IoCManager_Test.cs | 26 +- Robust.Shared/Asynchronous/TaskManager.cs | 4 +- Robust.Shared/Audio/AudioDebugCommands.cs | 4 +- .../Audio/Systems/SharedAudioSystem.cs | 14 +- .../ComponentTrees/ComponentTreeSystem.cs | 10 +- .../ComponentTrees/RecursiveMoveSystem.cs | 4 +- .../Configuration/ConfigurationCommands.cs | 20 +- .../Configuration/ConfigurationManager.cs | 4 +- .../Configuration/NetConfigurationManager.cs | 6 +- .../Console/Commands/ConfigurationCommands.cs | 4 +- .../Commands/DumpDependencyInjectors.cs | 4 +- .../Commands/DumpEventTablesCommand.cs | 6 +- .../Commands/DumpNetComponentsCommand.cs | 4 +- .../Commands/DumpSerializerTypeMapCommand.cs | 4 +- .../Commands/DumpStringTableCommand.cs | 4 +- Robust.Shared/Console/Commands/ExecCommand.cs | 4 +- Robust.Shared/Console/Commands/LogCommands.cs | 8 +- Robust.Shared/Console/Commands/MapCommands.cs | 24 +- .../Commands/SerializerStatsCommand.cs | 4 +- .../Console/Commands/SpawnCommand.cs | 4 +- .../Console/Commands/TeleportCommands.cs | 30 +-- Robust.Shared/Console/Commands/VfsCommands.cs | 4 +- Robust.Shared/Console/ConsoleHost.cs | 14 +- Robust.Shared/Console/EntityConsoleHost.cs | 8 +- Robust.Shared/Console/LocalizedCommands.cs | 8 +- .../Containers/SharedContainerSystem.cs | 14 +- Robust.Shared/ContentPack/BaseModLoader.cs | 8 +- Robust.Shared/ContentPack/ModLoader.cs | 4 +- Robust.Shared/ContentPack/ResourceManager.cs | 4 +- .../EntitySerialization/EntityDeserializer.cs | 18 +- .../EntitySerialization/EntitySerializer.cs | 18 +- .../Systems/MapLoaderSystem.cs | 8 +- Robust.Shared/Exceptions/RuntimeLog.cs | 4 +- .../Transform/TransformComponent.cs | 4 +- .../UserInterface/BoundUserInterface.cs | 6 +- .../GameObjects/EntityManager.Components.cs | 2 +- Robust.Shared/GameObjects/EntityManager.cs | 20 +- Robust.Shared/GameObjects/EntitySystem.cs | 10 +- .../GameObjects/EntitySystemManager.cs | 14 +- .../EntitySystemUpdateOrderCommand.cs | 4 +- .../Systems/CollideOnAnchorSystem.cs | 2 +- .../Systems/CollisionWakeSystem.cs | 4 +- .../GameObjects/Systems/EntityLookupSystem.cs | 18 +- .../GameObjects/Systems/MetaDataSystem.cs | 6 +- .../Systems/PrototypeReloadSystem.cs | 6 +- .../Systems/SharedAppearanceSystem.cs | 4 +- .../GameObjects/Systems/SharedEyeSystem.cs | 6 +- .../Systems/SharedGridFixtureSystem.cs | 8 +- .../Systems/SharedGridTraversalSystem.cs | 8 +- .../GameObjects/Systems/SharedMapSystem.cs | 18 +- .../Systems/SharedTransformSystem.cs | 18 +- .../Systems/SharedUserInterfaceSystem.cs | 18 +- Robust.Shared/IoC/DynamicTypeFactory.cs | 6 +- .../Localization/LocalizationManager.cs | 10 +- .../Map/Commands/AmbientLightCommand.cs | 4 +- Robust.Shared/Map/MapManager.cs | 10 +- Robust.Shared/Network/IHWId.cs | 4 +- Robust.Shared/Network/NetManager.cs | 18 +- .../Network/Transfer/TransferTest.cs | 4 +- .../Physics/Controllers/VirtualController.cs | 6 +- .../Physics/Systems/FixtureSystem.cs | 8 +- .../Physics/Systems/FixturesChangeSystem.cs | 6 +- .../Physics/Systems/RayCastSystem.cs | 4 +- .../Physics/Systems/SharedBroadphaseSystem.cs | 18 +- .../Physics/Systems/SharedJointSystem.cs | 8 +- .../Systems/SharedPhysicsSystem.Fixtures.cs | 2 +- .../Systems/SharedPhysicsSystem.Queries.cs | 4 +- .../Systems/SharedPhysicsSystem.Velocities.cs | 2 +- .../Physics/Systems/SharedPhysicsSystem.cs | 20 +- Robust.Shared/Player/ActorSystem.cs | 4 +- Robust.Shared/Player/SharedPlayerManager.cs | 10 +- Robust.Shared/Profiling/ProfManager.cs | 6 +- Robust.Shared/Prototypes/PrototypeManager.cs | 18 +- Robust.Shared/Reflection/ReflectionManager.cs | 4 +- .../Replays/ReplayRecordingCommands.cs | 14 +- .../Replays/SharedReplayRecordingManager.cs | 14 +- Robust.Shared/Sandboxing/SandboxHelper.cs | 4 +- .../Manager/SerializationManager.cs | 8 +- .../RobustMappedStringSerializer.cs | 2 +- .../Serialization/RobustSerializer.cs | 6 +- .../Spawners/SharedTimedDespawnSystem.cs | 4 +- Robust.Shared/Threading/ParallelManager.cs | 6 +- Robust.Shared/Timing/TimerManager.cs | 4 +- .../Commands/Entities/NearbyCommand.cs | 4 +- .../Toolshed/Commands/Entities/WithCommand.cs | 4 +- .../Commands/GameTiming/CurTickCommand.cs | 4 +- .../Commands/GameTiming/CurTimeCommand.cs | 4 +- .../Commands/GameTiming/RealTimeCommand.cs | 4 +- .../Commands/GameTiming/ServerTimeCommand.cs | 4 +- .../Toolshed/Commands/Generic/PickCommand.cs | 4 +- .../Commands/Generic/SelectCommand.cs | 4 +- .../Toolshed/Commands/Math/RngCommand.cs | 4 +- .../Commands/Misc/BuildInfoCommand.cs | 4 +- .../Toolshed/Commands/Vfs/VfsCommand.cs | 4 +- .../Invocation/OldShellInvocationContext.cs | 7 +- .../Toolshed/ToolshedCommand.Entities.cs | 4 +- Robust.Shared/Toolshed/ToolshedCommand.cs | 4 +- Robust.Shared/Toolshed/ToolshedEnvironment.cs | 10 +- Robust.Shared/Toolshed/ToolshedManager.cs | 14 +- .../TypeParsers/ComponentTypeParser.cs | 4 +- .../Toolshed/TypeParsers/EntityTypeParser.cs | 20 +- .../TypeParsers/PrototypeTypeParser.cs | 12 +- .../TypeParsers/ReflectionTypeParser.cs | 4 +- .../Toolshed/TypeParsers/SessionTypeParser.cs | 2 +- .../Toolshed/TypeParsers/TypeParser.cs | 8 +- .../Toolshed/TypeParsers/TypeTypeParser.cs | 4 +- .../Upload/SharedNetworkResourceManager.cs | 14 +- .../Upload/SharedPrototypeLoadManager.cs | 10 +- .../Commands/ViewVariablesBaseCommand.cs | 6 +- .../ViewVariables/ViewVariablesManager.cs | 14 +- .../IntegrationMappedStringSerializer.cs | 4 +- .../RobustIntegrationTest.NetManager.cs | 8 +- 310 files changed, 1741 insertions(+), 1730 deletions(-) diff --git a/Robust.Client.WebView/Cef/WebViewManagerCef.BrowserWindow.cs b/Robust.Client.WebView/Cef/WebViewManagerCef.BrowserWindow.cs index 56359efa60..4785d8f77c 100644 --- a/Robust.Client.WebView/Cef/WebViewManagerCef.BrowserWindow.cs +++ b/Robust.Client.WebView/Cef/WebViewManagerCef.BrowserWindow.cs @@ -10,7 +10,7 @@ namespace Robust.Client.WebView.Cef { internal partial class WebViewManagerCef { - [Dependency] private readonly IClydeInternal _clyde = default!; + [Dependency] private IClydeInternal _clyde = default!; private readonly List _browserWindows = new(); diff --git a/Robust.Client.WebView/Cef/WebViewManagerCef.Control.cs b/Robust.Client.WebView/Cef/WebViewManagerCef.Control.cs index 88ab3afa29..9af640113a 100644 --- a/Robust.Client.WebView/Cef/WebViewManagerCef.Control.cs +++ b/Robust.Client.WebView/Cef/WebViewManagerCef.Control.cs @@ -132,8 +132,8 @@ namespace Robust.Client.WebView.Cef [Key.Pause] = VKEY_PAUSE, }; - [Dependency] private readonly IClyde _clyde = default!; - [Dependency] private readonly IInputManager _inputMgr = default!; + [Dependency] private IClyde _clyde = default!; + [Dependency] private IInputManager _inputMgr = default!; private readonly WebViewManagerCef _manager; public readonly WebViewControl Owner; diff --git a/Robust.Client.WebView/Cef/WebViewManagerCef.cs b/Robust.Client.WebView/Cef/WebViewManagerCef.cs index 8dd437fbf5..774a0625fd 100644 --- a/Robust.Client.WebView/Cef/WebViewManagerCef.cs +++ b/Robust.Client.WebView/Cef/WebViewManagerCef.cs @@ -24,14 +24,14 @@ namespace Robust.Client.WebView.Cef private CefApp _app = default!; - [Dependency] private readonly IDependencyCollection _dependencyCollection = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IGameControllerInternal _gameController = default!; - [Dependency] private readonly IResourceManagerInternal _resourceManager = default!; - [Dependency] private readonly IClientConsoleHost _consoleHost = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ILocalizationManager _localization = default!; + [Dependency] private IDependencyCollection _dependencyCollection = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; + [Dependency] private IGameControllerInternal _gameController = default!; + [Dependency] private IResourceManagerInternal _resourceManager = default!; + [Dependency] private IClientConsoleHost _consoleHost = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private ILocalizationManager _localization = default!; private ISawmill _sawmill = default!; diff --git a/Robust.Client.WebView/WebViewControl.cs b/Robust.Client.WebView/WebViewControl.cs index c232c87b28..c8dfccd9fc 100644 --- a/Robust.Client.WebView/WebViewControl.cs +++ b/Robust.Client.WebView/WebViewControl.cs @@ -9,9 +9,9 @@ namespace Robust.Client.WebView /// /// An UI control that presents web content. /// - public sealed class WebViewControl : Control, IWebViewControl, IRawInputControl + public sealed partial class WebViewControl : Control, IWebViewControl, IRawInputControl { - [Dependency] private readonly IWebViewManagerInternal _webViewManager = default!; + [Dependency] private IWebViewManagerInternal _webViewManager = default!; private readonly IWebViewControlImpl _controlImpl; private bool _alwaysActive; diff --git a/Robust.Client/Audio/AudioManager.cs b/Robust.Client/Audio/AudioManager.cs index 3b5649e308..63fc5fdc0d 100644 --- a/Robust.Client/Audio/AudioManager.cs +++ b/Robust.Client/Audio/AudioManager.cs @@ -15,10 +15,10 @@ namespace Robust.Client.Audio; internal sealed partial class AudioManager : IAudioInternal { - [Shared.IoC.Dependency] private readonly IConfigurationManager _cfg = default!; - [Shared.IoC.Dependency] private readonly ILogManager _logMan = default!; - [Shared.IoC.Dependency] private readonly IReloadManager _reload = default!; - [Shared.IoC.Dependency] private readonly IResourceCache _cache = default!; + [Shared.IoC.Dependency] private IConfigurationManager _cfg = default!; + [Shared.IoC.Dependency] private ILogManager _logMan = default!; + [Shared.IoC.Dependency] private IReloadManager _reload = default!; + [Shared.IoC.Dependency] private IResourceCache _cache = default!; private Thread? _gameThread; diff --git a/Robust.Client/Audio/AudioSystem.cs b/Robust.Client/Audio/AudioSystem.cs index d9f29054df..e7944446cf 100644 --- a/Robust.Client/Audio/AudioSystem.cs +++ b/Robust.Client/Audio/AudioSystem.cs @@ -33,16 +33,16 @@ public sealed partial class AudioSystem : SharedAudioSystem * but exposing the whole thing in an easy way is a lot of effort. */ - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IReplayRecordingManager _replayRecording = default!; - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IParallelManager _parMan = default!; - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; - [Dependency] private readonly IAudioInternal _audio = default!; - [Dependency] private readonly SharedMapSystem _maps = default!; - [Dependency] private readonly SharedTransformSystem _xformSys = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IReplayRecordingManager _replayRecording = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IParallelManager _parMan = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; + [Dependency] private IAudioInternal _audio = default!; + [Dependency] private SharedMapSystem _maps = default!; + [Dependency] private SharedTransformSystem _xformSys = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; /// /// An optional method that, if provided, will override the behavior of . diff --git a/Robust.Client/Audio/Midi/Commands/MidiPanicCommand.cs b/Robust.Client/Audio/Midi/Commands/MidiPanicCommand.cs index 0c31e84484..1f8a65743c 100644 --- a/Robust.Client/Audio/Midi/Commands/MidiPanicCommand.cs +++ b/Robust.Client/Audio/Midi/Commands/MidiPanicCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Localization; namespace Robust.Client.Audio.Midi.Commands; -public sealed class MidiPanicCommand : LocalizedCommands +public sealed partial class MidiPanicCommand : LocalizedCommands { - [Dependency] private readonly IMidiManager _midiManager = default!; + [Dependency] private IMidiManager _midiManager = default!; public override string Command => "midipanic"; diff --git a/Robust.Client/Audio/Midi/MidiManager.cs b/Robust.Client/Audio/Midi/MidiManager.cs index 7002c29775..650f7a52f7 100644 --- a/Robust.Client/Audio/Midi/MidiManager.cs +++ b/Robust.Client/Audio/Midi/MidiManager.cs @@ -31,15 +31,15 @@ internal sealed partial class MidiManager : IMidiManager { public const string SoundfontEnvironmentVariable = "ROBUST_SOUNDFONT_OVERRIDE"; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IResourceManager _resourceManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IConfigurationManager _cfgMan = default!; - [Dependency] private readonly IAudioInternal _audio = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; - [Dependency] private readonly ILogManager _logger = default!; - [Dependency] private readonly IParallelManager _parallel = default!; - [Dependency] private readonly IRuntimeLog _runtime = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IResourceManager _resourceManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IConfigurationManager _cfgMan = default!; + [Dependency] private IAudioInternal _audio = default!; + [Dependency] private ITaskManager _taskManager = default!; + [Dependency] private ILogManager _logger = default!; + [Dependency] private IParallelManager _parallel = default!; + [Dependency] private IRuntimeLog _runtime = default!; private AudioSystem _audioSys = default!; private SharedPhysicsSystem _physics = default!; diff --git a/Robust.Client/Audio/ShowAudioCommand.cs b/Robust.Client/Audio/ShowAudioCommand.cs index ed2a19800a..96fa7dff2b 100644 --- a/Robust.Client/Audio/ShowAudioCommand.cs +++ b/Robust.Client/Audio/ShowAudioCommand.cs @@ -12,12 +12,12 @@ namespace Robust.Client.Commands; /// /// Shows a debug overlay for audio sources. /// -public sealed class ShowAudioCommand : LocalizedCommands +public sealed partial class ShowAudioCommand : LocalizedCommands { - [Dependency] private readonly IResourceCache _client = default!; - [Dependency] private readonly IEntityManager _entManager = default!; - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly IPlayerManager _playerMgr = default!; + [Dependency] private IResourceCache _client = default!; + [Dependency] private IEntityManager _entManager = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] private IPlayerManager _playerMgr = default!; public override string Command => "showaudio"; public override void Execute(IConsoleShell shell, string argStr, string[] args) { diff --git a/Robust.Client/BaseClient.cs b/Robust.Client/BaseClient.cs index 5756c24ceb..428ab9859c 100644 --- a/Robust.Client/BaseClient.cs +++ b/Robust.Client/BaseClient.cs @@ -20,17 +20,17 @@ using Robust.Shared.Utility; namespace Robust.Client { /// - public sealed class BaseClient : IBaseClient, IPostInjectInit + public sealed partial class BaseClient : IBaseClient, IPostInjectInit { - [Dependency] private readonly IClientNetManager _net = default!; - [Dependency] private readonly IPlayerManager _playMan = default!; - [Dependency] private readonly IClientNetConfigurationManager _configManager = default!; - [Dependency] private readonly IClientEntityManager _entityManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IDiscordRichPresence _discord = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IClientGameStateManager _gameStates = default!; - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private IClientNetManager _net = default!; + [Dependency] private IPlayerManager _playMan = default!; + [Dependency] private IClientNetConfigurationManager _configManager = default!; + [Dependency] private IClientEntityManager _entityManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IDiscordRichPresence _discord = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IClientGameStateManager _gameStates = default!; + [Dependency] private ILogManager _logMan = default!; /// public ushort DefaultPort { get; } = 1212; diff --git a/Robust.Client/ComponentTrees/SpriteTreeSystem.cs b/Robust.Client/ComponentTrees/SpriteTreeSystem.cs index e3eb3f50c9..fbdc1fbe84 100644 --- a/Robust.Client/ComponentTrees/SpriteTreeSystem.cs +++ b/Robust.Client/ComponentTrees/SpriteTreeSystem.cs @@ -8,9 +8,9 @@ using Robust.Shared.Physics; namespace Robust.Client.ComponentTrees; -public sealed class SpriteTreeSystem : ComponentTreeSystem +public sealed partial class SpriteTreeSystem : ComponentTreeSystem { - [Dependency] private readonly SpriteSystem _sprite = default!; + [Dependency] private SpriteSystem _sprite = default!; #region Component Tree Overrides protected override bool DoFrameUpdate => true; diff --git a/Robust.Client/Configuration/ClientNetConfigurationManager.cs b/Robust.Client/Configuration/ClientNetConfigurationManager.cs index 8722cb1049..6b6202e852 100644 --- a/Robust.Client/Configuration/ClientNetConfigurationManager.cs +++ b/Robust.Client/Configuration/ClientNetConfigurationManager.cs @@ -10,11 +10,11 @@ using Robust.Shared.Utility; namespace Robust.Client.Configuration; -internal sealed class ClientNetConfigurationManager : NetConfigurationManager, IClientNetConfigurationManager +internal sealed partial class ClientNetConfigurationManager : NetConfigurationManager, IClientNetConfigurationManager { - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IReplayRecordingManager _replay = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IReplayRecordingManager _replay = default!; private bool _receivedInitialNwVars = false; diff --git a/Robust.Client/Console/ClientConsoleHost.cs b/Robust.Client/Console/ClientConsoleHost.cs index 8f14493c69..706d023379 100644 --- a/Robust.Client/Console/ClientConsoleHost.cs +++ b/Robust.Client/Console/ClientConsoleHost.cs @@ -50,11 +50,11 @@ namespace Robust.Client.Console [Virtual] internal partial class ClientConsoleHost : ConsoleHost, IClientConsoleHost, IConsoleHostInternal, IPostInjectInit { - [Dependency] private readonly IClientConGroupController _conGroup = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private IClientConGroupController _conGroup = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IPlayerManager _player = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private ILogManager _logMan = default!; [ViewVariables] private readonly Dictionary _availableServerCommands = new(); diff --git a/Robust.Client/Console/Commands/AddCompCommand.cs b/Robust.Client/Console/Commands/AddCompCommand.cs index b4e6384412..1465cd423a 100644 --- a/Robust.Client/Console/Commands/AddCompCommand.cs +++ b/Robust.Client/Console/Commands/AddCompCommand.cs @@ -6,10 +6,10 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { [UsedImplicitly] - internal sealed class AddCompCommand : LocalizedCommands + internal sealed partial class AddCompCommand : LocalizedCommands { - [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IComponentFactory _componentFactory = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "addcompc"; @@ -32,10 +32,10 @@ namespace Robust.Client.Console.Commands } [UsedImplicitly] - internal sealed class RemoveCompCommand : LocalizedCommands + internal sealed partial class RemoveCompCommand : LocalizedCommands { - [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IComponentFactory _componentFactory = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "rmcompc"; diff --git a/Robust.Client/Console/Commands/ClientSpawnCommand.cs b/Robust.Client/Console/Commands/ClientSpawnCommand.cs index 5ad87205e9..f242d0fd49 100644 --- a/Robust.Client/Console/Commands/ClientSpawnCommand.cs +++ b/Robust.Client/Console/Commands/ClientSpawnCommand.cs @@ -7,10 +7,10 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { [UsedImplicitly] - internal sealed class ClientSpawnCommand : LocalizedCommands + internal sealed partial class ClientSpawnCommand : LocalizedCommands { - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "cspawn"; diff --git a/Robust.Client/Console/Commands/Debug.cs b/Robust.Client/Console/Commands/Debug.cs index 0003306b9b..3d8c0ed0a0 100644 --- a/Robust.Client/Console/Commands/Debug.cs +++ b/Robust.Client/Console/Commands/Debug.cs @@ -34,9 +34,9 @@ using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Robust.Client.Console.Commands { - internal sealed class DumpEntitiesCommand : LocalizedCommands + internal sealed partial class DumpEntitiesCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "dumpentities"; @@ -50,9 +50,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class GetComponentRegistrationCommand : LocalizedCommands + internal sealed partial class GetComponentRegistrationCommand : LocalizedCommands { - [Dependency] private readonly IComponentFactory _componentFactory = default!; + [Dependency] private IComponentFactory _componentFactory = default!; public override string Command => "getcomponentregistration"; @@ -89,9 +89,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ToggleMonitorCommand : LocalizedCommands + internal sealed partial class ToggleMonitorCommand : LocalizedCommands { - [Dependency] private readonly IUserInterfaceManager _uiMgr = default!; + [Dependency] private IUserInterfaceManager _uiMgr = default!; public override string Command => "monitor"; @@ -173,9 +173,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ShowPositionsCommand : LocalizedEntityCommands + internal sealed partial class ShowPositionsCommand : LocalizedEntityCommands { - [Dependency] private readonly DebugDrawingSystem _debugDrawing = default!; + [Dependency] private DebugDrawingSystem _debugDrawing = default!; public override string Command => "showpos"; @@ -185,9 +185,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ShowRotationsCommand : LocalizedEntityCommands + internal sealed partial class ShowRotationsCommand : LocalizedEntityCommands { - [Dependency] private readonly DebugDrawingSystem _debugDrawing = default!; + [Dependency] private DebugDrawingSystem _debugDrawing = default!; public override string Command => "showrot"; @@ -197,9 +197,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ShowVelocitiesCommand : LocalizedEntityCommands + internal sealed partial class ShowVelocitiesCommand : LocalizedEntityCommands { - [Dependency] private readonly DebugDrawingSystem _debugDrawing = default!; + [Dependency] private DebugDrawingSystem _debugDrawing = default!; public override string Command => "showvel"; @@ -209,9 +209,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ShowAngularVelocitiesCommand : LocalizedEntityCommands + internal sealed partial class ShowAngularVelocitiesCommand : LocalizedEntityCommands { - [Dependency] private readonly DebugDrawingSystem _debugDrawing = default!; + [Dependency] private DebugDrawingSystem _debugDrawing = default!; public override string Command => "showangvel"; @@ -222,9 +222,9 @@ namespace Robust.Client.Console.Commands } #if DEBUG - internal sealed class ShowRayCommand : LocalizedCommands + internal sealed partial class ShowRayCommand : LocalizedCommands { - [Dependency] private readonly IEntitySystemManager _entitySystems = default!; + [Dependency] private IEntitySystemManager _entitySystems = default!; public override string Command => "showrays"; @@ -250,9 +250,9 @@ namespace Robust.Client.Console.Commands } #endif - internal sealed class DisconnectCommand : LocalizedCommands + internal sealed partial class DisconnectCommand : LocalizedCommands { - [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private IClientNetManager _netManager = default!; public override string Command => "disconnect"; @@ -262,9 +262,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class EntityInfoCommand : LocalizedCommands + internal sealed partial class EntityInfoCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "entfo"; @@ -313,9 +313,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class SnapGridGetCell : LocalizedEntityCommands + internal sealed partial class SnapGridGetCell : LocalizedEntityCommands { - [Dependency] private readonly SharedMapSystem _map = default!; + [Dependency] private SharedMapSystem _map = default!; public override string Command => "sggcell"; @@ -358,9 +358,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class SetPlayerName : LocalizedCommands + internal sealed partial class SetPlayerName : LocalizedCommands { - [Dependency] private readonly IBaseClient _baseClient = default!; + [Dependency] private IBaseClient _baseClient = default!; public override string Command => "overrideplayername"; @@ -378,10 +378,10 @@ namespace Robust.Client.Console.Commands } } - internal sealed class LoadResource : LocalizedCommands + internal sealed partial class LoadResource : LocalizedCommands { - [Dependency] private readonly IResourceCache _res = default!; - [Dependency] private readonly IReflectionManager _reflection = default!; + [Dependency] private IResourceCache _res = default!; + [Dependency] private IReflectionManager _reflection = default!; public override string Command => "ldrsc"; @@ -415,10 +415,10 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ReloadResource : LocalizedCommands + internal sealed partial class ReloadResource : LocalizedCommands { - [Dependency] private readonly IResourceCache _res = default!; - [Dependency] private readonly IReflectionManager _reflection = default!; + [Dependency] private IResourceCache _res = default!; + [Dependency] private IReflectionManager _reflection = default!; public override string Command => "rldrsc"; @@ -448,9 +448,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class GridTileCount : LocalizedEntityCommands + internal sealed partial class GridTileCount : LocalizedEntityCommands { - [Dependency] private readonly SharedMapSystem _map = default!; + [Dependency] private SharedMapSystem _map = default!; public override string Command => "gridtc"; @@ -480,10 +480,10 @@ namespace Robust.Client.Console.Commands } } - internal sealed class GuiDumpCommand : LocalizedCommands + internal sealed partial class GuiDumpCommand : LocalizedCommands { - [Dependency] private readonly IUserInterfaceManager _ui = default!; - [Dependency] private readonly IResourceManager _resManager = default!; + [Dependency] private IUserInterfaceManager _ui = default!; + [Dependency] private IResourceManager _resManager = default!; public override string Command => "guidump"; @@ -628,9 +628,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class SetClipboardCommand : LocalizedCommands + internal sealed partial class SetClipboardCommand : LocalizedCommands { - [Dependency] private readonly IClipboardManager _clipboard = default!; + [Dependency] private IClipboardManager _clipboard = default!; public override string Command => "setclipboard"; @@ -640,9 +640,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class GetClipboardCommand : LocalizedCommands + internal sealed partial class GetClipboardCommand : LocalizedCommands { - [Dependency] private readonly IClipboardManager _clipboard = default!; + [Dependency] private IClipboardManager _clipboard = default!; public override string Command => "getclipboard"; @@ -652,9 +652,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ToggleLight : LocalizedCommands + internal sealed partial class ToggleLight : LocalizedCommands { - [Dependency] private readonly ILightManager _light = default!; + [Dependency] private ILightManager _light = default!; public override string Command => "togglelight"; @@ -665,9 +665,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ToggleFOV : LocalizedCommands + internal sealed partial class ToggleFOV : LocalizedCommands { - [Dependency] private readonly IEyeManager _eye = default!; + [Dependency] private IEyeManager _eye = default!; public override string Command => "togglefov"; @@ -677,9 +677,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ToggleHardFOV : LocalizedCommands + internal sealed partial class ToggleHardFOV : LocalizedCommands { - [Dependency] private readonly ILightManager _light = default!; + [Dependency] private ILightManager _light = default!; public override string Command => "togglehardfov"; @@ -690,9 +690,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ToggleShadows : LocalizedCommands + internal sealed partial class ToggleShadows : LocalizedCommands { - [Dependency] private readonly ILightManager _light = default!; + [Dependency] private ILightManager _light = default!; public override string Command => "toggleshadows"; @@ -703,9 +703,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ToggleLightBuf : LocalizedCommands + internal sealed partial class ToggleLightBuf : LocalizedCommands { - [Dependency] private readonly ILightManager _light = default!; + [Dependency] private ILightManager _light = default!; public override string Command => "togglelightbuf"; @@ -716,12 +716,12 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ChunkInfoCommand : LocalizedEntityCommands + internal sealed partial class ChunkInfoCommand : LocalizedEntityCommands { - [Dependency] private readonly IMapManager _map = default!; - [Dependency] private readonly IEyeManager _eye = default!; - [Dependency] private readonly IInputManager _input = default!; - [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private IMapManager _map = default!; + [Dependency] private IEyeManager _eye = default!; + [Dependency] private IInputManager _input = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; public override string Command => "chunkinfo"; @@ -743,11 +743,11 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ReloadShadersCommand : LocalizedCommands + internal sealed partial class ReloadShadersCommand : LocalizedCommands { - [Dependency] private readonly IResourceCache _cache = default!; - [Dependency] private readonly IResourceManagerInternal _resManager = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; + [Dependency] private IResourceCache _cache = default!; + [Dependency] private IResourceManagerInternal _resManager = default!; + [Dependency] private ITaskManager _taskManager = default!; public override string Command => "rldshader"; @@ -909,9 +909,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class ClydeDebugLayerCommand : LocalizedCommands + internal sealed partial class ClydeDebugLayerCommand : LocalizedCommands { - [Dependency] private readonly IClydeInternal _clyde = default!; + [Dependency] private IClydeInternal _clyde = default!; public override string Command => "cldbglyr"; @@ -932,9 +932,9 @@ namespace Robust.Client.Console.Commands } } - internal sealed class GetKeyInfoCommand : LocalizedCommands + internal sealed partial class GetKeyInfoCommand : LocalizedCommands { - [Dependency] private readonly IClydeInternal _clyde = default!; + [Dependency] private IClydeInternal _clyde = default!; public override string Command => "keyinfo"; diff --git a/Robust.Client/Console/Commands/DebugAnchoredCommand.cs b/Robust.Client/Console/Commands/DebugAnchoredCommand.cs index 89be6a444d..536a179f9a 100644 --- a/Robust.Client/Console/Commands/DebugAnchoredCommand.cs +++ b/Robust.Client/Console/Commands/DebugAnchoredCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { - public sealed class DebugAnchoredCommand : LocalizedEntityCommands + public sealed partial class DebugAnchoredCommand : LocalizedEntityCommands { - [Dependency] private readonly DebugAnchoringSystem _system = default!; + [Dependency] private DebugAnchoringSystem _system = default!; public override string Command => "showanchored"; diff --git a/Robust.Client/Console/Commands/GridChunkBBCommand.cs b/Robust.Client/Console/Commands/GridChunkBBCommand.cs index bd0d8774bc..40cb16f920 100644 --- a/Robust.Client/Console/Commands/GridChunkBBCommand.cs +++ b/Robust.Client/Console/Commands/GridChunkBBCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { - public sealed class GridChunkBBCommand : LocalizedEntityCommands + public sealed partial class GridChunkBBCommand : LocalizedEntityCommands { - [Dependency] private readonly GridChunkBoundsDebugSystem _system = default!; + [Dependency] private GridChunkBoundsDebugSystem _system = default!; public override string Command => "showchunkbb"; diff --git a/Robust.Client/Console/Commands/LauncherAuthCommand.cs b/Robust.Client/Console/Commands/LauncherAuthCommand.cs index 02378258ae..02c462d1a5 100644 --- a/Robust.Client/Console/Commands/LauncherAuthCommand.cs +++ b/Robust.Client/Console/Commands/LauncherAuthCommand.cs @@ -12,10 +12,10 @@ using Robust.Shared.Network; namespace Robust.Client.Console.Commands { - internal sealed class LauncherAuthCommand : LocalizedCommands + internal sealed partial class LauncherAuthCommand : LocalizedCommands { - [Dependency] private readonly IAuthManager _auth = default!; - [Dependency] private readonly IGameControllerInternal _gameController = default!; + [Dependency] private IAuthManager _auth = default!; + [Dependency] private IGameControllerInternal _gameController = default!; public override string Command => "launchauth"; diff --git a/Robust.Client/Console/Commands/LightBBCommand.cs b/Robust.Client/Console/Commands/LightBBCommand.cs index 915a3bba75..e6927633ba 100644 --- a/Robust.Client/Console/Commands/LightBBCommand.cs +++ b/Robust.Client/Console/Commands/LightBBCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { - internal sealed class LightDebugCommand : LocalizedEntityCommands + internal sealed partial class LightDebugCommand : LocalizedEntityCommands { - [Dependency] private readonly DebugLightTreeSystem _system = default!; + [Dependency] private DebugLightTreeSystem _system = default!; public override string Command => "lightbb"; diff --git a/Robust.Client/Console/Commands/MonitorCommands.cs b/Robust.Client/Console/Commands/MonitorCommands.cs index 79c75d926a..081fbfd73f 100644 --- a/Robust.Client/Console/Commands/MonitorCommands.cs +++ b/Robust.Client/Console/Commands/MonitorCommands.cs @@ -7,9 +7,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { [UsedImplicitly] - public sealed class LsMonitorCommand : LocalizedCommands + public sealed partial class LsMonitorCommand : LocalizedCommands { - [Dependency] private readonly IClyde _clyde = default!; + [Dependency] private IClyde _clyde = default!; public override string Command => "lsmonitor"; @@ -24,9 +24,9 @@ namespace Robust.Client.Console.Commands } [UsedImplicitly] - public sealed class MonitorInfoCommand : LocalizedCommands + public sealed partial class MonitorInfoCommand : LocalizedCommands { - [Dependency] private readonly IClyde _clyde = default!; + [Dependency] private IClyde _clyde = default!; public override string Command => "monitorinfo"; @@ -51,9 +51,9 @@ namespace Robust.Client.Console.Commands } [UsedImplicitly] - public sealed class SetMonitorCommand : LocalizedCommands + public sealed partial class SetMonitorCommand : LocalizedCommands { - [Dependency] private readonly IClyde _clyde = default!; + [Dependency] private IClyde _clyde = default!; public override string Command => "setmonitor"; diff --git a/Robust.Client/Console/Commands/PhysicsOverlayCommands.cs b/Robust.Client/Console/Commands/PhysicsOverlayCommands.cs index 68ce7dd256..ad02eba724 100644 --- a/Robust.Client/Console/Commands/PhysicsOverlayCommands.cs +++ b/Robust.Client/Console/Commands/PhysicsOverlayCommands.cs @@ -6,9 +6,9 @@ using Robust.Shared.Localization; namespace Robust.Client.Console.Commands { - public sealed class PhysicsOverlayCommands : LocalizedCommands + public sealed partial class PhysicsOverlayCommands : LocalizedCommands { - [Dependency] private readonly IEntitySystemManager _entitySystems = default!; + [Dependency] private IEntitySystemManager _entitySystems = default!; public override string Command => "physics"; diff --git a/Robust.Client/Console/Commands/ProfileEntitySpawningCommand.cs b/Robust.Client/Console/Commands/ProfileEntitySpawningCommand.cs index 754c99114c..e166f66698 100644 --- a/Robust.Client/Console/Commands/ProfileEntitySpawningCommand.cs +++ b/Robust.Client/Console/Commands/ProfileEntitySpawningCommand.cs @@ -9,9 +9,9 @@ using Robust.Shared.Timing; namespace Robust.Client.Console.Commands; -public sealed class ProfileEntitySpawningCommand : IConsoleCommand +public sealed partial class ProfileEntitySpawningCommand : IConsoleCommand { - [Dependency] private readonly IEntityManager _entities = default!; + [Dependency] private IEntityManager _entities = default!; public string Command => "profileEntitySpawning"; public string Description => "Profiles entity spawning with n entities"; diff --git a/Robust.Client/Console/Commands/QuitCommand.cs b/Robust.Client/Console/Commands/QuitCommand.cs index 652bf855de..66f05b7225 100644 --- a/Robust.Client/Console/Commands/QuitCommand.cs +++ b/Robust.Client/Console/Commands/QuitCommand.cs @@ -14,9 +14,9 @@ namespace Robust.Client.Console.Commands } } - sealed class QuitCommand : LocalizedCommands + sealed partial class QuitCommand : LocalizedCommands { - [Dependency] private readonly IGameController _gameController = default!; + [Dependency] private IGameController _gameController = default!; public override string Command => "quit"; diff --git a/Robust.Client/Console/Commands/ReloadLocalizationsCommand.cs b/Robust.Client/Console/Commands/ReloadLocalizationsCommand.cs index 8a747f68b5..f5e5df3d5e 100644 --- a/Robust.Client/Console/Commands/ReloadLocalizationsCommand.cs +++ b/Robust.Client/Console/Commands/ReloadLocalizationsCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Localization; namespace Robust.Client.Console.Commands { - internal sealed class ReloadLocalizationsCommand : LocalizedCommands + internal sealed partial class ReloadLocalizationsCommand : LocalizedCommands { - [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private ILocalizationManager _loc = default!; public override string Command => "rldloc"; diff --git a/Robust.Client/Console/Commands/Scripting.cs b/Robust.Client/Console/Commands/Scripting.cs index 6a9c877577..4b81c42fa2 100644 --- a/Robust.Client/Console/Commands/Scripting.cs +++ b/Robust.Client/Console/Commands/Scripting.cs @@ -25,9 +25,9 @@ namespace Robust.Client.Console.Commands } #endif - internal sealed class ServerScriptCommand : LocalizedCommands + internal sealed partial class ServerScriptCommand : LocalizedCommands { - [Dependency] private readonly IScriptClient _scriptClient = default!; + [Dependency] private IScriptClient _scriptClient = default!; public override string Command => "scsi"; diff --git a/Robust.Client/Console/Commands/SendGarbageCommand.cs b/Robust.Client/Console/Commands/SendGarbageCommand.cs index bcf78bf5b0..1909bfb3cf 100644 --- a/Robust.Client/Console/Commands/SendGarbageCommand.cs +++ b/Robust.Client/Console/Commands/SendGarbageCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Network; namespace Robust.Client.Console.Commands { - internal sealed class SendGarbageCommand : LocalizedCommands + internal sealed partial class SendGarbageCommand : LocalizedCommands { - [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private IClientNetManager _netManager = default!; public override string Command => "sendgarbage"; diff --git a/Robust.Client/Console/Commands/SetInputContextCommand.cs b/Robust.Client/Console/Commands/SetInputContextCommand.cs index f6f99471d7..0e84d7b751 100644 --- a/Robust.Client/Console/Commands/SetInputContextCommand.cs +++ b/Robust.Client/Console/Commands/SetInputContextCommand.cs @@ -6,9 +6,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { [UsedImplicitly] - public sealed class SetInputContextCommand : LocalizedCommands + public sealed partial class SetInputContextCommand : LocalizedCommands { - [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private IInputManager _inputManager = default!; public override string Command => "setinputcontext"; diff --git a/Robust.Client/Console/Commands/ShowPlayerVelocityCommand.cs b/Robust.Client/Console/Commands/ShowPlayerVelocityCommand.cs index 29d5772771..4633b92d09 100644 --- a/Robust.Client/Console/Commands/ShowPlayerVelocityCommand.cs +++ b/Robust.Client/Console/Commands/ShowPlayerVelocityCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Console.Commands { - public sealed class ShowPlayerVelocityCommand : LocalizedEntityCommands + public sealed partial class ShowPlayerVelocityCommand : LocalizedEntityCommands { - [Dependency] private readonly ShowPlayerVelocityDebugSystem _system = default!; + [Dependency] private ShowPlayerVelocityDebugSystem _system = default!; public override string Command => "showplayervelocity"; diff --git a/Robust.Client/Console/Commands/ViewportDebugCommands.cs b/Robust.Client/Console/Commands/ViewportDebugCommands.cs index cd9da7eb42..b897808113 100644 --- a/Robust.Client/Console/Commands/ViewportDebugCommands.cs +++ b/Robust.Client/Console/Commands/ViewportDebugCommands.cs @@ -7,9 +7,9 @@ using Robust.Shared.Maths; namespace Robust.Client.Console.Commands; -internal sealed class ViewportClearAllCachedCommand : IConsoleCommand +internal sealed partial class ViewportClearAllCachedCommand : IConsoleCommand { - [Dependency] private readonly IClydeInternal _clyde = default!; + [Dependency] private IClydeInternal _clyde = default!; public string Command => "vp_clear_all_cached"; public string Description => "Fires IClydeViewport.ClearCachedResources on all viewports"; @@ -21,10 +21,10 @@ internal sealed class ViewportClearAllCachedCommand : IConsoleCommand } } -internal sealed class ViewportTestFinalizeCommand : IConsoleCommand +internal sealed partial class ViewportTestFinalizeCommand : IConsoleCommand { - [Dependency] private readonly IClyde _clyde = default!; - [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private IClyde _clyde = default!; + [Dependency] private IEyeManager _eyeManager = default!; public string Command => "vp_test_finalize"; public string Description => "Creates a viewport, renders it once, then leaks it (finalizes it)."; diff --git a/Robust.Client/Console/ScriptClient.cs b/Robust.Client/Console/ScriptClient.cs index 168abfba05..c006771a4b 100644 --- a/Robust.Client/Console/ScriptClient.cs +++ b/Robust.Client/Console/ScriptClient.cs @@ -8,8 +8,8 @@ namespace Robust.Client.Console { public sealed partial class ScriptClient : IScriptClient { - [Dependency] private readonly IClientConGroupController _conGroupController = default!; - [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private IClientConGroupController _conGroupController = default!; + [Dependency] private IClientNetManager _netManager = default!; private readonly Dictionary _activeConsoles = new(); diff --git a/Robust.Client/Console/ScriptConsoleClient.cs b/Robust.Client/Console/ScriptConsoleClient.cs index 93afce1023..cb00db5753 100644 --- a/Robust.Client/Console/ScriptConsoleClient.cs +++ b/Robust.Client/Console/ScriptConsoleClient.cs @@ -23,11 +23,11 @@ using Color = Robust.Shared.Maths.Color; namespace Robust.Client.Console { - internal sealed class ScriptConsoleClient : ScriptConsole + internal sealed partial class ScriptConsoleClient : ScriptConsole { #pragma warning disable 649 - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IDependencyCollection _dependency = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IDependencyCollection _dependency = default!; #pragma warning restore 649 private readonly StringBuilder _inputBuffer = new(); @@ -192,11 +192,12 @@ namespace Robust.Client.Console _autoImportRepeatBuffer = (found.ToArray(), code); } - private sealed class ScriptGlobalsImpl : ScriptGlobals + private sealed partial class ScriptGlobalsImpl : ScriptGlobals { private readonly ScriptConsoleClient _owner; - [field: Dependency] public override IClientViewVariablesManager vvm { get; } = default!; + [Dependency] private IClientViewVariablesManager _vvm = null!; + public override IClientViewVariablesManager vvm => _vvm; public ScriptGlobalsImpl(ScriptConsoleClient owner) : base(owner._dependency) { diff --git a/Robust.Client/Debugging/DebugAnchoringSystem.cs b/Robust.Client/Debugging/DebugAnchoringSystem.cs index 32310ebb78..0446aa7b67 100644 --- a/Robust.Client/Debugging/DebugAnchoringSystem.cs +++ b/Robust.Client/Debugging/DebugAnchoringSystem.cs @@ -13,13 +13,13 @@ using Robust.Shared.Utility; namespace Robust.Client.Debugging { - public sealed class DebugAnchoringSystem : EntitySystem + public sealed partial class DebugAnchoringSystem : EntitySystem { - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IUserInterfaceManager _userInterface = default!; - [Dependency] private readonly MapSystem _mapSystem = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IInputManager _inputManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IUserInterfaceManager _userInterface = default!; + [Dependency] private MapSystem _mapSystem = default!; private Label? _label; diff --git a/Robust.Client/Debugging/DebugDrawingSystem.cs b/Robust.Client/Debugging/DebugDrawingSystem.cs index 3412de4e94..731155ed75 100644 --- a/Robust.Client/Debugging/DebugDrawingSystem.cs +++ b/Robust.Client/Debugging/DebugDrawingSystem.cs @@ -11,11 +11,11 @@ namespace Robust.Client.Debugging; /// /// A collection of visual debug overlays for the client game. /// -public sealed class DebugDrawingSystem : EntitySystem +public sealed partial class DebugDrawingSystem : EntitySystem { - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] private EntityLookupSystem _lookup = default!; + [Dependency] private SharedTransformSystem _transform = default!; private bool _debugPositions; private bool _debugRotations; @@ -133,7 +133,7 @@ public sealed class DebugDrawingSystem : EntitySystem { const float stubLength = 0.25f; - var worldHandle = (DrawingHandleWorld) args.DrawingHandle; + var worldHandle = (DrawingHandleWorld)args.DrawingHandle; foreach (var uid in _lookup.GetEntitiesIntersecting(args.MapId, args.WorldBounds)) { @@ -155,7 +155,7 @@ public sealed class DebugDrawingSystem : EntitySystem protected internal override void Draw(in OverlayDrawArgs args) { const float stubLength = 0.25f; - var worldHandle = (DrawingHandleWorld) args.DrawingHandle; + var worldHandle = (DrawingHandleWorld)args.DrawingHandle; foreach (var uid in _lookup.GetEntitiesIntersecting(args.MapId, args.WorldBounds)) { @@ -176,12 +176,12 @@ public sealed class DebugDrawingSystem : EntitySystem { const float multiplier = 0.2f; - var worldHandle = (DrawingHandleWorld) args.DrawingHandle; + var worldHandle = (DrawingHandleWorld)args.DrawingHandle; var physicsQuery = _entityManager.GetEntityQuery(); foreach (var uid in _lookup.GetEntitiesIntersecting(args.MapId, args.WorldBounds)) { - if(!physicsQuery.TryGetComponent(uid, out var physicsComp)) + if (!physicsQuery.TryGetComponent(uid, out var physicsComp)) continue; var center = _transform.GetWorldPosition(uid); @@ -201,12 +201,12 @@ public sealed class DebugDrawingSystem : EntitySystem { const float multiplier = (float)(0.2 / (2 * System.Math.PI)); - var worldHandle = (DrawingHandleWorld) args.DrawingHandle; + var worldHandle = (DrawingHandleWorld)args.DrawingHandle; var physicsQuery = _entityManager.GetEntityQuery(); foreach (var uid in _lookup.GetEntitiesIntersecting(args.MapId, args.WorldBounds)) { - if(!physicsQuery.TryGetComponent(uid, out var physicsComp)) + if (!physicsQuery.TryGetComponent(uid, out var physicsComp)) continue; var center = _transform.GetWorldPosition(uid); diff --git a/Robust.Client/Debugging/DebugPhysicsSystem.cs b/Robust.Client/Debugging/DebugPhysicsSystem.cs index fcf92b95e9..d34944a415 100644 --- a/Robust.Client/Debugging/DebugPhysicsSystem.cs +++ b/Robust.Client/Debugging/DebugPhysicsSystem.cs @@ -69,7 +69,7 @@ using Robust.Shared.Physics.Systems; namespace Robust.Client.Debugging { - public sealed class DebugPhysicsSystem : SharedDebugPhysicsSystem + public sealed partial class DebugPhysicsSystem : SharedDebugPhysicsSystem { /* * Used for debugging shapes, controllers, joints, contacts @@ -78,15 +78,15 @@ namespace Robust.Client.Debugging private const int MaxContactPoints = 2048; internal int PointCount; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly EntityLookupSystem _entityLookup = default!; - [Dependency] private readonly TransformSystem _transform = default!; - [Dependency] private readonly IOverlayManager _overlay = default!; - [Dependency] private readonly IEyeManager _eye = default!; - [Dependency] private readonly IInputManager _input = default!; - [Dependency] private readonly IMapManager _map = default!; - [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; + [Dependency] private EntityLookupSystem _entityLookup = default!; + [Dependency] private TransformSystem _transform = default!; + [Dependency] private IOverlayManager _overlay = default!; + [Dependency] private IEyeManager _eye = default!; + [Dependency] private IInputManager _input = default!; + [Dependency] private IMapManager _map = default!; + [Dependency] private IPlayerManager _player = default!; + [Dependency] private IResourceCache _resourceCache = default!; internal ContactPoint[] Points = new ContactPoint[MaxContactPoints]; diff --git a/Robust.Client/Debugging/DebugRayDrawingSystem.cs b/Robust.Client/Debugging/DebugRayDrawingSystem.cs index 8bc5377296..15c6065b70 100644 --- a/Robust.Client/Debugging/DebugRayDrawingSystem.cs +++ b/Robust.Client/Debugging/DebugRayDrawingSystem.cs @@ -12,11 +12,11 @@ using Robust.Shared.Timing; namespace Robust.Client.Debugging { - internal sealed class DebugRayDrawingSystem : SharedDebugRayDrawingSystem + internal sealed partial class DebugRayDrawingSystem : SharedDebugRayDrawingSystem { #if DEBUG - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly IGameTiming _gameTimer = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] private IGameTiming _gameTimer = default!; private readonly List _raysWithLifeTime = new(); private bool _debugDrawRays; diff --git a/Robust.Client/Debugging/OverlayCommand.cs b/Robust.Client/Debugging/OverlayCommand.cs index 1864fca6ef..46f0822bfb 100644 --- a/Robust.Client/Debugging/OverlayCommand.cs +++ b/Robust.Client/Debugging/OverlayCommand.cs @@ -8,13 +8,13 @@ using Robust.Shared.Utility; namespace Robust.Client.Debugging; [ToolshedCommand] -internal sealed class OverlayCommand : ToolshedCommand +internal sealed partial class OverlayCommand : ToolshedCommand { - [Dependency] private readonly IOverlayManager _overlay = default!; - [Dependency] private readonly IDynamicTypeFactoryInternal _factory = default!; + [Dependency] private IOverlayManager _overlay = default!; + [Dependency] private IDynamicTypeFactoryInternal _factory = default!; [CommandImplementation("toggle")] - internal void Toggle([CommandArgument(customParser:typeof(ReflectionTypeParser))] Type overlay) + internal void Toggle([CommandArgument(customParser: typeof(ReflectionTypeParser))] Type overlay) { if (!overlay.IsSubclassOf(typeof(Overlay))) throw new ArgumentException("Type must be a subclass of overlay"); @@ -38,7 +38,7 @@ internal sealed class OverlayCommand : ToolshedCommand return; // TODO OVERLAYS Give overlays the ContentAccessAllowedAttribute? - var instance = (Overlay) _factory.CreateInstanceUnchecked(overlay, oneOff: true); + var instance = (Overlay)_factory.CreateInstanceUnchecked(overlay, oneOff: true); if (instance is IPostInjectInit init) init.PostInject(); diff --git a/Robust.Client/Debugging/Overlays/TileDebugOverlay.cs b/Robust.Client/Debugging/Overlays/TileDebugOverlay.cs index b7d6a1edff..74779c8ecc 100644 --- a/Robust.Client/Debugging/Overlays/TileDebugOverlay.cs +++ b/Robust.Client/Debugging/Overlays/TileDebugOverlay.cs @@ -21,14 +21,14 @@ namespace Robust.Client.Debugging.Overlays; /// This is an abstract helper class that can be used to create simple debug overlays that need to render tile based data. /// [UsedImplicitly] -public abstract class TileDebugOverlay : Overlay, IPostInjectInit +public abstract partial class TileDebugOverlay : Overlay, IPostInjectInit { - [Dependency] protected readonly IEntityManager Entity = default!; - [Dependency] protected readonly IEyeManager Eye = default!; - [Dependency] protected readonly IMapManager MapMan = default!; - [Dependency] protected readonly IInputManager Input = default!; - [Dependency] protected readonly IUserInterfaceManager Ui = default!; - [Dependency] protected readonly IResourceCache Cache = default!; + [Dependency] protected IEntityManager Entity = default!; + [Dependency] protected IEyeManager Eye = default!; + [Dependency] protected IMapManager MapMan = default!; + [Dependency] protected IInputManager Input = default!; + [Dependency] protected IUserInterfaceManager Ui = default!; + [Dependency] protected IResourceCache Cache = default!; protected SharedTransformSystem Transform = default!; protected MapSystem Map = default!; diff --git a/Robust.Client/GameController/GameController.Standalone.cs b/Robust.Client/GameController/GameController.Standalone.cs index e899f8c7ab..de20f0e753 100644 --- a/Robust.Client/GameController/GameController.Standalone.cs +++ b/Robust.Client/GameController/GameController.Standalone.cs @@ -17,8 +17,8 @@ namespace Robust.Client private IGameLoop? _mainLoop; private bool _dontStart; - [Dependency] private readonly IClientGameTiming _gameTiming = default!; - [Dependency] private readonly IDependencyCollection _dependencyCollection = default!; + [Dependency] private IClientGameTiming _gameTiming = default!; + [Dependency] private IDependencyCollection _dependencyCollection = default!; private static bool _hasStarted; diff --git a/Robust.Client/GameController/GameController.cs b/Robust.Client/GameController/GameController.cs index 14f5770d13..1071ea0df4 100644 --- a/Robust.Client/GameController/GameController.cs +++ b/Robust.Client/GameController/GameController.cs @@ -53,55 +53,55 @@ namespace Robust.Client { internal sealed partial class GameController : IGameControllerInternal { - [Dependency] private readonly INetConfigurationManagerInternal _configurationManager = default!; - [Dependency] private readonly IResourceCacheInternal _resourceCache = default!; - [Dependency] private readonly IResourceManagerInternal _resManager = default!; - [Dependency] private readonly IRobustSerializer _serializer = default!; - [Dependency] private readonly IXamlProxyManager _xamlProxyManager = default!; - [Dependency] private readonly IXamlHotReloadManager _xamlHotReloadManager = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IClientNetManager _networkManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IStateManager _stateManager = default!; - [Dependency] private readonly IUserInterfaceManagerInternal _userInterfaceManager = default!; - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly IClientConsoleHost _console = default!; - [Dependency] private readonly ITimerManager _timerManager = default!; - [Dependency] private readonly IClientEntityManager _entityManager = default!; - [Dependency] private readonly IPlacementManager _placementManager = default!; - [Dependency] private readonly IClientGameStateManager _gameStateManager = default!; - [Dependency] private readonly IOverlayManagerInternal _overlayManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; - [Dependency] private readonly IClientViewVariablesManagerInternal _viewVariablesManager = default!; - [Dependency] private readonly IDiscordRichPresence _discord = default!; - [Dependency] private readonly IClydeInternal _clyde = default!; - [Dependency] private readonly IAudioInternal _audio = default!; - [Dependency] private readonly IFontManagerInternal _fontManager = default!; - [Dependency] private readonly IModLoaderInternal _modLoader = default!; - [Dependency] private readonly IScriptClient _scriptClient = default!; - [Dependency] private readonly IRobustMappedStringSerializer _stringSerializer = default!; - [Dependency] private readonly IAuthManager _authManager = default!; - [Dependency] private readonly IMidiManager _midiManager = default!; - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IParallelManagerInternal _parallelMgr = default!; - [Dependency] private readonly ProfManager _prof = default!; - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; - [Dependency] private readonly ISerializationManager _serializationManager = default!; - [Dependency] private readonly MarkupTagManager _tagManager = default!; - [Dependency] private readonly IGamePrototypeLoadManager _protoLoadMan = default!; - [Dependency] private readonly NetworkResourceManager _netResMan = default!; - [Dependency] private readonly IReplayLoadManager _replayLoader = default!; - [Dependency] private readonly IReplayPlaybackManager _replayPlayback = default!; - [Dependency] private readonly IReplayRecordingManagerInternal _replayRecording = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IReloadManager _reload = default!; - [Dependency] private readonly ILocalizationManager _loc = default!; - [Dependency] private readonly ISystemFontManagerInternal _systemFontManager = default!; - [Dependency] private readonly LoadingScreenManager _loadscr = default!; - [Dependency] private readonly ITransferManager _transfer = default!; - [Dependency] private readonly ClientTransferTestManager _transferTest = default!; + [Dependency] private INetConfigurationManagerInternal _configurationManager = default!; + [Dependency] private IResourceCacheInternal _resourceCache = default!; + [Dependency] private IResourceManagerInternal _resManager = default!; + [Dependency] private IRobustSerializer _serializer = default!; + [Dependency] private IXamlProxyManager _xamlProxyManager = default!; + [Dependency] private IXamlHotReloadManager _xamlHotReloadManager = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; + [Dependency] private IClientNetManager _networkManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IStateManager _stateManager = default!; + [Dependency] private IUserInterfaceManagerInternal _userInterfaceManager = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IInputManager _inputManager = default!; + [Dependency] private IClientConsoleHost _console = default!; + [Dependency] private ITimerManager _timerManager = default!; + [Dependency] private IClientEntityManager _entityManager = default!; + [Dependency] private IPlacementManager _placementManager = default!; + [Dependency] private IClientGameStateManager _gameStateManager = default!; + [Dependency] private IOverlayManagerInternal _overlayManager = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private ITaskManager _taskManager = default!; + [Dependency] private IClientViewVariablesManagerInternal _viewVariablesManager = default!; + [Dependency] private IDiscordRichPresence _discord = default!; + [Dependency] private IClydeInternal _clyde = default!; + [Dependency] private IAudioInternal _audio = default!; + [Dependency] private IFontManagerInternal _fontManager = default!; + [Dependency] private IModLoaderInternal _modLoader = default!; + [Dependency] private IScriptClient _scriptClient = default!; + [Dependency] private IRobustMappedStringSerializer _stringSerializer = default!; + [Dependency] private IAuthManager _authManager = default!; + [Dependency] private IMidiManager _midiManager = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IParallelManagerInternal _parallelMgr = default!; + [Dependency] private ProfManager _prof = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; + [Dependency] private ISerializationManager _serializationManager = default!; + [Dependency] private MarkupTagManager _tagManager = default!; + [Dependency] private IGamePrototypeLoadManager _protoLoadMan = default!; + [Dependency] private NetworkResourceManager _netResMan = default!; + [Dependency] private IReplayLoadManager _replayLoader = default!; + [Dependency] private IReplayPlaybackManager _replayPlayback = default!; + [Dependency] private IReplayRecordingManagerInternal _replayRecording = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IReloadManager _reload = default!; + [Dependency] private ILocalizationManager _loc = default!; + [Dependency] private ISystemFontManagerInternal _systemFontManager = default!; + [Dependency] private LoadingScreenManager _loadscr = default!; + [Dependency] private ITransferManager _transfer = default!; + [Dependency] private ClientTransferTestManager _transferTest = default!; private IWebViewManagerHook? _webViewHook; diff --git a/Robust.Client/GameObjects/ClientEntityManager.cs b/Robust.Client/GameObjects/ClientEntityManager.cs index a86e432a90..ff9c38ba3d 100644 --- a/Robust.Client/GameObjects/ClientEntityManager.cs +++ b/Robust.Client/GameObjects/ClientEntityManager.cs @@ -19,12 +19,12 @@ namespace Robust.Client.GameObjects /// public sealed partial class ClientEntityManager : EntityManager, IClientEntityManagerInternal { - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IClientNetManager _networkManager = default!; - [Dependency] private readonly IClientGameTiming _gameTiming = default!; - [Dependency] private readonly IClientGameStateManager _stateMan = default!; - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IReplayRecordingManager _replayRecording = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IClientNetManager _networkManager = default!; + [Dependency] private IClientGameTiming _gameTiming = default!; + [Dependency] private IClientGameStateManager _stateMan = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IReplayRecordingManager _replayRecording = default!; internal event Action? AfterStartup; internal event Action? AfterShutdown; diff --git a/Robust.Client/GameObjects/Components/Renderable/SpriteBoundsOverlay.cs b/Robust.Client/GameObjects/Components/Renderable/SpriteBoundsOverlay.cs index 4a923f3e3a..0680a5b791 100644 --- a/Robust.Client/GameObjects/Components/Renderable/SpriteBoundsOverlay.cs +++ b/Robust.Client/GameObjects/Components/Renderable/SpriteBoundsOverlay.cs @@ -10,9 +10,9 @@ using Robust.Shared.Utility; namespace Robust.Client.GameObjects { - public sealed class ShowSpriteBBCommand : LocalizedEntityCommands + public sealed partial class ShowSpriteBBCommand : LocalizedEntityCommands { - [Dependency] private readonly SpriteBoundsSystem _system = default!; + [Dependency] private SpriteBoundsSystem _system = default!; public override string Command => "showspritebb"; @@ -22,9 +22,9 @@ namespace Robust.Client.GameObjects } } - public sealed class SpriteBoundsSystem : EntitySystem + public sealed partial class SpriteBoundsSystem : EntitySystem { - [Dependency] private readonly IOverlayManager _overlayManager = default!; + [Dependency] private IOverlayManager _overlayManager = default!; private SpriteBoundsOverlay? _overlay; diff --git a/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs b/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs index d1dbd6587c..5ddd6c623b 100644 --- a/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs +++ b/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs @@ -39,10 +39,10 @@ namespace Robust.Client.GameObjects { public const string LogCategory = "go.comp.sprite"; - [Dependency] private readonly IResourceCache resourceCache = default!; - [Dependency] private readonly IPrototypeManager prototypes = default!; - [Dependency] private readonly EntityManager entities = default!; - [Dependency] private readonly IReflectionManager reflection = default!; + [Dependency] private IResourceCache resourceCache = default!; + [Dependency] private IPrototypeManager prototypes = default!; + [Dependency] private EntityManager entities = default!; + [Dependency] private IReflectionManager reflection = default!; /// /// See . diff --git a/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs b/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs index 33210a59cd..5bb934f2a8 100644 --- a/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs @@ -7,7 +7,7 @@ using Robust.Shared.Utility; namespace Robust.Client.GameObjects { - public sealed class AnimationPlayerSystem : EntitySystem + public sealed partial class AnimationPlayerSystem : EntitySystem { private readonly List> _activeAnimations = new(); @@ -15,7 +15,7 @@ namespace Robust.Client.GameObjects private EntityQuery _metaQuery; #if DEBUG - [Dependency] private readonly IComponentFactory _compFact = default!; + [Dependency] private IComponentFactory _compFact = default!; #endif public override void Initialize() diff --git a/Robust.Client/GameObjects/EntitySystems/AppearanceSystem.cs b/Robust.Client/GameObjects/EntitySystems/AppearanceSystem.cs index f01caec18e..6f658c86d9 100644 --- a/Robust.Client/GameObjects/EntitySystems/AppearanceSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/AppearanceSystem.cs @@ -11,10 +11,10 @@ using Robust.Shared.Serialization.Manager; namespace Robust.Client.GameObjects { [UsedImplicitly] - public sealed class AppearanceSystem : SharedAppearanceSystem + public sealed partial class AppearanceSystem : SharedAppearanceSystem { private readonly Queue<(EntityUid uid, AppearanceComponent)> _queuedUpdates = new(); - [Dependency] private readonly ISerializationManager _serialization = default!; + [Dependency] private ISerializationManager _serialization = default!; public override void Initialize() { diff --git a/Robust.Client/GameObjects/EntitySystems/ClientOccluderSystem.cs b/Robust.Client/GameObjects/EntitySystems/ClientOccluderSystem.cs index f2d1b2b6f1..2be27f9fda 100644 --- a/Robust.Client/GameObjects/EntitySystems/ClientOccluderSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/ClientOccluderSystem.cs @@ -18,10 +18,10 @@ namespace Robust.Client.GameObjects; // Whereas the tree stuff is precise. // Also I just realized this and I cba to refactor this again. [UsedImplicitly] -internal sealed class ClientOccluderSystem : OccluderSystem +internal sealed partial class ClientOccluderSystem : OccluderSystem { private readonly HashSet _dirtyEntities = new(); - [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; /// public override void Initialize() @@ -173,7 +173,7 @@ internal sealed class ClientOccluderSystem : OccluderSystem // TODO: Sub to parent changes instead or something. // DebugTools.Assert(occluder.LastPosition == null - // || occluder.LastPosition.Value.Grid == xform.GridUid && occluder.LastPosition.Value.Tile == tile); + // || occluder.LastPosition.Value.Grid == xform.GridUid && occluder.LastPosition.Value.Tile == tile); occluder.LastPosition = (xform.GridUid.Value, tile); // dir starts at the relative effective south direction; diff --git a/Robust.Client/GameObjects/EntitySystems/ContainerSystem.cs b/Robust.Client/GameObjects/EntitySystems/ContainerSystem.cs index 865fb78570..6b3bb70f21 100644 --- a/Robust.Client/GameObjects/EntitySystems/ContainerSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/ContainerSystem.cs @@ -13,11 +13,11 @@ using static Robust.Shared.Containers.ContainerManagerComponent; namespace Robust.Client.GameObjects { - public sealed class ContainerSystem : SharedContainerSystem + public sealed partial class ContainerSystem : SharedContainerSystem { - [Dependency] private readonly IRobustSerializer _serializer = default!; - [Dependency] private readonly IDynamicTypeFactoryInternal _dynFactory = default!; - [Dependency] private readonly PointLightSystem _lightSys = default!; + [Dependency] private IRobustSerializer _serializer = default!; + [Dependency] private IDynamicTypeFactoryInternal _dynFactory = default!; + [Dependency] private PointLightSystem _lightSys = default!; private EntityQuery _pointLightQuery; private EntityQuery _spriteQuery; @@ -116,7 +116,7 @@ namespace Robust.Client.GameObjects if (!component.Containers.TryGetValue(id, out var container)) { var type = _serializer.FindSerializedType(typeof(BaseContainer), data.ContainerType); - container = _dynFactory.CreateInstanceUnchecked(type!, inject:false); + container = _dynFactory.CreateInstanceUnchecked(type!, inject: false); container.Init(this, id, (uid, component)); component.Containers.Add(id, container); } @@ -241,7 +241,7 @@ namespace Robust.Client.GameObjects if (TryComp(uid, out MetaDataComponent? meta)) { - DebugTools.Assert((meta.Flags & ( MetaDataFlags.Detached | MetaDataFlags.InContainer) ) == MetaDataFlags.Detached, + DebugTools.Assert((meta.Flags & (MetaDataFlags.Detached | MetaDataFlags.InContainer)) == MetaDataFlags.Detached, $"Adding entity {ToPrettyString(uid)} to list of expected entities for container {container.ID} in {ToPrettyString(container.Owner)}, despite it already being in a container."); } #endif diff --git a/Robust.Client/GameObjects/EntitySystems/DebugEntityLookupSystem.cs b/Robust.Client/GameObjects/EntitySystems/DebugEntityLookupSystem.cs index 5fae53eed8..dc7df30a21 100644 --- a/Robust.Client/GameObjects/EntitySystems/DebugEntityLookupSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/DebugEntityLookupSystem.cs @@ -11,9 +11,9 @@ using Color = Robust.Shared.Maths.Color; namespace Robust.Client.GameObjects; -public sealed class DebugEntityLookupCommand : LocalizedEntityCommands +public sealed partial class DebugEntityLookupCommand : LocalizedEntityCommands { - [Dependency] private readonly DebugEntityLookupSystem _system = default!; + [Dependency] private DebugEntityLookupSystem _system = default!; public override string Command => "togglelookup"; diff --git a/Robust.Client/GameObjects/EntitySystems/EyeSystem.cs b/Robust.Client/GameObjects/EntitySystems/EyeSystem.cs index 75679f820e..df4ed21d74 100644 --- a/Robust.Client/GameObjects/EntitySystems/EyeSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/EyeSystem.cs @@ -6,9 +6,9 @@ using Robust.Shared.Player; namespace Robust.Client.GameObjects; -public sealed class EyeSystem : SharedEyeSystem +public sealed partial class EyeSystem : SharedEyeSystem { - [Dependency] private readonly IEyeManager _eyeManager = default!; + [Dependency] private IEyeManager _eyeManager = default!; public override void Initialize() { diff --git a/Robust.Client/GameObjects/EntitySystems/GenericVisualizerSystem.cs b/Robust.Client/GameObjects/EntitySystems/GenericVisualizerSystem.cs index 3e7dbaac51..1f098efc4b 100644 --- a/Robust.Client/GameObjects/EntitySystems/GenericVisualizerSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/GenericVisualizerSystem.cs @@ -8,10 +8,10 @@ namespace Robust.Client.GameObjects; /// /// A generic visualizer system that modifies sprite layer data. /// -public sealed class GenericVisualizerSystem : VisualizerSystem +public sealed partial class GenericVisualizerSystem : VisualizerSystem { - [Dependency] private readonly IReflectionManager _refMan = default!; - [Dependency] private readonly SharedAppearanceSystem _appearanceSys = default!; + [Dependency] private IReflectionManager _refMan = default!; + [Dependency] private SharedAppearanceSystem _appearanceSys = default!; protected override void OnAppearanceChange(EntityUid uid, GenericVisualizerComponent component, ref AppearanceChangeEvent args) { diff --git a/Robust.Client/GameObjects/EntitySystems/GridChunkBoundsDebugSystem.cs b/Robust.Client/GameObjects/EntitySystems/GridChunkBoundsDebugSystem.cs index 15d469ef76..1a60f7bd9e 100644 --- a/Robust.Client/GameObjects/EntitySystems/GridChunkBoundsDebugSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/GridChunkBoundsDebugSystem.cs @@ -13,13 +13,13 @@ using Robust.Shared.Utility; namespace Robust.Client.GameObjects { - public sealed class GridChunkBoundsDebugSystem : EntitySystem + public sealed partial class GridChunkBoundsDebugSystem : EntitySystem { - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly TransformSystem _transform = default!; - [Dependency] private readonly SharedMapSystem _map = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] private TransformSystem _transform = default!; + [Dependency] private SharedMapSystem _map = default!; private GridChunkBoundsOverlay? _overlay; diff --git a/Robust.Client/GameObjects/EntitySystems/InputSystem.cs b/Robust.Client/GameObjects/EntitySystems/InputSystem.cs index 5a50cea270..444c5e013d 100644 --- a/Robust.Client/GameObjects/EntitySystems/InputSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/InputSystem.cs @@ -18,15 +18,15 @@ namespace Robust.Client.GameObjects /// /// Client-side processing of all input commands through the simulation. /// - public sealed class InputSystem : SharedInputSystem, IPostInjectInit + public sealed partial class InputSystem : SharedInputSystem, IPostInjectInit { - [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IClientGameStateManager _stateManager = default!; - [Dependency] private readonly IConsoleHost _conHost = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private IInputManager _inputManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IClientGameStateManager _stateManager = default!; + [Dependency] private IConsoleHost _conHost = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private SharedTransformSystem _transform = default!; private ISawmill _sawmillInputContext = default!; @@ -52,12 +52,12 @@ namespace Robust.Client.GameObjects /// old input that was saved or buffered until further processing could be done public bool HandleInputCommand(ICommonSession? session, BoundKeyFunction function, IFullInputCmdMessage message, bool replay = false) { - #if DEBUG +#if DEBUG var funcId = _inputManager.NetworkBindMap.KeyFunctionID(function); DebugTools.Assert(funcId == message.InputFunctionId, "Function ID in message does not match function."); - #endif +#endif if (!replay) { @@ -223,7 +223,7 @@ namespace Robust.Client.GameObjects private void SetEntityContextActive(IInputManager inputMan, EntityUid entity) { - if(entity == default || !Exists(entity)) + if (entity == default || !Exists(entity)) throw new ArgumentNullException(nameof(entity)); if (!TryComp(entity, out InputComponent? inputComp)) diff --git a/Robust.Client/GameObjects/EntitySystems/MidiSystem.cs b/Robust.Client/GameObjects/EntitySystems/MidiSystem.cs index 7d0d27bff0..cbec80402e 100644 --- a/Robust.Client/GameObjects/EntitySystems/MidiSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/MidiSystem.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Client.GameObjects { - public sealed class MidiSystem : EntitySystem + public sealed partial class MidiSystem : EntitySystem { - [Dependency] private readonly IMidiManager _midiManager = default!; + [Dependency] private IMidiManager _midiManager = default!; public override void Initialize() { diff --git a/Robust.Client/GameObjects/EntitySystems/PointLightSystem.cs b/Robust.Client/GameObjects/EntitySystems/PointLightSystem.cs index 6db848821f..24b9cf0f12 100644 --- a/Robust.Client/GameObjects/EntitySystems/PointLightSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/PointLightSystem.cs @@ -8,10 +8,10 @@ using Robust.Shared.Maths; namespace Robust.Client.GameObjects { - public sealed class PointLightSystem : SharedPointLightSystem + public sealed partial class PointLightSystem : SharedPointLightSystem { - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly LightTreeSystem _lightTree = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private LightTreeSystem _lightTree = default!; public override void Initialize() { diff --git a/Robust.Client/GameObjects/EntitySystems/ShowPlayerVelocityDebugSystem.cs b/Robust.Client/GameObjects/EntitySystems/ShowPlayerVelocityDebugSystem.cs index 7826e69bdb..3d4e5e6de3 100644 --- a/Robust.Client/GameObjects/EntitySystems/ShowPlayerVelocityDebugSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/ShowPlayerVelocityDebugSystem.cs @@ -9,12 +9,12 @@ using Robust.Shared.Physics.Components; namespace Robust.Client.GameObjects; -public sealed class ShowPlayerVelocityDebugSystem : EntitySystem +public sealed partial class ShowPlayerVelocityDebugSystem : EntitySystem { - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly TransformSystem _transform = default!; - [Dependency] private readonly IUserInterfaceManager _uiManager = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private TransformSystem _transform = default!; + [Dependency] private IUserInterfaceManager _uiManager = default!; internal bool Enabled { diff --git a/Robust.Client/GameObjects/EntitySystems/SpriteSystem.cs b/Robust.Client/GameObjects/EntitySystems/SpriteSystem.cs index 33a4e3ae54..0780a670f1 100644 --- a/Robust.Client/GameObjects/EntitySystems/SpriteSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/SpriteSystem.cs @@ -28,18 +28,18 @@ namespace Robust.Client.GameObjects [UsedImplicitly] public sealed partial class SpriteSystem : EntitySystem { - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IEyeManager _eye = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IComponentFactory _factory = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IEyeManager _eye = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IPrototypeManager _proto = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IComponentFactory _factory = default!; // Note that any new system dependencies have to be added to RobustUnitTest.BaseSetup() - [Dependency] private readonly SharedTransformSystem _xforms = default!; - [Dependency] private readonly SpriteTreeSystem _tree = default!; - [Dependency] private readonly AppearanceSystem _appearance = default!; + [Dependency] private SharedTransformSystem _xforms = default!; + [Dependency] private SpriteTreeSystem _tree = default!; + [Dependency] private AppearanceSystem _appearance = default!; public static readonly ProtoId UnshadedId = "unshaded"; private readonly Queue _inertUpdateQueue = new(); diff --git a/Robust.Client/GameObjects/EntitySystems/TransformSystem.cs b/Robust.Client/GameObjects/EntitySystems/TransformSystem.cs index 9f997d74e4..2f227158a4 100644 --- a/Robust.Client/GameObjects/EntitySystems/TransformSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/TransformSystem.cs @@ -24,7 +24,7 @@ namespace Robust.Client.GameObjects private const float MinInterpolationDistance = 0.001f; private const float MinInterpolationDistanceSquared = MinInterpolationDistance * MinInterpolationDistance; - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; // Only keep track of transforms actively lerping. // Much faster than iterating 3000+ transforms every frame. diff --git a/Robust.Client/GameObjects/EntitySystems/VisualizerSystem.cs b/Robust.Client/GameObjects/EntitySystems/VisualizerSystem.cs index 9876c637a3..27d00c3291 100644 --- a/Robust.Client/GameObjects/EntitySystems/VisualizerSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/VisualizerSystem.cs @@ -6,12 +6,12 @@ namespace Robust.Client.GameObjects; /// /// An abstract entity system inheritor for systems that deal with appearance data. /// -public abstract class VisualizerSystem : EntitySystem - where T: Component +public abstract partial class VisualizerSystem : EntitySystem + where T : Component { - [Dependency] protected readonly AppearanceSystem AppearanceSystem = default!; - [Dependency] protected readonly AnimationPlayerSystem AnimationSystem = default!; - [Dependency] protected readonly SpriteSystem SpriteSystem = default!; + [Dependency] protected AppearanceSystem AppearanceSystem = default!; + [Dependency] protected AnimationPlayerSystem AnimationSystem = default!; + [Dependency] protected SpriteSystem SpriteSystem = default!; public override void Initialize() { @@ -20,5 +20,5 @@ public abstract class VisualizerSystem : EntitySystem SubscribeLocalEvent(OnAppearanceChange); } - protected virtual void OnAppearanceChange(EntityUid uid, T component, ref AppearanceChangeEvent args) {} + protected virtual void OnAppearanceChange(EntityUid uid, T component, ref AppearanceChangeEvent args) { } } diff --git a/Robust.Client/GameStates/ClientDirtySystem.cs b/Robust.Client/GameStates/ClientDirtySystem.cs index 586ebb795d..7d4731572c 100644 --- a/Robust.Client/GameStates/ClientDirtySystem.cs +++ b/Robust.Client/GameStates/ClientDirtySystem.cs @@ -10,10 +10,10 @@ namespace Robust.Client.GameStates; /// /// Tracks dirty entities on the client for the purposes of gamestatemanager. /// -public sealed class ClientDirtySystem : EntitySystem +public sealed partial class ClientDirtySystem : EntitySystem { - [Dependency] private readonly IClientGameTiming _timing = default!; - [Dependency] private readonly IComponentFactory _compFact = default!; + [Dependency] private IClientGameTiming _timing = default!; + [Dependency] private IComponentFactory _compFact = default!; // Entities that have removed networked components // could pool the ushort sets, but predicted component changes are rare... soo... diff --git a/Robust.Client/GameStates/ClientGameStateManager.cs b/Robust.Client/GameStates/ClientGameStateManager.cs index 7bee2e8746..d9edd7a1e5 100644 --- a/Robust.Client/GameStates/ClientGameStateManager.cs +++ b/Robust.Client/GameStates/ClientGameStateManager.cs @@ -35,7 +35,7 @@ namespace Robust.Client.GameStates { /// [UsedImplicitly] - public sealed class ClientGameStateManager : IClientGameStateManager + public sealed partial class ClientGameStateManager : IClientGameStateManager { private GameStateProcessor _processor = default!; @@ -77,20 +77,20 @@ namespace Robust.Client.GameStates private uint _metaCompNetId; private uint _xformCompNetId; - [Dependency] private readonly IReplayRecordingManager _replayRecording = default!; - [Dependency] private readonly IComponentFactory _compFactory = default!; - [Dependency] private readonly IPlayerManager _players = default!; - [Dependency] private readonly IClientNetManager _network = default!; - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IClientGameTiming _timing = default!; - [Dependency] private readonly INetConfigurationManager _config = default!; - [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; - [Dependency] private readonly IConsoleHost _conHost = default!; - [Dependency] private readonly ClientEntityManager _entities = default!; - [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly ProfManager _prof = default!; - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private IReplayRecordingManager _replayRecording = default!; + [Dependency] private IComponentFactory _compFactory = default!; + [Dependency] private IPlayerManager _players = default!; + [Dependency] private IClientNetManager _network = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IClientGameTiming _timing = default!; + [Dependency] private INetConfigurationManager _config = default!; + [Dependency] private IEntitySystemManager _entitySystemManager = default!; + [Dependency] private IConsoleHost _conHost = default!; + [Dependency] private ClientEntityManager _entities = default!; + [Dependency] private IInputManager _inputManager = default!; + [Dependency] private ProfManager _prof = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; + [Dependency] private ILogManager _logMan = default!; private ISawmill _sawmill = default!; @@ -176,7 +176,7 @@ namespace Robust.Client.GameStates _conHost.RegisterCommand("resetallents", Loc.GetString("cmd-reset-all-ents-desc"), Loc.GetString("cmd-reset-all-ents-help"), ResetAllEnts); _conHost.RegisterCommand("detachent", Loc.GetString("cmd-detach-ent-desc"), Loc.GetString("cmd-detach-ent-help"), DetachEntCommand); _conHost.RegisterCommand("localdelete", Loc.GetString("cmd-local-delete-desc"), Loc.GetString("cmd-local-delete-help"), LocalDeleteEntCommand); - _conHost.RegisterCommand("fullstatereset", Loc.GetString("cmd-full-state-reset-desc"), Loc.GetString("cmd-full-state-reset-help"), (_,_,_) => RequestFullState()); + _conHost.RegisterCommand("fullstatereset", Loc.GetString("cmd-full-state-reset-desc"), Loc.GetString("cmd-full-state-reset-help"), (_, _, _) => RequestFullState()); _entities.ComponentAdded += OnComponentAdded; @@ -301,7 +301,7 @@ namespace Robust.Client.GameStates { // If we have been waiting for a full state for a long time, re-request a full state. if (_processor.WaitingForFull - && _processor.LastFullStateRequested is {} last + && _processor.LastFullStateRequested is { } last && DateTime.UtcNow - last.Time > FullStateTimeout) { // Re-request a full state. @@ -468,7 +468,7 @@ namespace Robust.Client.GameStates var ping = (_network.ServerChannel?.Ping ?? 0) / 1000f + PredictLagBias; // seconds. var lagTickCount = Math.Ceiling(_timing.TickRate * ping / _timing.TimeScale); - var predictionTarget = _timing.LastProcessedTick + (uint) (_processor.TargetBufferSize + lagTickCount + PredictTickBias); + var predictionTarget = _timing.LastProcessedTick + (uint)(_processor.TargetBufferSize + lagTickCount + PredictTickBias); if (IsPredictionEnabled) { @@ -478,14 +478,14 @@ namespace Robust.Client.GameStates using (_prof.Group("Tick")) { - _entities.TickUpdate((float) _timing.TickPeriod.TotalSeconds, noPredictions: !IsPredictionEnabled, histogram: null); + _entities.TickUpdate((float)_timing.TickPeriod.TotalSeconds, noPredictions: !IsPredictionEnabled, histogram: null); } } public void RequestFullState(NetEntity? missingEntity = null, GameTick? tick = null) { _sawmill.Info("Requesting full server state"); - _network.ClientSendMessage(new MsgStateRequestFull { Tick = _timing.LastRealTick , MissingEntity = missingEntity ?? NetEntity.Invalid }); + _network.ClientSendMessage(new MsgStateRequestFull { Tick = _timing.LastRealTick, MissingEntity = missingEntity ?? NetEntity.Invalid }); _processor.OnFullStateRequested(tick ?? _timing.LastRealTick); } @@ -880,7 +880,7 @@ namespace Robust.Client.GameStates ref var state = ref CollectionsMarshal.GetValueRefOrAddDefault(_toApply, uid.Value, out var exists); state = exists - ? state with {NextState = es} + ? state with { NextState = es } : new(uid.Value, es.NetEntity, meta, false, false, GameTick.Zero, null, es, null); } } @@ -906,7 +906,7 @@ namespace Robust.Client.GameStates ref var state = ref CollectionsMarshal.GetValueRefOrAddDefault(_toApply, uid, out var exists); state = exists - ? state with {PendingReapply = pending} + ? state with { PendingReapply = pending } : new(uid, meta.NetEntity, meta, false, false, GameTick.Zero, null, null, pending); } @@ -1031,7 +1031,7 @@ namespace Robust.Client.GameStates // TODO GAME STATE // store MetaData & Transform information separately. var metaState = - (MetaDataComponentState?) state.ComponentChanges.Value?.FirstOrDefault(c => c.NetID == _metaCompNetId) + (MetaDataComponentState?)state.ComponentChanges.Value?.FirstOrDefault(c => c.NetID == _metaCompNetId) .State; if (metaState == null) @@ -1119,7 +1119,7 @@ namespace Robust.Client.GameStates && data.CurState.ComponentChanges.Value .TryFirstOrNull(c => c.NetID == _xformCompNetId, out var found)) { - var state = (TransformComponentState) found.Value.State!; + var state = (TransformComponentState)found.Value.State!; return _entities.GetEntity(state.ParentID); } @@ -1361,7 +1361,7 @@ namespace Robust.Client.GameStates _compStateWork.Clear(); // First remove any deleted components - if (data.CurState?.NetComponents is {} netComps) + if (data.CurState?.NetComponents is { } netComps) { _toRemove.Clear(); @@ -1439,7 +1439,7 @@ namespace Robust.Client.GameStates // If we have a NetEntity we reference come in then apply their state. DebugTools.Assert(_pendingReapplyNetStates.ContainsKey(data.Uid) == (data.PendingReapply != null)); - if (data.PendingReapply is {} reapplyTypes) + if (data.PendingReapply is { } reapplyTypes) { var lastState = _processor.GetLastServerStates(data.NetEntity); diff --git a/Robust.Client/GameStates/NetEntityOverlay.cs b/Robust.Client/GameStates/NetEntityOverlay.cs index e63c3e33af..31c8315b47 100644 --- a/Robust.Client/GameStates/NetEntityOverlay.cs +++ b/Robust.Client/GameStates/NetEntityOverlay.cs @@ -20,12 +20,12 @@ namespace Robust.Client.GameStates /// A network entity report that lists all entities as they are updated through game states. /// https://developer.valvesoftware.com/wiki/Networking_Entities#cl_entityreport /// - sealed class NetEntityOverlay : Overlay + sealed partial class NetEntityOverlay : Overlay { - [Dependency] private readonly IClientGameTiming _gameTiming = default!; - [Dependency] private readonly IClientNetManager _netManager = default!; - [Dependency] private readonly IClientGameStateManager _gameStateManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IClientGameTiming _gameTiming = default!; + [Dependency] private IClientNetManager _netManager = default!; + [Dependency] private IClientGameStateManager _gameStateManager = default!; + [Dependency] private IEntityManager _entityManager = default!; private const uint TrafficHistorySize = 64; // Size of the traffic history bar in game ticks. private const int _maxEnts = 128; // maximum number of entities to track. @@ -176,7 +176,7 @@ namespace Robust.Client.GameStates private sealed class NetEntData { public GameTick LastUpdate = GameTick.Zero; - public readonly OverflowDictionary Traffic = new((int) TrafficHistorySize); + public readonly OverflowDictionary Traffic = new((int)TrafficHistorySize); public bool Exists = true; public bool InPVS = true; diff --git a/Robust.Client/GameStates/NetGraphOverlay.cs b/Robust.Client/GameStates/NetGraphOverlay.cs index 4622b20180..9af7260146 100644 --- a/Robust.Client/GameStates/NetGraphOverlay.cs +++ b/Robust.Client/GameStates/NetGraphOverlay.cs @@ -20,14 +20,14 @@ namespace Robust.Client.GameStates /// /// Visual debug overlay for the network diagnostic graph. /// - internal sealed class NetGraphOverlay : Overlay + internal sealed partial class NetGraphOverlay : Overlay { - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly IClientNetManager _netManager = default!; - [Dependency] private readonly IClientGameStateManager _gameStateManager = default!; - [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly IConsoleHost _host = default!; - [Dependency] private readonly IEntityManager _entManager = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private IClientNetManager _netManager = default!; + [Dependency] private IClientGameStateManager _gameStateManager = default!; + [Dependency] private IComponentFactory _componentFactory = default!; + [Dependency] private IConsoleHost _host = default!; + [Dependency] private IEntityManager _entManager = default!; private const int HistorySize = 60 * 5; // number of ticks to keep in history. private const int TargetPayloadBps = 56000 / 8; // Target Payload size in Bytes per second. A mind-numbing fifty-six thousand bits per second, who would ever need more? @@ -43,7 +43,7 @@ namespace Robust.Client.GameStates private readonly Font _font; - private readonly List<(GameTick Tick, int Payload, int lag, int Buffer)> _history = new(HistorySize+10); + private readonly List<(GameTick Tick, int Payload, int lag, int Buffer)> _history = new(HistorySize + 10); // sum of all data point sizes in bytes private int _totalHistoryPayload; @@ -74,7 +74,7 @@ namespace Robust.Client.GameStates _history.Add((toSeq, sz, lag, buffer)); // not watching an ent - if(!WatchEntId.IsValid() || _entManager.IsClientSide(WatchEntId)) + if (!WatchEntId.IsValid() || _entManager.IsClientSide(WatchEntId)) return; string? entStateString = null; @@ -175,7 +175,7 @@ namespace Robust.Client.GameStates // the minimum size seems to be about 10 bytes. // 10 bytes = 15 pixel, then doubling every 15 more pixels. bytes = Math.Max(bytes - 10, 1); - return (int) Math.Round((1 + Math.Log2(bytes)) * 15); + return (int)Math.Round((1 + Math.Log2(bytes)) * 15); } protected internal override void Draw(in OverlayDrawArgs args) @@ -209,9 +209,9 @@ namespace Robust.Client.GameStates handle.DrawLine(new Vector2(xOff, height), new Vector2(xOff, yoff), Color.LimeGreen.WithAlpha(0.8f)); // second tick marks - if (state.Tick.Value % (_gameTiming.TickRate/5) == 0) + if (state.Tick.Value % (_gameTiming.TickRate / 5) == 0) { - handle.DrawLine(new Vector2(xOff, height), new Vector2(xOff, height+2), Color.LightGray); + handle.DrawLine(new Vector2(xOff, height), new Vector2(xOff, height + 2), Color.LightGray); } // lag data @@ -222,19 +222,19 @@ namespace Robust.Client.GameStates // interp data Color interpColor; - if(state.Buffer < _gameStateManager.MinBufferSize) + if (state.Buffer < _gameStateManager.MinBufferSize) interpColor = Color.Red; - else if(state.Buffer < _gameStateManager.TargetBufferSize) + else if (state.Buffer < _gameStateManager.TargetBufferSize) interpColor = Color.Yellow; else interpColor = Color.Green; var delta = (state.Buffer - _gameStateManager.MinBufferSize); - handle.DrawLine(new Vector2(xOff, height + LowerGraphOffset), new Vector2(xOff, height + LowerGraphOffset + delta * 6), interpColor.WithAlpha(0.8f)); + handle.DrawLine(new Vector2(xOff, height + LowerGraphOffset), new Vector2(xOff, height + LowerGraphOffset + delta * 6), interpColor.WithAlpha(0.8f)); } // average payload line - var avg = height - BytesToPixels(_totalHistoryPayload/HistorySize); + var avg = height - BytesToPixels(_totalHistoryPayload / HistorySize); var avgEnd = new Vector2(LeftMargin + width, avg) + new Vector2(70, 0); handle.DrawLine(new Vector2(LeftMargin, avg), avgEnd, Color.DarkGray.WithAlpha(0.8f)); @@ -264,7 +264,7 @@ namespace Robust.Client.GameStates handle.DrawString(_font, avgEnd - new Vector2(lineHeight, lineHeight), "average"); // lag text info - if(lastLagY != -1) + if (lastLagY != -1) handle.DrawString(_font, new Vector2(LeftMargin + width, lastLagY), $"{lastLagMs.ToString()}ms"); // buffer text @@ -286,7 +286,7 @@ namespace Robust.Client.GameStates { var overlayMan = IoCManager.Resolve(); - if(!overlayMan.HasOverlay(typeof(NetGraphOverlay))) + if (!overlayMan.HasOverlay(typeof(NetGraphOverlay))) { overlayMan.AddOverlay(new NetGraphOverlay()); shell.WriteLine("Enabled network overlay."); @@ -299,11 +299,11 @@ namespace Robust.Client.GameStates } } - private sealed class NetWatchEntCommand : LocalizedCommands + private sealed partial class NetWatchEntCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entManager = default!; - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private IEntityManager _entManager = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; public override string Command => "net_watchent"; diff --git a/Robust.Client/GameStates/NetInterpOverlay.cs b/Robust.Client/GameStates/NetInterpOverlay.cs index 5f71a35b92..c171b34f80 100644 --- a/Robust.Client/GameStates/NetInterpOverlay.cs +++ b/Robust.Client/GameStates/NetInterpOverlay.cs @@ -11,13 +11,13 @@ using Robust.Shared.Timing; namespace Robust.Client.GameStates { - internal sealed class NetInterpOverlay : Overlay + internal sealed partial class NetInterpOverlay : Overlay { private static readonly ProtoId UnshadedShader = "unshaded"; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; private readonly EntityLookupSystem _lookup; public override OverlaySpace Space => OverlaySpace.WorldSpace; @@ -43,7 +43,7 @@ namespace Robust.Client.GameStates { var handle = args.DrawingHandle; handle.UseShader(_shader); - var worldHandle = (DrawingHandleWorld) handle; + var worldHandle = (DrawingHandleWorld)handle; var viewport = args.WorldAABB; var query = _entityManager.AllEntityQueryEnumerator(); @@ -57,7 +57,7 @@ namespace Robust.Client.GameStates continue; var delta = (_timing.CurTick.Value - transform.LastLerp.Value) * _timing.TickPeriod; - if(!transform.ActivelyLerping && delta > Delay) + if (!transform.ActivelyLerping && delta > Delay) continue; var aabb = _lookup.GetWorldAABB(uid); @@ -90,10 +90,10 @@ namespace Robust.Client.GameStates } } - private sealed class NetShowInterpCommand : LocalizedCommands + private sealed partial class NetShowInterpCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entManager = default!; - [Dependency] private readonly IOverlayManager _overlay = default!; + [Dependency] private IEntityManager _entManager = default!; + [Dependency] private IOverlayManager _overlay = default!; public override string Command => "net_draw_interp"; diff --git a/Robust.Client/Graphics/ClientEye/EyeManager.cs b/Robust.Client/Graphics/ClientEye/EyeManager.cs index 3734811cb4..8c5ff48a64 100644 --- a/Robust.Client/Graphics/ClientEye/EyeManager.cs +++ b/Robust.Client/Graphics/ClientEye/EyeManager.cs @@ -13,7 +13,7 @@ using Robust.Shared.Maths; namespace Robust.Client.Graphics { /// - public sealed class EyeManager : IEyeManager + public sealed partial class EyeManager : IEyeManager { // If you modify this make sure to edit the value in the Robust.Shared.Audio.AudioParams struct default too! // No I can't be bothered to make this a shared constant. @@ -22,9 +22,9 @@ namespace Robust.Client.Graphics /// public const int PixelsPerMeter = 32; - [Dependency] private readonly IClyde _displayManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IUserInterfaceManager _uiManager = default!; + [Dependency] private IClyde _displayManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IUserInterfaceManager _uiManager = default!; private ISawmill _logMill = default!; // We default to this when we get set to a null eye. diff --git a/Robust.Client/Graphics/Clyde/Clyde.Sprite.cs b/Robust.Client/Graphics/Clyde/Clyde.Sprite.cs index fb86fb579a..c30b639b8b 100644 --- a/Robust.Client/Graphics/Clyde/Clyde.Sprite.cs +++ b/Robust.Client/Graphics/Clyde/Clyde.Sprite.cs @@ -21,7 +21,7 @@ namespace Robust.Client.Graphics.Clyde; // this partial class contains code specific to querying, processing & sorting sprites. internal partial class Clyde { - [Shared.IoC.Dependency] private readonly IParallelManager _parMan = default!; + [Shared.IoC.Dependency] private IParallelManager _parMan = default!; private readonly RefList _drawingSpriteList = new(); private const int _spriteProcessingBatchSize = 25; diff --git a/Robust.Client/Graphics/Clyde/Clyde.cs b/Robust.Client/Graphics/Clyde/Clyde.cs index a3dfb0572f..03f929c536 100644 --- a/Robust.Client/Graphics/Clyde/Clyde.cs +++ b/Robust.Client/Graphics/Clyde/Clyde.cs @@ -34,25 +34,25 @@ namespace Robust.Client.Graphics.Clyde /// internal sealed partial class Clyde : IClydeInternal, IPostInjectInit, IEntityEventSubscriber { - [Dependency] private readonly IClydeTileDefinitionManager _tileDefinitionManager = default!; - [Dependency] private readonly ILightManager _lightManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IResourceManager _resManager = default!; - [Dependency] private readonly IUserInterfaceManagerInternal _userInterfaceManager = default!; - [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly ProfManager _prof = default!; - [Dependency] private readonly IDependencyCollection _deps = default!; - [Dependency] private readonly ILocalizationManager _loc = default!; - [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly ClientEntityManager _entityManager = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; - [Dependency] private readonly IReloadManager _reloads = default!; - [Dependency] private readonly LoadingScreenManager _loadingScreenManager = default!; + [Dependency] private IClydeTileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private ILightManager _lightManager = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IResourceManager _resManager = default!; + [Dependency] private IUserInterfaceManagerInternal _userInterfaceManager = default!; + [Dependency] private IEntitySystemManager _entitySystemManager = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private ProfManager _prof = default!; + [Dependency] private IDependencyCollection _deps = default!; + [Dependency] private ILocalizationManager _loc = default!; + [Dependency] private IInputManager _inputManager = default!; + [Dependency] private ClientEntityManager _entityManager = default!; + [Dependency] private IPrototypeManager _proto = default!; + [Dependency] private IReloadManager _reloads = default!; + [Dependency] private LoadingScreenManager _loadingScreenManager = default!; private GLUniformBuffer ProjViewUBO = default!; private GLUniformBuffer UniformConstantsUBO = default!; diff --git a/Robust.Client/Graphics/Clyde/Windowing/Sdl3.cs b/Robust.Client/Graphics/Clyde/Windowing/Sdl3.cs index ee73bde0ef..a02709bfae 100644 --- a/Robust.Client/Graphics/Clyde/Windowing/Sdl3.cs +++ b/Robust.Client/Graphics/Clyde/Windowing/Sdl3.cs @@ -14,8 +14,8 @@ internal partial class Clyde { private sealed partial class Sdl3WindowingImpl : IWindowingImpl { - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IConfigurationManager _cfg = default!; private readonly Clyde _clyde; private GCHandle _selfGCHandle; diff --git a/Robust.Client/Graphics/FontManagement/SystemFontDebugWindow.xaml.cs b/Robust.Client/Graphics/FontManagement/SystemFontDebugWindow.xaml.cs index 8061d766fc..5dbcb30371 100644 --- a/Robust.Client/Graphics/FontManagement/SystemFontDebugWindow.xaml.cs +++ b/Robust.Client/Graphics/FontManagement/SystemFontDebugWindow.xaml.cs @@ -16,7 +16,7 @@ internal sealed partial class SystemFontDebugWindow : DefaultWindow private static readonly int[] ExampleFontSizes = [8, 12, 16, 24, 36]; private const string ExampleString = "The quick brown fox jumps over the lazy dog"; - [Dependency] private readonly ISystemFontManager _systemFontManager = default!; + [Dependency] private ISystemFontManager _systemFontManager = default!; public SystemFontDebugWindow() { diff --git a/Robust.Client/Graphics/LoadingScreenManager.cs b/Robust.Client/Graphics/LoadingScreenManager.cs index e347c65f28..d2b3d83e49 100644 --- a/Robust.Client/Graphics/LoadingScreenManager.cs +++ b/Robust.Client/Graphics/LoadingScreenManager.cs @@ -35,12 +35,12 @@ internal interface ILoadingScreenManager /// /// Manager that creates and displays a basic splash screen and loading bar. /// -internal sealed class LoadingScreenManager : ILoadingScreenManager +internal sealed partial class LoadingScreenManager : ILoadingScreenManager { - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IClydeInternal _clyde = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IClydeInternal _clyde = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private ILogManager _logManager = default!; private ISawmill _sawmill = default!; @@ -226,7 +226,7 @@ internal sealed class LoadingScreenManager : ILoadingScreenManager var drawSize = textureResource.Texture.Size * scale; handle.DrawingHandleScreen.DrawTextureRect(textureResource.Texture, UIBox2.FromDimensions(startLocation - drawSize / 2, drawSize)); - startLocation += Vector2i.Up * (int) drawSize.Y / 2; + startLocation += Vector2i.Up * (int)drawSize.Y / 2; } private void DrawLoadingBar(IRenderHandle handle, ref Vector2i location, float scale) @@ -237,7 +237,7 @@ internal sealed class LoadingScreenManager : ILoadingScreenManager // Always do the offsets, it looks a lot better! location.X -= barWidth / 2; - location += (Vector2i) (LogoLoadingBarOffset * scale); + location += (Vector2i)(LogoLoadingBarOffset * scale); if (!_showLoadingBar) return; @@ -299,9 +299,9 @@ internal sealed class LoadingScreenManager : ILoadingScreenManager #endregion // Drawing functions } -internal sealed class ShowTopLoadingTimesCommand : IConsoleCommand +internal sealed partial class ShowTopLoadingTimesCommand : IConsoleCommand { - [Dependency] private readonly LoadingScreenManager _mgr = default!; + [Dependency] private LoadingScreenManager _mgr = default!; public string Command => "loading_top"; public string Description => ""; diff --git a/Robust.Client/Graphics/Overlays/OverlayManager.cs b/Robust.Client/Graphics/Overlays/OverlayManager.cs index 1edd190fa4..f1219e69db 100644 --- a/Robust.Client/Graphics/Overlays/OverlayManager.cs +++ b/Robust.Client/Graphics/Overlays/OverlayManager.cs @@ -8,9 +8,9 @@ using Robust.Shared.ViewVariables; namespace Robust.Client.Graphics; -internal sealed class OverlayManager : IOverlayManagerInternal, IPostInjectInit +internal sealed partial class OverlayManager : IOverlayManagerInternal, IPostInjectInit { - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private ILogManager _logMan = default!; [ViewVariables] private readonly Dictionary _overlays = new(); diff --git a/Robust.Client/Graphics/SystemFontManager.cs b/Robust.Client/Graphics/SystemFontManager.cs index 0ff534f923..9290712c65 100644 --- a/Robust.Client/Graphics/SystemFontManager.cs +++ b/Robust.Client/Graphics/SystemFontManager.cs @@ -13,11 +13,11 @@ namespace Robust.Client.Graphics; /// Implementation of that proxies to platform-specific implementations, /// and adds additional logging. /// -internal sealed class SystemFontManager : ISystemFontManagerInternal, IPostInjectInit +internal sealed partial class SystemFontManager : ISystemFontManagerInternal, IPostInjectInit { - [Dependency] private readonly IFontManagerInternal _fontManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IFontManagerInternal _fontManager = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IConfigurationManager _cfg = default!; private ISawmill _sawmill = default!; diff --git a/Robust.Client/HWId/BasicHWId.cs b/Robust.Client/HWId/BasicHWId.cs index 9dc4d7960a..5c14548675 100644 --- a/Robust.Client/HWId/BasicHWId.cs +++ b/Robust.Client/HWId/BasicHWId.cs @@ -8,9 +8,9 @@ using Robust.Shared.Network; namespace Robust.Client.HWId; -internal sealed class BasicHWId : IHWId +internal sealed partial class BasicHWId : IHWId { - [Dependency] private readonly IGameControllerInternal _gameController = default!; + [Dependency] private IGameControllerInternal _gameController = default!; public const int LengthHwid = 32; @@ -31,7 +31,7 @@ internal sealed class BasicHWId : IHWId else raw = GetFileHWid(); - return [0, ..raw]; + return [0, .. raw]; } private static byte[] GetWindowsHWid(string keyName) diff --git a/Robust.Client/Input/ClydeInputManager.cs b/Robust.Client/Input/ClydeInputManager.cs index c2f5e65dc0..ef79c1d9d1 100644 --- a/Robust.Client/Input/ClydeInputManager.cs +++ b/Robust.Client/Input/ClydeInputManager.cs @@ -5,9 +5,9 @@ using Robust.Shared.Maths; namespace Robust.Client.Input { - internal sealed class ClydeInputManager : InputManager + internal sealed partial class ClydeInputManager : InputManager { - [Dependency] private readonly IClydeInternal _clyde = default!; + [Dependency] private IClydeInternal _clyde = default!; public override ScreenCoordinates MouseScreenPosition => _clyde.MouseScreenPosition; diff --git a/Robust.Client/Input/InputManager.cs b/Robust.Client/Input/InputManager.cs index 96238a9c0b..9730488016 100644 --- a/Robust.Client/Input/InputManager.cs +++ b/Robust.Client/Input/InputManager.cs @@ -34,7 +34,7 @@ using static Robust.Client.Input.Keyboard; namespace Robust.Client.Input { [Virtual] - internal class InputManager : IInputManager + internal partial class InputManager : IInputManager { // This is for both userdata and resources. private const string KeybindsPath = "/keybinds.yml"; @@ -43,11 +43,11 @@ namespace Robust.Client.Input [ViewVariables] public virtual ScreenCoordinates MouseScreenPosition => default; - [Dependency] private readonly IResourceManager _resourceMan = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IUserInterfaceManagerInternal _uiMgr = default!; - [Dependency] private readonly IConsoleHost _console = default!; - [Dependency] private readonly ISerializationManager _serialization = default!; + [Dependency] private IResourceManager _resourceMan = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IUserInterfaceManagerInternal _uiMgr = default!; + [Dependency] private IConsoleHost _console = default!; + [Dependency] private ISerializationManager _serialization = default!; private ISawmill _logger = default!; private bool _currentlyFindingViewport; @@ -181,7 +181,7 @@ namespace Robust.Client.Input var path = new ResPath(KeybindsPath); using var writer = _resourceMan.UserData.OpenWriteText(path); - var stream = new YamlStream {new(mapping.ToYaml())}; + var stream = new YamlStream { new(mapping.ToYaml()) }; stream.Save(new YamlMappingFix(new Emitter(writer)), false); } @@ -229,7 +229,7 @@ namespace Robust.Client.Input return; } - _keysPressed[(int) args.Key] = true; + _keysPressed[(int)args.Key] = true; PackedKeyCombo matchedCombo = default; @@ -306,7 +306,7 @@ namespace Robust.Client.Input args.Key, args.ScanCode, action, - (Vector2i) (mousePos ?? Vector2.Zero), + (Vector2i)(mousePos ?? Vector2.Zero), args.RawCode); var block = rawInput.RawKeyEvent(keyEvent); @@ -338,7 +338,7 @@ namespace Robust.Client.Input } } - _keysPressed[(int) args.Key] = false; + _keysPressed[(int)args.Key] = false; if (hasCanFocus) { @@ -486,10 +486,10 @@ namespace Robust.Client.Input { var (baseKey, mod1, mod2, mod3) = packed; - if (!_keysPressed[(int) baseKey]) return false; - if (mod1 != Key.Unknown && !_keysPressed[(int) mod1]) return false; - if (mod2 != Key.Unknown && !_keysPressed[(int) mod2]) return false; - if (mod3 != Key.Unknown && !_keysPressed[(int) mod3]) return false; + if (!_keysPressed[(int)baseKey]) return false; + if (mod1 != Key.Unknown && !_keysPressed[(int)mod1]) return false; + if (mod2 != Key.Unknown && !_keysPressed[(int)mod2]) return false; + if (mod3 != Key.Unknown && !_keysPressed[(int)mod3]) return false; return true; } @@ -510,7 +510,7 @@ namespace Robust.Client.Input { for (var i = 0; i < 32; i += 8) { - var key = (Key) ((subPackedCombo.Packed >> i) & 0b_1111_1111); + var key = (Key)((subPackedCombo.Packed >> i) & 0b_1111_1111); if (key != Key.Unknown && !PackedContainsKey(packedCombo, key)) { return false; @@ -541,7 +541,7 @@ namespace Robust.Client.Input using var _ = reader; var documents = DataNodeParser.ParseYamlStream(reader).First(); - var mapping = (MappingDataNode) documents.Root; + var mapping = (MappingDataNode)documents.Root; if (mapping.TryGet("binds", out var BaseKeyRegsNode)) { @@ -628,7 +628,7 @@ namespace Robust.Client.Input public void RemoveBinding(IKeyBinding binding, bool markModified = true) { var bindings = _bindingsByFunction[binding.Function]; - var cast = (KeyBinding) binding; + var cast = (KeyBinding)binding; if (!bindings.Remove(cast)) { // Keybind does not exist. @@ -714,7 +714,7 @@ namespace Robust.Client.Input public bool IsKeyDown(Key key) { - return _keysPressed[(int) key]; + return _keysPressed[(int)key]; } /// @@ -968,9 +968,9 @@ namespace Robust.Client.Input } [UsedImplicitly] - internal sealed class BindCommand : LocalizedCommands + internal sealed partial class BindCommand : LocalizedCommands { - [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private IInputManager _inputManager = default!; public override string Command => "bind"; @@ -1018,7 +1018,7 @@ namespace Robust.Client.Input if (args.Length == 2) { - var options = Enum.GetNames().Except(new []{nameof(KeyBindingType.Unknown)}); + var options = Enum.GetNames().Except(new[] { nameof(KeyBindingType.Unknown) }); return CompletionResult.FromHintOptions(options, Loc.GetString("cmd-bind-arg-mode")); } @@ -1042,9 +1042,9 @@ namespace Robust.Client.Input } [UsedImplicitly] - internal sealed class SaveBindCommand : LocalizedCommands + internal sealed partial class SaveBindCommand : LocalizedCommands { - [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private IInputManager _inputManager = default!; public override string Command => "svbind"; diff --git a/Robust.Client/Localization/ClientLocalizationManager.cs b/Robust.Client/Localization/ClientLocalizationManager.cs index b9eb96f297..d6fd788497 100644 --- a/Robust.Client/Localization/ClientLocalizationManager.cs +++ b/Robust.Client/Localization/ClientLocalizationManager.cs @@ -4,9 +4,9 @@ using Robust.Shared.Utility; namespace Robust.Client.Localization; -internal sealed class ClientLocalizationManager : LocalizationManager, ILocalizationManagerInternal +internal sealed partial class ClientLocalizationManager : LocalizationManager, ILocalizationManagerInternal { - [Dependency] private readonly IReloadManager _reload = default!; + [Dependency] private IReloadManager _reload = default!; void ILocalizationManager.Initialize() => Initialize(); diff --git a/Robust.Client/Map/ClydeTileDefinitionManager.cs b/Robust.Client/Map/ClydeTileDefinitionManager.cs index 78692560cc..2199b867d5 100644 --- a/Robust.Client/Map/ClydeTileDefinitionManager.cs +++ b/Robust.Client/Map/ClydeTileDefinitionManager.cs @@ -19,12 +19,12 @@ using SixLabors.ImageSharp.Processing; namespace Robust.Client.Map { - internal sealed class ClydeTileDefinitionManager : TileDefinitionManager, IClydeTileDefinitionManager, IPostInjectInit + internal sealed partial class ClydeTileDefinitionManager : TileDefinitionManager, IClydeTileDefinitionManager, IPostInjectInit { - [Dependency] private readonly IPrototypeManager _protoManager = default!; - [Dependency] private readonly IReloadManager _reload = default!; - [Dependency] private readonly IResourceManager _manager = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IPrototypeManager _protoManager = default!; + [Dependency] private IReloadManager _reload = default!; + [Dependency] private IResourceManager _manager = default!; + [Dependency] private ILogManager _logManager = default!; private ISawmill _sawmill = default!; @@ -107,14 +107,14 @@ namespace Robust.Client.Map var tileCount = defList.Select(x => x.Variants + x.EdgeSprites.Count).Sum() + 1; - var dimensionX = (int) Math.Ceiling(Math.Sqrt(tileCount)); - var dimensionY = (int) Math.Ceiling((float) tileCount / dimensionX); + var dimensionX = (int)Math.Ceiling(Math.Sqrt(tileCount)); + var dimensionY = (int)Math.Ceiling((float)tileCount / dimensionX); var imgWidth = dimensionX * tileSize; var imgHeight = dimensionY * tileSize; var sheet = new Image(imgWidth, imgHeight); - var w = (float) sheet.Width; - var h = (float) sheet.Height; + var w = (float)sheet.Width; + var h = (float)sheet.Height; // Add in the missing tile texture sprite as tile texture 0. { @@ -265,9 +265,9 @@ namespace Robust.Client.Map } } - public sealed class ReloadTileTexturesCommand : LocalizedCommands + public sealed partial class ReloadTileTexturesCommand : LocalizedCommands { - [Dependency] private readonly ClydeTileDefinitionManager _tile = default!; + [Dependency] private ClydeTileDefinitionManager _tile = default!; public override string Command => "reloadtiletextures"; diff --git a/Robust.Client/Physics/DebugPhysicsIslandSystem.cs b/Robust.Client/Physics/DebugPhysicsIslandSystem.cs index ebd0143eee..03de0da052 100644 --- a/Robust.Client/Physics/DebugPhysicsIslandSystem.cs +++ b/Robust.Client/Physics/DebugPhysicsIslandSystem.cs @@ -14,9 +14,9 @@ using TerraFX.Interop.DirectX; namespace Robust.Client.Physics { - internal sealed class PhysicsIslandCommand : LocalizedCommands + internal sealed partial class PhysicsIslandCommand : LocalizedCommands { - [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private IEntitySystemManager _entitySystemManager = default!; public override string Command => "showislands"; @@ -33,12 +33,12 @@ namespace Robust.Client.Physics } } - internal sealed class DebugPhysicsIslandSystem : EntitySystem + internal sealed partial class DebugPhysicsIslandSystem : EntitySystem { - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] private EntityLookupSystem _lookup = default!; public DebugPhysicsIslandMode Mode { get; set; } = DebugPhysicsIslandMode.None; diff --git a/Robust.Client/Physics/GridFixtureSystem.cs b/Robust.Client/Physics/GridFixtureSystem.cs index 32821911b1..9907f81ef0 100644 --- a/Robust.Client/Physics/GridFixtureSystem.cs +++ b/Robust.Client/Physics/GridFixtureSystem.cs @@ -10,12 +10,12 @@ using Robust.Shared.Maths; namespace Robust.Client.Physics { - internal sealed class GridFixtureSystem : SharedGridFixtureSystem + internal sealed partial class GridFixtureSystem : SharedGridFixtureSystem { - [Dependency] private readonly IOverlayManager _overlay = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly SharedMapSystem _map = default!; + [Dependency] private IOverlayManager _overlay = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private SharedMapSystem _map = default!; public bool EnableDebug { @@ -132,9 +132,9 @@ namespace Robust.Client.Physics // Add an offset to yIndex so we at least have some colour that isn't grey at 0,0 var actualIndex = chunk.Indices.X * 20 + (chunk.Indices.Y + 20) * 35 + index * 50; - var red = (byte) (actualIndex % 255); - var green = (byte) (actualIndex * 20 % 255); - var blue = (byte) (actualIndex * 30 % 255); + var red = (byte)(actualIndex % 255); + var green = (byte)(actualIndex * 20 % 255); + var blue = (byte)(actualIndex * 30 % 255); return new Color(red, green, blue, 85); } diff --git a/Robust.Client/Physics/GridSplitVisualsCommand.cs b/Robust.Client/Physics/GridSplitVisualsCommand.cs index 11e32519e3..5ebc9d3528 100644 --- a/Robust.Client/Physics/GridSplitVisualsCommand.cs +++ b/Robust.Client/Physics/GridSplitVisualsCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Physics; -public sealed class GridSplitVisualCommand : LocalizedCommands +public sealed partial class GridSplitVisualCommand : LocalizedCommands { - [Dependency] private readonly IEntitySystemManager _systemManager = default!; + [Dependency] private IEntitySystemManager _systemManager = default!; public override string Command => SharedGridFixtureSystem.ShowGridNodesCommand; diff --git a/Robust.Client/Physics/PhysicsSystem.cs b/Robust.Client/Physics/PhysicsSystem.cs index 184c7f19bb..6552ef2727 100644 --- a/Robust.Client/Physics/PhysicsSystem.cs +++ b/Robust.Client/Physics/PhysicsSystem.cs @@ -14,9 +14,9 @@ namespace Robust.Client.Physics [UsedImplicitly] public sealed partial class PhysicsSystem : SharedPhysicsSystem { - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly SharedBroadphaseSystem _broadphase = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private SharedBroadphaseSystem _broadphase = default!; public override void Update(float frameTime) { diff --git a/Robust.Client/Placement/PlacementManager.cs b/Robust.Client/Placement/PlacementManager.cs index 8f92a3b04d..eda141df12 100644 --- a/Robust.Client/Placement/PlacementManager.cs +++ b/Robust.Client/Placement/PlacementManager.cs @@ -28,21 +28,21 @@ namespace Robust.Client.Placement { public sealed partial class PlacementManager : IPlacementManager, IDisposable, IEntityEventSubscriber { - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IClientNetManager _networkManager = default!; - [Dependency] internal readonly IPlayerManager PlayerManager = default!; - [Dependency] internal readonly IResourceCache ResourceCache = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IGameTiming _time = default!; - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] internal readonly IInputManager InputManager = default!; - [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IBaseClient _baseClient = default!; - [Dependency] private readonly IOverlayManager _overlayManager = default!; - [Dependency] internal readonly IClyde Clyde = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IClientNetManager _networkManager = default!; + [Dependency] internal IPlayerManager PlayerManager = default!; + [Dependency] internal IResourceCache ResourceCache = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IGameTiming _time = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] internal IInputManager InputManager = default!; + [Dependency] private IEntitySystemManager _entitySystemManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; + [Dependency] private IBaseClient _baseClient = default!; + [Dependency] private IOverlayManager _overlayManager = default!; + [Dependency] internal IClyde Clyde = default!; private static readonly ProtoId UnshadedShader = "unshaded"; diff --git a/Robust.Client/Player/FilterSystem.cs b/Robust.Client/Player/FilterSystem.cs index c166ad63e0..3001fd554f 100644 --- a/Robust.Client/Player/FilterSystem.cs +++ b/Robust.Client/Player/FilterSystem.cs @@ -4,13 +4,13 @@ using Robust.Shared.Player; namespace Robust.Client.Player { - internal sealed class FilterSystem : SharedFilterSystem + internal sealed partial class FilterSystem : SharedFilterSystem { - [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; public override Filter FromEntities(Filter filter, params EntityUid[] entities) { - if (_playerManager.LocalEntity is not {Valid: true} attachedUid) + if (_playerManager.LocalEntity is not { Valid: true } attachedUid) return filter; foreach (var uid in entities) diff --git a/Robust.Client/Player/PlayerManager.cs b/Robust.Client/Player/PlayerManager.cs index aa5bb0be76..0bc24f35cc 100644 --- a/Robust.Client/Player/PlayerManager.cs +++ b/Robust.Client/Player/PlayerManager.cs @@ -17,15 +17,15 @@ namespace Robust.Client.Player /// Why not just attach the inputs directly? It's messy! This makes the whole thing nicely encapsulated. /// This class also communicates with the server to let the server control what entity it is attached to. /// - internal sealed class PlayerManager : SharedPlayerManager, IPlayerManager + internal sealed partial class PlayerManager : SharedPlayerManager, IPlayerManager { - [Dependency] private readonly IClientNetManager _network = default!; - [Dependency] private readonly IBaseClient _client = default!; + [Dependency] private IClientNetManager _network = default!; + [Dependency] private IBaseClient _client = default!; /// /// Received player states that had an unknown . /// - private Dictionary _pendingStates = new (); + private Dictionary _pendingStates = new(); private List _pending = new(); /// @@ -34,7 +34,7 @@ namespace Robust.Client.Player get { return LocalSession != null - ? new [] { LocalSession } + ? new[] { LocalSession } : Array.Empty(); } } @@ -94,7 +94,7 @@ namespace Robust.Client.Player var old = LocalSession; - if (old?.AttachedEntity is {} oldUid) + if (old?.AttachedEntity is { } oldUid) { LocalSession = null; LocalPlayer = null; @@ -108,7 +108,7 @@ namespace Robust.Client.Player Sawmill.Info($"Changing local session from {old?.ToString() ?? "null"} to {session?.ToString() ?? "null"}."); LocalSessionChanged?.Invoke((old, LocalSession)); - if (session?.AttachedEntity is {} newUid) + if (session?.AttachedEntity is { } newUid) { Sawmill.Info($"Attaching local player to {EntManager.ToPrettyString(newUid)}."); EntManager.EventBus.RaiseLocalEvent(newUid, new LocalPlayerAttachedEvent(newUid), true); @@ -199,7 +199,7 @@ namespace Robust.Client.Player if (list.Count == 0) return false; - DebugTools.Assert(_network.IsConnected || _client.RunLevel == ClientRunLevel.SinglePlayerGame // replays use state application. + DebugTools.Assert(_network.IsConnected || _client.RunLevel == ClientRunLevel.SinglePlayerGame // replays use state application. , "Received player state without being connected?"); DebugTools.Assert(LocalSession != null, "Received player state before Session finished setup."); @@ -210,7 +210,7 @@ namespace Robust.Client.Player { dirty = true; if (!EntManager.TryGetEntity(state.ControlledEntity, out var uid) - && state.ControlledEntity is { Valid:true } ) + && state.ControlledEntity is { Valid: true }) { Sawmill.Error($"Received player state for local player with an unknown net entity!"); _pendingStates[state.UserId] = state; @@ -247,7 +247,7 @@ namespace Robust.Client.Player users.Add(state.UserId); if (!EntManager.TryGetEntity(state.ControlledEntity, out var controlled) - && state.ControlledEntity is {Valid: true}) + && state.ControlledEntity is { Valid: true }) { _pendingStates[state.UserId] = state; } diff --git a/Robust.Client/Profiling/LiveProfileViewControl.cs b/Robust.Client/Profiling/LiveProfileViewControl.cs index 01e1a67d07..1118beb7e9 100644 --- a/Robust.Client/Profiling/LiveProfileViewControl.cs +++ b/Robust.Client/Profiling/LiveProfileViewControl.cs @@ -10,10 +10,10 @@ using Robust.Shared.Utility; namespace Robust.Client.Profiling; -public sealed class LiveProfileViewControl : Control +public sealed partial class LiveProfileViewControl : Control { - [Dependency] private readonly ProfManager _profManager = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; + [Dependency] private ProfManager _profManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; public int MaxDepth { get; set; } = 2; diff --git a/Robust.Client/Profiling/ProfViewManager.cs b/Robust.Client/Profiling/ProfViewManager.cs index a4dae50498..9805a2827c 100644 --- a/Robust.Client/Profiling/ProfViewManager.cs +++ b/Robust.Client/Profiling/ProfViewManager.cs @@ -10,10 +10,10 @@ namespace Robust.Client.Profiling; /// /// Manager for managing recording and snapshots of profiles, consuming shared /// -public sealed class ProfViewManager +public sealed partial class ProfViewManager { [Dependency] - private readonly ProfManager _profManager = default!; + private ProfManager _profManager = default!; public ValueList Snapshots; @@ -121,9 +121,9 @@ public sealed class ProfViewManager } } -public sealed class ProfSnapshotCommand : LocalizedCommands +public sealed partial class ProfSnapshotCommand : LocalizedCommands { - [Dependency] private readonly ProfViewManager _profView = default!; + [Dependency] private ProfViewManager _profView = default!; // ReSharper disable once StringLiteralTypo public override string Command => "profsnap"; diff --git a/Robust.Client/Prototypes/ClientPrototypeManager.cs b/Robust.Client/Prototypes/ClientPrototypeManager.cs index 9a0d747280..3285615aae 100644 --- a/Robust.Client/Prototypes/ClientPrototypeManager.cs +++ b/Robust.Client/Prototypes/ClientPrototypeManager.cs @@ -10,14 +10,14 @@ using Robust.Shared.Utility; namespace Robust.Client.Prototypes { - public sealed class ClientPrototypeManager : PrototypeManager + public sealed partial class ClientPrototypeManager : PrototypeManager { - [Dependency] private readonly INetManager _netManager = default!; + [Dependency] private INetManager _netManager = default!; #if TOOLS - [Dependency] private readonly IClientGameTiming _timing = default!; + [Dependency] private IClientGameTiming _timing = default!; #endif - [Dependency] private readonly IGameControllerInternal _controller = default!; - [Dependency] private readonly IReloadManager _reload = default!; + [Dependency] private IGameControllerInternal _controller = default!; + [Dependency] private IReloadManager _reload = default!; public override void Initialize() { diff --git a/Robust.Client/Replays/Commands/ReplayCommand.cs b/Robust.Client/Replays/Commands/ReplayCommand.cs index 85de3631c7..846a62bdc2 100644 --- a/Robust.Client/Replays/Commands/ReplayCommand.cs +++ b/Robust.Client/Replays/Commands/ReplayCommand.cs @@ -8,13 +8,13 @@ using Robust.Shared.Replays; namespace Robust.Client.Replays.Commands; -public abstract class BaseReplayCommand : LocalizedCommands +public abstract partial class BaseReplayCommand : LocalizedCommands { - [Dependency] protected readonly IReplayPlaybackManager PlaybackManager = default!; + [Dependency] protected IReplayPlaybackManager PlaybackManager = default!; - public override string Description => Loc.GetString($"cmd-{Command.Replace('_','-')}-desc"); + public override string Description => Loc.GetString($"cmd-{Command.Replace('_', '-')}-desc"); - public override string Help => Loc.GetString($"cmd-{Command.Replace('_','-')}-help"); + public override string Help => Loc.GetString($"cmd-{Command.Replace('_', '-')}-help"); protected bool AssertPlaying(IConsoleShell shell, [NotNullWhen(true)] out ReplayData? replay) { diff --git a/Robust.Client/Replays/Commands/ReplayLoadCommand.cs b/Robust.Client/Replays/Commands/ReplayLoadCommand.cs index 6d5cace7ea..0b1390b2da 100644 --- a/Robust.Client/Replays/Commands/ReplayLoadCommand.cs +++ b/Robust.Client/Replays/Commands/ReplayLoadCommand.cs @@ -14,12 +14,12 @@ using Robust.Shared.Utility; namespace Robust.Client.Replays.Commands; [UsedImplicitly] -public sealed class ReplayLoadCommand : BaseReplayCommand +public sealed partial class ReplayLoadCommand : BaseReplayCommand { - [Dependency] private readonly IResourceManager _resMan = default!; - [Dependency] private readonly IReplayLoadManager _loadMan = default!; - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IResourceManager _resMan = default!; + [Dependency] private IReplayLoadManager _loadMan = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IConfigurationManager _cfg = default!; public override string Command => IReplayPlaybackManager.LoadCommand; diff --git a/Robust.Client/Replays/Commands/ReplaySkipCommand.cs b/Robust.Client/Replays/Commands/ReplaySkipCommand.cs index b3ad092a63..5fc9bca757 100644 --- a/Robust.Client/Replays/Commands/ReplaySkipCommand.cs +++ b/Robust.Client/Replays/Commands/ReplaySkipCommand.cs @@ -9,9 +9,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Replays.Commands; [UsedImplicitly] -public sealed class ReplaySkipCommand : BaseReplayCommand +public sealed partial class ReplaySkipCommand : BaseReplayCommand { - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; public override string Command => IReplayPlaybackManager.SkipCommand; diff --git a/Robust.Client/Replays/Commands/ReplayToggleUiCommand.cs b/Robust.Client/Replays/Commands/ReplayToggleUiCommand.cs index 661bccbf57..776b78ea3b 100644 --- a/Robust.Client/Replays/Commands/ReplayToggleUiCommand.cs +++ b/Robust.Client/Replays/Commands/ReplayToggleUiCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Client.Replays.Commands; -public sealed class ReplayToggleUiCommand : BaseReplayCommand +public sealed partial class ReplayToggleUiCommand : BaseReplayCommand { - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private IUserInterfaceManager _userInterfaceManager = default!; public override string Command => "replay_toggleui"; diff --git a/Robust.Client/Replays/Loading/ReplayLoadManager.cs b/Robust.Client/Replays/Loading/ReplayLoadManager.cs index 191afc828b..54ca7dcaef 100644 --- a/Robust.Client/Replays/Loading/ReplayLoadManager.cs +++ b/Robust.Client/Replays/Loading/ReplayLoadManager.cs @@ -17,18 +17,18 @@ namespace Robust.Client.Replays.Loading; public sealed partial class ReplayLoadManager : IReplayLoadManager { - [Dependency] private readonly ILogManager _logMan = default!; - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly EntityManager _entMan = default!; - [Dependency] private readonly IClientGameTiming _timing = default!; - [Dependency] private readonly IComponentFactory _factory = default!; - [Dependency] private readonly IPrototypeManager _protoMan = default!; - [Dependency] private readonly ILocalizationManager _locMan = default!; - [Dependency] private readonly IConfigurationManager _confMan = default!; - [Dependency] private readonly NetworkResourceManager _netResMan = default!; - [Dependency] private readonly IClientGameStateManager _gameState = default!; - [Dependency] private readonly IClientRobustSerializer _serializer = default!; - [Dependency] private readonly IReplayPlaybackManager _replayPlayback = default!; + [Dependency] private ILogManager _logMan = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private EntityManager _entMan = default!; + [Dependency] private IClientGameTiming _timing = default!; + [Dependency] private IComponentFactory _factory = default!; + [Dependency] private IPrototypeManager _protoMan = default!; + [Dependency] private ILocalizationManager _locMan = default!; + [Dependency] private IConfigurationManager _confMan = default!; + [Dependency] private NetworkResourceManager _netResMan = default!; + [Dependency] private IClientGameStateManager _gameState = default!; + [Dependency] private IClientRobustSerializer _serializer = default!; + [Dependency] private IReplayPlaybackManager _replayPlayback = default!; private ushort _metaId; private bool _initialized; diff --git a/Robust.Client/Replays/Playback/ReplayPlaybackManager.cs b/Robust.Client/Replays/Playback/ReplayPlaybackManager.cs index 8876af701c..19bb7c1ac4 100644 --- a/Robust.Client/Replays/Playback/ReplayPlaybackManager.cs +++ b/Robust.Client/Replays/Playback/ReplayPlaybackManager.cs @@ -26,22 +26,22 @@ namespace Robust.Client.Replays.Playback; internal sealed partial class ReplayPlaybackManager : IReplayPlaybackManager { - [Dependency] private readonly ILogManager _logMan = default!; - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IMidiManager _midi = default!; - [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IAudioInternal _clydeAudio = default!; - [Dependency] private readonly IClientGameTiming _timing = default!; - [Dependency] private readonly IClientNetManager _netMan = default!; - [Dependency] private readonly IComponentFactory _factory = default!; - [Dependency] private readonly IPrototypeManager _protoMan = default!; - [Dependency] private readonly IGameController _controller = default!; - [Dependency] private readonly IClientEntityManager _cEntManager = default!; - [Dependency] private readonly ClientEntityManager _entMan = default!; - [Dependency] private readonly IConfigurationManager _confMan = default!; - [Dependency] private readonly NetworkResourceManager _netResMan = default!; - [Dependency] private readonly IClientGameStateManager _gameState = default!; - [Dependency] private readonly IClientNetConfigurationManager _netConf = default!; + [Dependency] private ILogManager _logMan = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IMidiManager _midi = default!; + [Dependency] private IPlayerManager _player = default!; + [Dependency] private IAudioInternal _clydeAudio = default!; + [Dependency] private IClientGameTiming _timing = default!; + [Dependency] private IClientNetManager _netMan = default!; + [Dependency] private IComponentFactory _factory = default!; + [Dependency] private IPrototypeManager _protoMan = default!; + [Dependency] private IGameController _controller = default!; + [Dependency] private IClientEntityManager _cEntManager = default!; + [Dependency] private ClientEntityManager _entMan = default!; + [Dependency] private IConfigurationManager _confMan = default!; + [Dependency] private NetworkResourceManager _netResMan = default!; + [Dependency] private IClientGameStateManager _gameState = default!; + [Dependency] private IClientNetConfigurationManager _netConf = default!; public event Action>? ReplayPlaybackStarted; public event Action? ReplayPlaybackStopped; diff --git a/Robust.Client/Replays/ReplayRecordingManager.cs b/Robust.Client/Replays/ReplayRecordingManager.cs index a5ba0bac8f..91c61a670b 100644 --- a/Robust.Client/Replays/ReplayRecordingManager.cs +++ b/Robust.Client/Replays/ReplayRecordingManager.cs @@ -18,13 +18,13 @@ using Robust.Shared.Utility; namespace Robust.Client.Replays; -internal sealed class ReplayRecordingManager : SharedReplayRecordingManager +internal sealed partial class ReplayRecordingManager : SharedReplayRecordingManager { - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IEntityManager _entMan = default!; - [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IClientGameStateManager _state = default!; - [Dependency] private readonly IClientGameTiming _timing = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IEntityManager _entMan = default!; + [Dependency] private IPlayerManager _player = default!; + [Dependency] private IClientGameStateManager _state = default!; + [Dependency] private IClientGameTiming _timing = default!; public override void Initialize() { diff --git a/Robust.Client/Replays/UI/ReplayControlWidget.cs b/Robust.Client/Replays/UI/ReplayControlWidget.cs index 3e9db292e3..e09dc77d24 100644 --- a/Robust.Client/Replays/UI/ReplayControlWidget.cs +++ b/Robust.Client/Replays/UI/ReplayControlWidget.cs @@ -18,8 +18,8 @@ namespace Robust.Client.Replays.UI; [GenerateTypedNameReferences] public sealed partial class ReplayControlWidget : UIWidget // AKA Tardis - The funny time control box. { - [Dependency] private readonly IReplayPlaybackManager _playback = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IReplayPlaybackManager _playback = default!; + [Dependency] private IConfigurationManager _cfg = default!; public const string TimeFormat = @"hh\:mm\:ss"; diff --git a/Robust.Client/ResourceManagement/ResourceCache.Preload.cs b/Robust.Client/ResourceManagement/ResourceCache.Preload.cs index e662046ee3..5e35b74de9 100644 --- a/Robust.Client/ResourceManagement/ResourceCache.Preload.cs +++ b/Robust.Client/ResourceManagement/ResourceCache.Preload.cs @@ -24,12 +24,13 @@ namespace Robust.Client.ResourceManagement { internal partial class ResourceCache { - [field: Dependency] public IClyde Clyde { get; } = default!; - [field: Dependency] public IAudioInternal ClydeAudio { get; } = default!; - [Dependency] private readonly IResourceManager _manager = default!; - [field: Dependency] public IFontManager FontManager { get; } = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private IClyde _clyde = null!; + public IClyde Clyde => _clyde; + [Dependency] private IResourceManager _manager = default!; + [Dependency] private IFontManager _fontManager = null!; + public IFontManager FontManager => _fontManager; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IConfigurationManager _configurationManager = default!; public void PreloadTextures() { diff --git a/Robust.Client/Serialization/ClientRobustSerializer.cs b/Robust.Client/Serialization/ClientRobustSerializer.cs index ae45612e5b..1967804e5c 100644 --- a/Robust.Client/Serialization/ClientRobustSerializer.cs +++ b/Robust.Client/Serialization/ClientRobustSerializer.cs @@ -6,7 +6,7 @@ namespace Robust.Client.Serialization; internal sealed partial class ClientRobustSerializer : RobustSerializer, IClientRobustSerializer { - [Dependency] private readonly IBaseClient _client = default!; + [Dependency] private IBaseClient _client = default!; public void SetStringSerializerPackage(byte[] hash, byte[] package) { diff --git a/Robust.Client/State/StateManager.cs b/Robust.Client/State/StateManager.cs index 83cdf31c2e..a0b7a7f094 100644 --- a/Robust.Client/State/StateManager.cs +++ b/Robust.Client/State/StateManager.cs @@ -6,10 +6,10 @@ using Robust.Shared.Timing; namespace Robust.Client.State { - internal sealed class StateManager : IStateManager + internal sealed partial class StateManager : IStateManager { - [Dependency] private readonly IDynamicTypeFactory _typeFactory = default!; - [Dependency] private readonly IUserInterfaceManager _interfaceManager = default!; + [Dependency] private IDynamicTypeFactory _typeFactory = default!; + [Dependency] private IUserInterfaceManager _interfaceManager = default!; public event Action? OnStateChanged; public State CurrentState { get; private set; } @@ -25,12 +25,12 @@ namespace Robust.Client.State public T RequestStateChange() where T : State, new() { - return (T) RequestStateChange(typeof(T)); + return (T)RequestStateChange(typeof(T)); } public State RequestStateChange(Type type) { - if(!typeof(State).IsAssignableFrom(type)) + if (!typeof(State).IsAssignableFrom(type)) throw new ArgumentException($"Needs to be derived from {typeof(State).FullName}", nameof(type)); return CurrentState?.GetType() == type ? CurrentState : SwitchToState(type); diff --git a/Robust.Client/Timing/ClientGameTiming.cs b/Robust.Client/Timing/ClientGameTiming.cs index 188f12d3fd..9a7bf1ad78 100644 --- a/Robust.Client/Timing/ClientGameTiming.cs +++ b/Robust.Client/Timing/ClientGameTiming.cs @@ -6,9 +6,9 @@ using Robust.Shared.Utility; namespace Robust.Client.Timing { - public sealed class ClientGameTiming : GameTiming, IClientGameTiming + public sealed partial class ClientGameTiming : GameTiming, IClientGameTiming { - [Dependency] private readonly IClientNetManager _netManager = default!; + [Dependency] private IClientNetManager _netManager = default!; public override bool InPrediction => !ApplyingState && CurTick > LastRealTick; diff --git a/Robust.Client/Upload/Commands/UploadFileCommand.cs b/Robust.Client/Upload/Commands/UploadFileCommand.cs index bfa0a51a38..dbf0014bbe 100644 --- a/Robust.Client/Upload/Commands/UploadFileCommand.cs +++ b/Robust.Client/Upload/Commands/UploadFileCommand.cs @@ -9,11 +9,11 @@ using Robust.Shared.Utility; namespace Robust.Client.Upload.Commands; -public sealed class UploadFileCommand : IConsoleCommand +public sealed partial class UploadFileCommand : IConsoleCommand { - [Dependency] private readonly IConfigurationManager _cfgManager = default!; - [Dependency] private readonly IFileDialogManager _dialog = default!; - [Dependency] private readonly NetworkResourceManager _netRes = default!; + [Dependency] private IConfigurationManager _cfgManager = default!; + [Dependency] private IFileDialogManager _dialog = default!; + [Dependency] private NetworkResourceManager _netRes = default!; public string Command => "uploadfile"; public string Description => "Uploads a resource to the server."; diff --git a/Robust.Client/Upload/Commands/UploadFolderCommand.cs b/Robust.Client/Upload/Commands/UploadFolderCommand.cs index bd7b67e6eb..3172ca3716 100644 --- a/Robust.Client/Upload/Commands/UploadFolderCommand.cs +++ b/Robust.Client/Upload/Commands/UploadFolderCommand.cs @@ -11,11 +11,11 @@ using Robust.Shared.Utility; namespace Robust.Client.Upload.Commands; -public sealed class UploadFolderCommand : IConsoleCommand +public sealed partial class UploadFolderCommand : IConsoleCommand { - [Dependency] private readonly IResourceManager _resourceManager = default!; - [Dependency] private readonly IConfigurationManager _configManager = default!; - [Dependency] private readonly NetworkResourceManager _netRes = default!; + [Dependency] private IResourceManager _resourceManager = default!; + [Dependency] private IConfigurationManager _configManager = default!; + [Dependency] private NetworkResourceManager _netRes = default!; public string Command => "uploadfolder"; public string Description => Loc.GetString("uploadfolder-command-description"); @@ -29,14 +29,14 @@ public sealed class UploadFolderCommand : IConsoleCommand if (!_configManager.GetCVar(CVars.ResourceUploadingEnabled)) { - shell.WriteError( Loc.GetString("uploadfolder-command-resource-upload-disabled")); + shell.WriteError(Loc.GetString("uploadfolder-command-resource-upload-disabled")); return; } if (args.Length != 1) { - shell.WriteError( Loc.GetString("uploadfolder-command-wrong-args")); - shell.WriteLine( Loc.GetString("uploadfolder-command-help")); + shell.WriteError(Loc.GetString("uploadfolder-command-wrong-args")); + shell.WriteLine(Loc.GetString("uploadfolder-command-help")); return; } @@ -44,20 +44,20 @@ public sealed class UploadFolderCommand : IConsoleCommand if (!_resourceManager.UserData.Exists(folderPath)) { - shell.WriteError( Loc.GetString("uploadfolder-command-folder-not-found",("folder", folderPath))); + shell.WriteError(Loc.GetString("uploadfolder-command-folder-not-found", ("folder", folderPath))); return; // bomb out if the folder doesnt exist in /UploadFolder } //Grab all files in specified folder and upload them var files = new List<(ResPath Relative, byte[] Data)>(); - foreach (var filepath in _resourceManager.UserData.Find($"{folderPath.ToRelativePath()}/").files ) + foreach (var filepath in _resourceManager.UserData.Find($"{folderPath.ToRelativePath()}/").files) { await using var filestream = _resourceManager.UserData.Open(filepath, FileMode.Open); { var sizeLimit = _configManager.GetCVar(CVars.ResourceUploadingLimitMb); if (sizeLimit > 0f && filestream.Length * SharedNetworkResourceManager.BytesToMegabytes > sizeLimit) { - shell.WriteError( Loc.GetString("uploadfolder-command-file-too-big", ("filename",filepath), ("sizeLimit",sizeLimit))); + shell.WriteError(Loc.GetString("uploadfolder-command-file-too-big", ("filename", filepath), ("sizeLimit", sizeLimit))); return; } @@ -71,6 +71,6 @@ public sealed class UploadFolderCommand : IConsoleCommand _netRes.UploadResources(files); - shell.WriteLine( Loc.GetString("uploadfolder-command-success",("fileCount",fileCount))); + shell.WriteLine(Loc.GetString("uploadfolder-command-success", ("fileCount", fileCount))); } } diff --git a/Robust.Client/Upload/NetworkResourceManager.cs b/Robust.Client/Upload/NetworkResourceManager.cs index 0d053fcdc9..660e3d6cb1 100644 --- a/Robust.Client/Upload/NetworkResourceManager.cs +++ b/Robust.Client/Upload/NetworkResourceManager.cs @@ -9,9 +9,9 @@ using Robust.Shared.Utility; namespace Robust.Client.Upload; -public sealed class NetworkResourceManager : SharedNetworkResourceManager +public sealed partial class NetworkResourceManager : SharedNetworkResourceManager { - [Dependency] private readonly IBaseClient _client = default!; + [Dependency] private IBaseClient _client = default!; internal override void Initialize() { diff --git a/Robust.Client/UserInterface/Controllers/Implementations/EntitySpawningUIController.cs b/Robust.Client/UserInterface/Controllers/Implementations/EntitySpawningUIController.cs index 07a56cd26d..dc596664de 100644 --- a/Robust.Client/UserInterface/Controllers/Implementations/EntitySpawningUIController.cs +++ b/Robust.Client/UserInterface/Controllers/Implementations/EntitySpawningUIController.cs @@ -19,11 +19,11 @@ using static Robust.Client.UserInterface.Controls.LineEdit; namespace Robust.Client.UserInterface.Controllers.Implementations; -public sealed class EntitySpawningUIController : UIController +public sealed partial class EntitySpawningUIController : UIController { - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IPlacementManager _placement = default!; - [Dependency] private readonly IPrototypeManager _prototypes = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IPlacementManager _placement = default!; + [Dependency] private IPrototypeManager _prototypes = default!; private EntitySpawnWindow? _window; private readonly List _shownEntities = new(); @@ -60,7 +60,7 @@ public sealed class EntitySpawningUIController : UIController _placement.Clear(); // Only toggle the eraser back if the button is pressed. - if(args.Pressed) + if (args.Pressed) _placement.ToggleEraser(); // clearing will toggle the erase button off... args.Button.Pressed = args.Pressed; @@ -89,7 +89,7 @@ public sealed class EntitySpawningUIController : UIController return; _window = UIManager.CreateWindow(); - LayoutContainer.SetAnchorPreset(_window,LayoutContainer.LayoutPreset.CenterLeft); + LayoutContainer.SetAnchorPreset(_window, LayoutContainer.LayoutPreset.CenterLeft); _window.OnClose += WindowClosed; _window.ReplaceButton.Pressed = _placement.Replacement; _window.ReplaceButton.OnToggled += OnEntityReplaceToggled; @@ -223,11 +223,12 @@ public sealed class EntitySpawningUIController : UIController _shownEntities.Add(prototype); } - _shownEntities.Sort((a, b) => { - var namesComparation = string.Compare(a.Name, b.Name, StringComparison.Ordinal); - if (namesComparation == 0) - return string.Compare(a.EditorSuffix, b.EditorSuffix, StringComparison.Ordinal); - return namesComparation; + _shownEntities.Sort((a, b) => + { + var namesComparation = string.Compare(a.Name, b.Name, StringComparison.Ordinal); + if (namesComparation == 0) + return string.Compare(a.EditorSuffix, b.EditorSuffix, StringComparison.Ordinal); + return namesComparation; }); _window.PrototypeList.TotalItemCount = _shownEntities.Count; @@ -278,7 +279,7 @@ public sealed class EntitySpawningUIController : UIController // Calculate index of first prototype to render based on current scroll. var height = _window.MeasureButton.DesiredSize.Y + PrototypeListContainer.Separation; var offset = Math.Max(-_window.PrototypeList.Position.Y, 0); - var startIndex = (int) Math.Floor(offset / height); + var startIndex = (int)Math.Floor(offset / height); _window.PrototypeList.ItemOffset = startIndex; var (prevStart, prevEnd) = _lastEntityIndices; @@ -306,7 +307,7 @@ public sealed class EntitySpawningUIController : UIController // Delete buttons at the start of the list that are no longer visible (scrolling down). for (var i = prevStart; i < startIndex && i <= prevEnd; i++) { - var control = (EntitySpawnButton) _window.PrototypeList.GetChild(0); + var control = (EntitySpawnButton)_window.PrototypeList.GetChild(0); DebugTools.Assert(control.Index == i); _window.PrototypeList.RemoveChild(control); } @@ -314,7 +315,7 @@ public sealed class EntitySpawningUIController : UIController // Delete buttons at the end of the list that are no longer visible (scrolling up). for (var i = prevEnd; i > endIndex && i >= prevStart; i--) { - var control = (EntitySpawnButton) _window.PrototypeList.GetChild(_window.PrototypeList.ChildCount - 1); + var control = (EntitySpawnButton)_window.PrototypeList.GetChild(_window.PrototypeList.ChildCount - 1); DebugTools.Assert(control.Index == i); _window.PrototypeList.RemoveChild(control); } @@ -347,7 +348,7 @@ public sealed class EntitySpawningUIController : UIController if (_window == null || _window.Disposed) return; - var item = (EntitySpawnButton) args.Button.Parent!; + var item = (EntitySpawnButton)args.Button.Parent!; if (_window.SelectedButton == item) { _window.SelectedButton = null; diff --git a/Robust.Client/UserInterface/Controllers/Implementations/TileSpawningUIController.cs b/Robust.Client/UserInterface/Controllers/Implementations/TileSpawningUIController.cs index bac019f1b6..3669b24915 100644 --- a/Robust.Client/UserInterface/Controllers/Implementations/TileSpawningUIController.cs +++ b/Robust.Client/UserInterface/Controllers/Implementations/TileSpawningUIController.cs @@ -18,11 +18,11 @@ using static Robust.Client.UserInterface.Controls.BaseButton; namespace Robust.Client.UserInterface.Controllers.Implementations; -public sealed class TileSpawningUIController : UIController +public sealed partial class TileSpawningUIController : UIController { - [Dependency] private readonly IPlacementManager _placement = default!; - [Dependency] private readonly IResourceCache _resources = default!; - [Dependency] private readonly ITileDefinitionManager _tiles = default!; + [Dependency] private IPlacementManager _placement = default!; + [Dependency] private IResourceCache _resources = default!; + [Dependency] private ITileDefinitionManager _tiles = default!; private TileSpawnWindow? _window; private bool _init; @@ -106,7 +106,7 @@ public sealed class TileSpawningUIController : UIController if (_window is { Disposed: false }) return; _window = UIManager.CreateWindow(); - LayoutContainer.SetAnchorPreset(_window,LayoutContainer.LayoutPreset.CenterLeft); + LayoutContainer.SetAnchorPreset(_window, LayoutContainer.LayoutPreset.CenterLeft); _window.ClearButton.OnPressed += OnTileClearPressed; _window.SearchBar.OnTextChanged += OnTileSearchChanged; _window.TileList.OnItemSelected += OnTileItemSelected; diff --git a/Robust.Client/UserInterface/Controllers/UIController.cs b/Robust.Client/UserInterface/Controllers/UIController.cs index 8bf3c1d225..d248d37ea0 100644 --- a/Robust.Client/UserInterface/Controllers/UIController.cs +++ b/Robust.Client/UserInterface/Controllers/UIController.cs @@ -16,10 +16,10 @@ namespace Robust.Client.UserInterface.Controllers; /// public abstract partial class UIController : IPostInjectInit { - [Dependency] protected readonly IUserInterfaceManager UIManager = default!; - [Dependency] protected readonly IEntitySystemManager EntitySystemManager = default!; - [Dependency] protected readonly IEntityManager EntityManager = default!; - [Dependency] protected readonly ILogManager LogManager = default!; + [Dependency] protected IUserInterfaceManager UIManager = default!; + [Dependency] protected IEntitySystemManager EntitySystemManager = default!; + [Dependency] protected IEntityManager EntityManager = default!; + [Dependency] protected ILogManager LogManager = default!; public ISawmill Log { get; protected set; } = default!; diff --git a/Robust.Client/UserInterface/Controls/ColorSelectorSliders.cs b/Robust.Client/UserInterface/Controls/ColorSelectorSliders.cs index 8dd20f8f40..52c82cf50d 100644 --- a/Robust.Client/UserInterface/Controls/ColorSelectorSliders.cs +++ b/Robust.Client/UserInterface/Controls/ColorSelectorSliders.cs @@ -9,9 +9,9 @@ using Robust.Shared.Maths; namespace Robust.Client.UserInterface.Controls; // condensed version of the original ColorSlider set -public sealed class ColorSelectorSliders : Control +public sealed partial class ColorSelectorSliders : Control { - [Dependency] private readonly ILocalizationManager _localization = default!; + [Dependency] private ILocalizationManager _localization = default!; public Color Color { diff --git a/Robust.Client/UserInterface/Controls/LineEdit.cs b/Robust.Client/UserInterface/Controls/LineEdit.cs index dd3a49a85f..7aff690152 100644 --- a/Robust.Client/UserInterface/Controls/LineEdit.cs +++ b/Robust.Client/UserInterface/Controls/LineEdit.cs @@ -19,10 +19,10 @@ namespace Robust.Client.UserInterface.Controls /// Allows the user to input and modify a line of text. /// [Virtual] - public class LineEdit : Control + public partial class LineEdit : Control { - [Dependency] private readonly IConfigurationManager _cfgManager = default!; - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private IConfigurationManager _cfgManager = default!; + [Dependency] private IGameTiming _timing = default!; private const float MouseScrollDelay = 0.001f; @@ -292,12 +292,12 @@ namespace Robust.Client.UserInterface.Controls if (_lastMousePosition < contentBox.Left) { - _drawOffset = Math.Max(0, _drawOffset - (int) Math.Ceiling(args.DeltaSeconds / MouseScrollDelay)); + _drawOffset = Math.Max(0, _drawOffset - (int)Math.Ceiling(args.DeltaSeconds / MouseScrollDelay)); } else if (_lastMousePosition > contentBox.Right) { // Will get clamped inside rendering code. - _drawOffset += (int) Math.Ceiling(args.DeltaSeconds / MouseScrollDelay); + _drawOffset += (int)Math.Ceiling(args.DeltaSeconds / MouseScrollDelay); } var index = GetIndexAtPos(MathHelper.Clamp(_lastMousePosition, contentBox.Left, contentBox.Right)); @@ -1154,7 +1154,7 @@ namespace Robust.Client.UserInterface.Controls contentBox.Right, contentBox.Bottom); - window.TextInputSetRect((UIBox2i) imeBox.Translated(GlobalPixelPosition), actualCursorPosition); + window.TextInputSetRect((UIBox2i)imeBox.Translated(GlobalPixelPosition), actualCursorPosition); } } diff --git a/Robust.Client/UserInterface/Controls/OSWindow.cs b/Robust.Client/UserInterface/Controls/OSWindow.cs index ce1ff10b48..2bf3a83de6 100644 --- a/Robust.Client/UserInterface/Controls/OSWindow.cs +++ b/Robust.Client/UserInterface/Controls/OSWindow.cs @@ -12,9 +12,9 @@ namespace Robust.Client.UserInterface.Controls /// /// [Virtual] - public class OSWindow : Control + public partial class OSWindow : Control { - [Dependency] private readonly IClyde _clyde = default!; + [Dependency] private IClyde _clyde = default!; private string _title = "Window"; private WindowRoot? _root; @@ -107,10 +107,10 @@ namespace Robust.Client.UserInterface.Controls var parameters = new WindowCreateParameters(); if (!float.IsNaN(SetWidth)) - parameters.Width = (int) SetWidth; + parameters.Width = (int)SetWidth; if (!float.IsNaN(SetHeight)) - parameters.Height = (int) SetHeight; + parameters.Height = (int)SetHeight; if (SizeToContent != WindowSizeToContent.Manual) { diff --git a/Robust.Client/UserInterface/Controls/OutputPanel.cs b/Robust.Client/UserInterface/Controls/OutputPanel.cs index e0d1624bf2..3032434c58 100644 --- a/Robust.Client/UserInterface/Controls/OutputPanel.cs +++ b/Robust.Client/UserInterface/Controls/OutputPanel.cs @@ -15,11 +15,11 @@ namespace Robust.Client.UserInterface.Controls /// A control to handle output of message-by-message output panels, like the debug console and chat panel. /// [Virtual] - public class OutputPanel : Control + public partial class OutputPanel : Control { public const string StyleClassOutputPanelScrollDownButton = "outputPanelScrollDownButton"; - [Dependency] private readonly MarkupTagManager _tagManager = default!; + [Dependency] private MarkupTagManager _tagManager = default!; public const string StylePropertyStyleBox = "stylebox"; diff --git a/Robust.Client/UserInterface/Controls/RichTextLabel.cs b/Robust.Client/UserInterface/Controls/RichTextLabel.cs index b57829ff91..ad8d473e7a 100644 --- a/Robust.Client/UserInterface/Controls/RichTextLabel.cs +++ b/Robust.Client/UserInterface/Controls/RichTextLabel.cs @@ -13,9 +13,9 @@ using Robust.Shared.ViewVariables; namespace Robust.Client.UserInterface.Controls { [Virtual] - public class RichTextLabel : Control + public partial class RichTextLabel : Control { - [Dependency] private readonly MarkupTagManager _tagManager = default!; + [Dependency] private MarkupTagManager _tagManager = default!; private RichTextEntry? _entry; private float _lineHeightScale = 1; diff --git a/Robust.Client/UserInterface/Controls/TextEdit.cs b/Robust.Client/UserInterface/Controls/TextEdit.cs index 4633b995d8..ccba470008 100644 --- a/Robust.Client/UserInterface/Controls/TextEdit.cs +++ b/Robust.Client/UserInterface/Controls/TextEdit.cs @@ -34,12 +34,12 @@ namespace Robust.Client.UserInterface.Controls; /// Cursor positions and such should never be inside a surrogate pair, however. /// /// -public sealed class TextEdit : Control +public sealed partial class TextEdit : Control { - [Dependency] private readonly IClipboardManager _clipboard = null!; + [Dependency] private IClipboardManager _clipboard = null!; // @formatter:off - public const string StylePropertyCursorColor = "cursor-color"; + public const string StylePropertyCursorColor = "cursor-color"; public const string StylePropertySelectionColor = "selection-color"; public const string StylePseudoClassNotEditable = "notEditable"; public const string StylePseudoClassPlaceholder = "placeholder"; @@ -556,130 +556,130 @@ public sealed class TextEdit : Control switch (type) { case MoveType.Left: - { - if (breakingSelection) { - // If we're breaking an active selection, move to the lower side of it. - return SelectionLower; + if (breakingSelection) + { + // If we're breaking an active selection, move to the lower side of it. + return SelectionLower; + } + + var (_, lineStart, _) = GetLineForCursorPos(_cursorPosition); + + if (_cursorPosition.Bias == LineBreakBias.Bottom && _cursorPosition.Index == lineStart) + { + // Swap cursor bias around to make the cursor appear at the end of the previous line. + // This maintains the index, it's the same position in the text + return _cursorPosition with { Bias = LineBreakBias.Top }; + } + + var newPos = CursorShiftedLeft(); + // Explicit newlines work kinda funny with bias, so keep it at top there. + var bias = _cursorPosition.Index == TextLength || Rope.Index(TextRope, newPos) == '\n' + ? LineBreakBias.Top + : LineBreakBias.Bottom; + + return new CursorPos(newPos, bias); } - - var (_, lineStart, _) = GetLineForCursorPos(_cursorPosition); - - if (_cursorPosition.Bias == LineBreakBias.Bottom && _cursorPosition.Index == lineStart) - { - // Swap cursor bias around to make the cursor appear at the end of the previous line. - // This maintains the index, it's the same position in the text - return _cursorPosition with { Bias = LineBreakBias.Top }; - } - - var newPos = CursorShiftedLeft(); - // Explicit newlines work kinda funny with bias, so keep it at top there. - var bias = _cursorPosition.Index == TextLength || Rope.Index(TextRope, newPos) == '\n' - ? LineBreakBias.Top - : LineBreakBias.Bottom; - - return new CursorPos(newPos, bias); - } case MoveType.Right: - { - if (breakingSelection) { - return SelectionUpper; - } + if (breakingSelection) + { + return SelectionUpper; + } - var (_, _, lineEnd) = GetLineForCursorPos(_cursorPosition); - // Explicit newlines work kinda funny with bias, so keep it at top there. - if (_cursorPosition.Bias == LineBreakBias.Top - && _cursorPosition.Index == lineEnd - && _cursorPosition.Index != TextLength - && Rope.Index(TextRope, _cursorPosition.Index) != '\n') - { - // Swap cursor bias around to make the cursor appear at the start of the next line. - // This maintains the index, it's the same position in the text. - return _cursorPosition with { Bias = LineBreakBias.Bottom }; - } + var (_, _, lineEnd) = GetLineForCursorPos(_cursorPosition); + // Explicit newlines work kinda funny with bias, so keep it at top there. + if (_cursorPosition.Bias == LineBreakBias.Top + && _cursorPosition.Index == lineEnd + && _cursorPosition.Index != TextLength + && Rope.Index(TextRope, _cursorPosition.Index) != '\n') + { + // Swap cursor bias around to make the cursor appear at the start of the next line. + // This maintains the index, it's the same position in the text. + return _cursorPosition with { Bias = LineBreakBias.Bottom }; + } - return new CursorPos(CursorShiftedRight(), LineBreakBias.Top); - } + return new CursorPos(CursorShiftedRight(), LineBreakBias.Top); + } case MoveType.LeftWord: - { - var runes = Rope.EnumerateRunesReverse(TextRope, _cursorPosition.Index); - var pos = _cursorPosition.Index + TextEditShared.PrevWordPosition(runes.GetEnumerator()); + { + var runes = Rope.EnumerateRunesReverse(TextRope, _cursorPosition.Index); + var pos = _cursorPosition.Index + TextEditShared.PrevWordPosition(runes.GetEnumerator()); - return new CursorPos(pos, LineBreakBias.Bottom); - } + return new CursorPos(pos, LineBreakBias.Bottom); + } case MoveType.RightWord: - { - var runes = Rope.EnumerateRunes(TextRope, _cursorPosition.Index); - var pos = _cursorPosition.Index + TextEditShared.EndWordPosition(runes.GetEnumerator()); + { + var runes = Rope.EnumerateRunes(TextRope, _cursorPosition.Index); + var pos = _cursorPosition.Index + TextEditShared.EndWordPosition(runes.GetEnumerator()); - return new CursorPos(pos, LineBreakBias.Bottom); - } + return new CursorPos(pos, LineBreakBias.Bottom); + } case MoveType.Up: - { - var cursor = _cursorPosition; - if (breakingSelection) { - // If we're in a selection, we move from the selection LOWER upwards, not the cursor position. - InvalidateHorizontalCursorPos(); + var cursor = _cursorPosition; + if (breakingSelection) + { + // If we're in a selection, we move from the selection LOWER upwards, not the cursor position. + InvalidateHorizontalCursorPos(); - cursor = SelectionLower; + cursor = SelectionLower; + } + + CacheHorizontalCursorPos(cursor); + DebugTools.Assert(_horizontalCursorPos.HasValue, "Horizontal cursor pos must be cached!"); + + var (line, _, _) = GetLineForCursorPos(cursor); + + if (line == 0) + { + // We're on the top line already, move to the start of it instead. + return new CursorPos(0, LineBreakBias.Top); + } + + keepHorizontalCursorPos = true; + + return GetIndexAtHorizontalPos(line - 1, _horizontalCursorPos!.Value); } - - CacheHorizontalCursorPos(cursor); - DebugTools.Assert(_horizontalCursorPos.HasValue, "Horizontal cursor pos must be cached!"); - - var (line, _, _) = GetLineForCursorPos(cursor); - - if (line == 0) - { - // We're on the top line already, move to the start of it instead. - return new CursorPos(0, LineBreakBias.Top); - } - - keepHorizontalCursorPos = true; - - return GetIndexAtHorizontalPos(line - 1, _horizontalCursorPos!.Value); - } case MoveType.Down: - { - var cursor = _cursorPosition; - if (breakingSelection) { - // If we're in a selection, we move from the selection LOWER upwards, not the cursor position. - InvalidateHorizontalCursorPos(); + var cursor = _cursorPosition; + if (breakingSelection) + { + // If we're in a selection, we move from the selection LOWER upwards, not the cursor position. + InvalidateHorizontalCursorPos(); - cursor = SelectionUpper; + cursor = SelectionUpper; + } + + CacheHorizontalCursorPos(cursor); + DebugTools.Assert(_horizontalCursorPos.HasValue, "Horizontal cursor pos must be cached!"); + + var (line, _, _) = GetLineForCursorPos(cursor); + + if (line == _lineBreaks.Count) + { + // On the last line already, move to the end of it. + return new CursorPos(TextLength, LineBreakBias.Top); + } + + keepHorizontalCursorPos = true; + + return GetIndexAtHorizontalPos(line + 1, _horizontalCursorPos!.Value); } - - CacheHorizontalCursorPos(cursor); - DebugTools.Assert(_horizontalCursorPos.HasValue, "Horizontal cursor pos must be cached!"); - - var (line, _, _) = GetLineForCursorPos(cursor); - - if (line == _lineBreaks.Count) - { - // On the last line already, move to the end of it. - return new CursorPos(TextLength, LineBreakBias.Top); - } - - keepHorizontalCursorPos = true; - - return GetIndexAtHorizontalPos(line + 1, _horizontalCursorPos!.Value); - } case MoveType.BeginOfLine: - { - var (_, lineStart, _) = GetLineForCursorPos(_cursorPosition); - if (Rope.Index(TextRope, lineStart) == '\n') - lineStart += 1; + { + var (_, lineStart, _) = GetLineForCursorPos(_cursorPosition); + if (Rope.Index(TextRope, lineStart) == '\n') + lineStart += 1; - return new CursorPos(lineStart, LineBreakBias.Bottom); - } + return new CursorPos(lineStart, LineBreakBias.Bottom); + } case MoveType.EndOfLine: - { - var (_, _, lineEnd) = GetLineForCursorPos(_cursorPosition); - return new CursorPos(lineEnd, LineBreakBias.Top); - } + { + var (_, _, lineEnd) = GetLineForCursorPos(_cursorPosition); + return new CursorPos(lineEnd, LineBreakBias.Top); + } default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } @@ -1373,7 +1373,7 @@ public sealed class TextEdit : Control baseLine.Y + descent); var cursorOffset = baseLine.X - drawBox.Left; - window.TextInputSetRect(box.Translated(GlobalPixelPosition), (int) cursorOffset); + window.TextInputSetRect(box.Translated(GlobalPixelPosition), (int)cursorOffset); } } @@ -1482,7 +1482,7 @@ public sealed class TextEdit : Control public enum LineBreakBias : byte { // @formatter:off - Top = 0, + Top = 0, Bottom = 1 // @formatter:on } @@ -1547,17 +1547,17 @@ public sealed class TextEdit : Control private enum MoveType { // @formatter:off - Left = 1 << 0, - Right = 1 << 1, - LeftWord = 1 << 2, - RightWord = 1 << 3, - Up = 1 << 4, - Down = 1 << 5, - BeginOfLine = 1 << 6, - EndOfLine = 1 << 7, + Left = 1 << 0, + Right = 1 << 1, + LeftWord = 1 << 2, + RightWord = 1 << 3, + Up = 1 << 4, + Down = 1 << 5, + BeginOfLine = 1 << 6, + EndOfLine = 1 << 7, - ActionMask = (1 << 16) - 1, - SelectFlag = 1 << 16, + ActionMask = (1 << 16) - 1, + SelectFlag = 1 << 16, // @formatter:on } } @@ -1568,9 +1568,9 @@ public sealed class TextEdit : Control // // bind F12 Command textedit_ropeviz -internal sealed class TextEditRopeVizCommand : IConsoleCommand +internal sealed partial class TextEditRopeVizCommand : IConsoleCommand { - [Dependency] private readonly IUserInterfaceManager _ui = default!; + [Dependency] private IUserInterfaceManager _ui = default!; public string Command => "textedit_ropeviz"; public string Description => ""; @@ -1586,9 +1586,9 @@ internal sealed class TextEditRopeVizCommand : IConsoleCommand } // bind F11 Command textedit_rebalance -internal sealed class TextEditRebalanceCommand : IConsoleCommand +internal sealed partial class TextEditRebalanceCommand : IConsoleCommand { - [Dependency] private readonly IUserInterfaceManager _ui = default!; + [Dependency] private IUserInterfaceManager _ui = default!; public string Command => "textedit_rebalance"; public string Description => ""; @@ -1604,9 +1604,9 @@ internal sealed class TextEditRebalanceCommand : IConsoleCommand } // bind F10 Command textedit_debugoverlay -internal sealed class TextEditDebugOverlayCommand : IConsoleCommand +internal sealed partial class TextEditDebugOverlayCommand : IConsoleCommand { - [Dependency] private readonly IUserInterfaceManager _ui = default!; + [Dependency] private IUserInterfaceManager _ui = default!; public string Command => "textedit_debugoverlay"; public string Description => ""; @@ -1622,9 +1622,9 @@ internal sealed class TextEditDebugOverlayCommand : IConsoleCommand } // bind F9 Command textedit_queuelinebreak -internal sealed class TextEditQueueLineBreakCommand : IConsoleCommand +internal sealed partial class TextEditQueueLineBreakCommand : IConsoleCommand { - [Dependency] private readonly IUserInterfaceManager _ui = default!; + [Dependency] private IUserInterfaceManager _ui = default!; public string Command => "textedit_queuelinebreak"; public string Description => ""; diff --git a/Robust.Client/UserInterface/CustomControls/DebugConsole.xaml.cs b/Robust.Client/UserInterface/CustomControls/DebugConsole.xaml.cs index 687333ef42..6e70268465 100644 --- a/Robust.Client/UserInterface/CustomControls/DebugConsole.xaml.cs +++ b/Robust.Client/UserInterface/CustomControls/DebugConsole.xaml.cs @@ -42,10 +42,10 @@ namespace Robust.Client.UserInterface.CustomControls [GenerateTypedNameReferences] public sealed partial class DebugConsole : Control, IDebugConsoleView { - [Dependency] private readonly IClientConsoleHost _consoleHost = default!; - [Dependency] private readonly IResourceManager _resourceManager = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private IClientConsoleHost _consoleHost = default!; + [Dependency] private IResourceManager _resourceManager = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private ILogManager _logMan = default!; private static readonly ResPath HistoryPath = new("/debug_console_history.json"); diff --git a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugClydePanel.cs b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugClydePanel.cs index 25f1046e9b..07cf0191d2 100644 --- a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugClydePanel.cs +++ b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugClydePanel.cs @@ -8,9 +8,9 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.CustomControls.DebugMonitorControls { - internal sealed class DebugClydePanel : PanelContainer + internal sealed partial class DebugClydePanel : PanelContainer { - [Dependency] private readonly IClydeInternal _clydeInternal = default!; + [Dependency] private IClydeInternal _clydeInternal = default!; private readonly Label _label; @@ -54,7 +54,7 @@ Version: {info.VersionString}"); _textBuilder.Append($@"Draw Calls: Cly: {stats.LastClydeDrawCalls} GL: {stats.LastGLDrawCalls} Batches: {stats.LastBatches} Max size: ({stats.LargestBatchSize.vertices} vtx, {stats.LargestBatchSize.vertices} idx) -Lights: {stats.TotalLights}, Shadowcasting: {stats.ShadowLights}, Occluders: {stats.Occluders}, Entities: { stats.Entities}"); +Lights: {stats.TotalLights}, Shadowcasting: {stats.ShadowLights}, Occluders: {stats.Occluders}, Entities: {stats.Entities}"); _label.TextMemory = FormatHelpers.BuilderToMemory(_textBuilder, _textBuffer); } diff --git a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugCoordsPanel.cs b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugCoordsPanel.cs index 2b1f8c6ca9..86ff546fb2 100644 --- a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugCoordsPanel.cs +++ b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugCoordsPanel.cs @@ -12,15 +12,15 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.CustomControls.DebugMonitorControls { - internal sealed class DebugCoordsPanel : PanelContainer + internal sealed partial class DebugCoordsPanel : PanelContainer { - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IClyde _displayManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IBaseClient _baseClient = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IInputManager _inputManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IClyde _displayManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IBaseClient _baseClient = default!; private readonly StringBuilder _textBuilder = new(); private readonly char[] _textBuffer = new char[1024]; diff --git a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugInputPanel.cs b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugInputPanel.cs index 855d5480a7..36afd47ad2 100644 --- a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugInputPanel.cs +++ b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugInputPanel.cs @@ -9,9 +9,9 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.CustomControls.DebugMonitorControls { - internal sealed class DebugInputPanel : PanelContainer + internal sealed partial class DebugInputPanel : PanelContainer { - [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private IInputManager _inputManager = default!; private readonly Label _label; diff --git a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugMonitors.cs b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugMonitors.cs index 684bc885fb..c1b52ee958 100644 --- a/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugMonitors.cs +++ b/Robust.Client/UserInterface/CustomControls/DebugMonitorControls/DebugMonitors.cs @@ -9,12 +9,12 @@ using Robust.Shared.Network; namespace Robust.Client.UserInterface.CustomControls.DebugMonitorControls { - internal sealed class DebugMonitors : BoxContainer, IDebugMonitors + internal sealed partial class DebugMonitors : BoxContainer, IDebugMonitors { - [Dependency] private readonly IClientGameTiming _timing = default!; - [Dependency] private readonly IClientGameStateManager _state = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IClientNetManager _net = default!; + [Dependency] private IClientGameTiming _timing = default!; + [Dependency] private IClientGameStateManager _state = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IClientNetManager _net = default!; private readonly Control[] _monitors = new Control[Enum.GetNames().Length]; @@ -33,7 +33,7 @@ namespace Robust.Client.UserInterface.CustomControls.DebugMonitorControls Add(DebugMonitor.Memory, new DebugMemoryPanel()); Add(DebugMonitor.Clyde, new DebugClydePanel { HorizontalAlignment = HAlignment.Left }); Add(DebugMonitor.System, new DebugSystemPanel { HorizontalAlignment = HAlignment.Left }); - Add(DebugMonitor.Version, new DebugVersionPanel(_cfg) {HorizontalAlignment = HAlignment.Left}); + Add(DebugMonitor.Version, new DebugVersionPanel(_cfg) { HorizontalAlignment = HAlignment.Left }); Add(DebugMonitor.Input, new DebugInputPanel { HorizontalAlignment = HAlignment.Left }); Add(DebugMonitor.Prof, new LiveProfileViewControl()); diff --git a/Robust.Client/UserInterface/CustomControls/EntitySpawnWindow.xaml.cs b/Robust.Client/UserInterface/CustomControls/EntitySpawnWindow.xaml.cs index c68ed5b5ca..d3e02ff645 100644 --- a/Robust.Client/UserInterface/CustomControls/EntitySpawnWindow.xaml.cs +++ b/Robust.Client/UserInterface/CustomControls/EntitySpawnWindow.xaml.cs @@ -19,8 +19,8 @@ namespace Robust.Client.UserInterface.CustomControls { private static readonly LocId NoDescriptionMessage = "entity-spawn-window-no-description"; - [Dependency] private readonly ILocalizationManager _loc = default!; - [Dependency] private readonly IPlacementManager _placement = default!; + [Dependency] private ILocalizationManager _loc = default!; + [Dependency] private IPlacementManager _placement = default!; public EntitySpawnButton? SelectedButton; public EntityPrototype? SelectedPrototype; diff --git a/Robust.Client/UserInterface/CustomControls/ViewportContainer.cs b/Robust.Client/UserInterface/CustomControls/ViewportContainer.cs index 42aa54835e..d0fc29051b 100644 --- a/Robust.Client/UserInterface/CustomControls/ViewportContainer.cs +++ b/Robust.Client/UserInterface/CustomControls/ViewportContainer.cs @@ -12,11 +12,11 @@ namespace Robust.Client.UserInterface.CustomControls /// A viewport container shows a viewport. /// [Virtual] - public class ViewportContainer : Control, IViewportControl + public partial class ViewportContainer : Control, IViewportControl { - [Dependency] private readonly IClyde _displayManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IInputManager _inputManager = default!; + [Dependency] private IClyde _displayManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IInputManager _inputManager = default!; public IClydeViewport? Viewport { get; set; } @@ -83,7 +83,7 @@ namespace Robust.Client.UserInterface.CustomControls Viewport.Render(); handle.DrawingHandleScreen.DrawTextureRect(Viewport.RenderTarget.Texture, - UIBox2.FromDimensions(new Vector2(0, 0), (Vector2i) (Viewport.Size / _viewportResolution))); + UIBox2.FromDimensions(new Vector2(0, 0), (Vector2i)(Viewport.Size / _viewportResolution))); Viewport.RenderScreenOverlaysAbove(handle, this, viewportBounds); } @@ -93,7 +93,7 @@ namespace Robust.Client.UserInterface.CustomControls { Viewport?.Dispose(); Viewport = _displayManager.CreateViewport( - Vector2i.ComponentMax((1, 1), (Vector2i) (PixelSize * _viewportResolution)), + Vector2i.ComponentMax((1, 1), (Vector2i)(PixelSize * _viewportResolution)), "ViewportContainerViewport"); } diff --git a/Robust.Client/UserInterface/DevWindow/DevWindowTabPerf.xaml.cs b/Robust.Client/UserInterface/DevWindow/DevWindowTabPerf.xaml.cs index 8db8340488..3dd3d58ab5 100644 --- a/Robust.Client/UserInterface/DevWindow/DevWindowTabPerf.xaml.cs +++ b/Robust.Client/UserInterface/DevWindow/DevWindowTabPerf.xaml.cs @@ -9,7 +9,7 @@ namespace Robust.Client.UserInterface; [GenerateTypedNameReferences] public sealed partial class DevWindowTabPerf : Control { - [Dependency] private readonly ProfViewManager _profViewMgr = default!; + [Dependency] private ProfViewManager _profViewMgr = default!; private ProfViewManager.Snapshot? _currentSnapshot; diff --git a/Robust.Client/UserInterface/DevWindow/DevWindowTabRenderTargets.xaml.cs b/Robust.Client/UserInterface/DevWindow/DevWindowTabRenderTargets.xaml.cs index dbc7c69aea..d2116db716 100644 --- a/Robust.Client/UserInterface/DevWindow/DevWindowTabRenderTargets.xaml.cs +++ b/Robust.Client/UserInterface/DevWindow/DevWindowTabRenderTargets.xaml.cs @@ -19,8 +19,8 @@ namespace Robust.Client.UserInterface; [GenerateTypedNameReferences] internal sealed partial class DevWindowTabRenderTargets : Control { - [Dependency] private readonly IClydeInternal _clyde = default!; - [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private IClydeInternal _clyde = default!; + [Dependency] private ILocalizationManager _loc = default!; private readonly Control[] _gridHeader; diff --git a/Robust.Client/UserInterface/DevWindow/DevWindowTabTextures.xaml.cs b/Robust.Client/UserInterface/DevWindow/DevWindowTabTextures.xaml.cs index d918c24224..7b8a10b347 100644 --- a/Robust.Client/UserInterface/DevWindow/DevWindowTabTextures.xaml.cs +++ b/Robust.Client/UserInterface/DevWindow/DevWindowTabTextures.xaml.cs @@ -17,8 +17,8 @@ namespace Robust.Client.UserInterface; [GenerateTypedNameReferences] internal sealed partial class DevWindowTabTextures : Control { - [Dependency] private readonly IClydeInternal _clyde = null!; - [Dependency] private readonly ILocalizationManager _loc = null!; + [Dependency] private IClydeInternal _clyde = null!; + [Dependency] private ILocalizationManager _loc = null!; public DevWindowTabTextures() { diff --git a/Robust.Client/UserInterface/DevWindow/DevWindowTabUI.xaml.cs b/Robust.Client/UserInterface/DevWindow/DevWindowTabUI.xaml.cs index a7343f4eb3..9fa38da46f 100644 --- a/Robust.Client/UserInterface/DevWindow/DevWindowTabUI.xaml.cs +++ b/Robust.Client/UserInterface/DevWindow/DevWindowTabUI.xaml.cs @@ -16,8 +16,8 @@ namespace Robust.Client.UserInterface; [GenerateTypedNameReferences] public sealed partial class DevWindowTabUI : Control { - [Dependency] private readonly IClydeInternal _clyde = default!; - [Dependency] private readonly IInputManager _input = default!; + [Dependency] private IClydeInternal _clyde = default!; + [Dependency] private IInputManager _input = default!; public Control? SelectedControl { get; private set; } private Dictionary ControlMap { get; } = new(); diff --git a/Robust.Client/UserInterface/DevWindow/ProfGraphView.cs b/Robust.Client/UserInterface/DevWindow/ProfGraphView.cs index f5f112b7b5..69466c7789 100644 --- a/Robust.Client/UserInterface/DevWindow/ProfGraphView.cs +++ b/Robust.Client/UserInterface/DevWindow/ProfGraphView.cs @@ -12,12 +12,12 @@ using Robust.Shared.Profiling; namespace Robust.Client.UserInterface; -internal sealed class ProfGraphView : Control +internal sealed partial class ProfGraphView : Control { private const int HeightFps = 15; - private const float MaxHeightMs = 1 / (float) HeightFps; + private const float MaxHeightMs = 1 / (float)HeightFps; - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; private ProfViewManager.Snapshot? _snapshot; @@ -72,7 +72,7 @@ internal sealed class ProfGraphView : Control return; var trackedFrameCount = _snapshot.EndFrame - _snapshot.StartFrame + 1; - var frame = MathHelper.Clamp((int)(pos.X / Width * trackedFrameCount), 0, trackedFrameCount-1); + var frame = MathHelper.Clamp((int)(pos.X / Width * trackedFrameCount), 0, trackedFrameCount - 1); FrameSelected?.Invoke(frame + _snapshot.StartFrame); } @@ -88,7 +88,7 @@ internal sealed class ProfGraphView : Control ref var buffer = ref _snapshot.Buffer; - var barWidth = PixelWidth / (float) trackedFrameCount; + var barWidth = PixelWidth / (float)trackedFrameCount; var x = PixelWidth - barWidth; var controlHeight = PixelHeight; diff --git a/Robust.Client/UserInterface/DevWindow/ProfSettings.xaml.cs b/Robust.Client/UserInterface/DevWindow/ProfSettings.xaml.cs index ccfbb10faa..cfc6ce7034 100644 --- a/Robust.Client/UserInterface/DevWindow/ProfSettings.xaml.cs +++ b/Robust.Client/UserInterface/DevWindow/ProfSettings.xaml.cs @@ -11,7 +11,7 @@ namespace Robust.Client.UserInterface; [GenerateTypedNameReferences] internal sealed partial class ProfSettings : Control { - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; public ProfSettings() { diff --git a/Robust.Client/UserInterface/DevWindow/ProfTree.xaml.cs b/Robust.Client/UserInterface/DevWindow/ProfTree.xaml.cs index d35de5f239..1dacb4278e 100644 --- a/Robust.Client/UserInterface/DevWindow/ProfTree.xaml.cs +++ b/Robust.Client/UserInterface/DevWindow/ProfTree.xaml.cs @@ -16,8 +16,8 @@ internal sealed partial class ProfTree : Control { public const float TreeLevelMargin = 16; - [Dependency] private readonly ProfManager _prof = default!; - [Dependency] private readonly ProfViewManager _profViewMgr = default!; + [Dependency] private ProfManager _prof = default!; + [Dependency] private ProfViewManager _profViewMgr = default!; private ProfViewManager.Snapshot? _snapshot; public long Frame; diff --git a/Robust.Client/UserInterface/RichText/BoldItalicTag.cs b/Robust.Client/UserInterface/RichText/BoldItalicTag.cs index aada7c8f99..889d49927e 100644 --- a/Robust.Client/UserInterface/RichText/BoldItalicTag.cs +++ b/Robust.Client/UserInterface/RichText/BoldItalicTag.cs @@ -5,12 +5,12 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.RichText; -public sealed class BoldItalicTag : IMarkupTagHandler +public sealed partial class BoldItalicTag : IMarkupTagHandler { public const string BoldItalicFont = "DefaultBoldItalic"; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; public string Name => "bolditalic"; diff --git a/Robust.Client/UserInterface/RichText/BoldTag.cs b/Robust.Client/UserInterface/RichText/BoldTag.cs index 261e9e88da..741885d842 100644 --- a/Robust.Client/UserInterface/RichText/BoldTag.cs +++ b/Robust.Client/UserInterface/RichText/BoldTag.cs @@ -6,12 +6,12 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.RichText; -public sealed class BoldTag : IMarkupTagHandler +public sealed partial class BoldTag : IMarkupTagHandler { public const string BoldFont = "DefaultBold"; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; public string Name => "bold"; diff --git a/Robust.Client/UserInterface/RichText/CommandLinkTag.cs b/Robust.Client/UserInterface/RichText/CommandLinkTag.cs index 0a7833209a..743ab15f88 100644 --- a/Robust.Client/UserInterface/RichText/CommandLinkTag.cs +++ b/Robust.Client/UserInterface/RichText/CommandLinkTag.cs @@ -8,9 +8,9 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.RichText; -public sealed class CommandLinkTag : IMarkupTagHandler +public sealed partial class CommandLinkTag : IMarkupTagHandler { - [Dependency] private readonly IClientConsoleHost _clientConsoleHost = default!; + [Dependency] private IClientConsoleHost _clientConsoleHost = default!; public string Name => "cmdlink"; diff --git a/Robust.Client/UserInterface/RichText/FontTag.cs b/Robust.Client/UserInterface/RichText/FontTag.cs index 8043c3484e..1bf76898f5 100644 --- a/Robust.Client/UserInterface/RichText/FontTag.cs +++ b/Robust.Client/UserInterface/RichText/FontTag.cs @@ -12,13 +12,13 @@ namespace Robust.Client.UserInterface.RichText; /// Applies the font provided as the tags parameter to the markup drawing context. /// Definitely not save for user supplied markup /// -public sealed class FontTag : IMarkupTagHandler +public sealed partial class FontTag : IMarkupTagHandler { public const string DefaultFont = "Default"; public const int DefaultSize = 12; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; public string Name => "font"; @@ -86,7 +86,7 @@ public sealed class FontTag : IMarkupTagHandler } if (node.Attributes.TryGetValue("size", out var sizeParameter)) - size = (int) (sizeParameter.LongValue ?? size); + size = (int)(sizeParameter.LongValue ?? size); return size; } diff --git a/Robust.Client/UserInterface/RichText/FontTagHijackHolder.cs b/Robust.Client/UserInterface/RichText/FontTagHijackHolder.cs index 23ce0f9cb7..d6c9226977 100644 --- a/Robust.Client/UserInterface/RichText/FontTagHijackHolder.cs +++ b/Robust.Client/UserInterface/RichText/FontTagHijackHolder.cs @@ -13,9 +13,9 @@ public delegate Font? FontTagHijack(ProtoId protoId, int size); /// /// Allows replacing font resolution done by /// -public sealed class FontTagHijackHolder +public sealed partial class FontTagHijackHolder { - [Dependency] private readonly IUserInterfaceManager _ui = null!; + [Dependency] private IUserInterfaceManager _ui = null!; /// /// Called when a font prototype gets resolved. diff --git a/Robust.Client/UserInterface/RichText/HeadingTag.cs b/Robust.Client/UserInterface/RichText/HeadingTag.cs index eb742d13b4..d8a12ad5b9 100644 --- a/Robust.Client/UserInterface/RichText/HeadingTag.cs +++ b/Robust.Client/UserInterface/RichText/HeadingTag.cs @@ -6,10 +6,10 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.RichText; -public sealed class HeadingTag : IMarkupTagHandler +public sealed partial class HeadingTag : IMarkupTagHandler { - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; public string Name => "head"; diff --git a/Robust.Client/UserInterface/RichText/ItalicTag.cs b/Robust.Client/UserInterface/RichText/ItalicTag.cs index 15285fb50f..f06c44ff04 100644 --- a/Robust.Client/UserInterface/RichText/ItalicTag.cs +++ b/Robust.Client/UserInterface/RichText/ItalicTag.cs @@ -6,12 +6,12 @@ using Robust.Shared.Utility; namespace Robust.Client.UserInterface.RichText; -public sealed class ItalicTag : IMarkupTagHandler +public sealed partial class ItalicTag : IMarkupTagHandler { public const string ItalicFont = "DefaultItalic"; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; public string Name => "italic"; diff --git a/Robust.Client/UserInterface/RichText/MarkupTagManager.cs b/Robust.Client/UserInterface/RichText/MarkupTagManager.cs index 93667a7c5e..60f2cdc9a5 100644 --- a/Robust.Client/UserInterface/RichText/MarkupTagManager.cs +++ b/Robust.Client/UserInterface/RichText/MarkupTagManager.cs @@ -8,11 +8,11 @@ using Robust.Shared.Sandboxing; namespace Robust.Client.UserInterface.RichText; -public sealed class MarkupTagManager +public sealed partial class MarkupTagManager { - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly ISandboxHelper _sandboxHelper = default!; - [Dependency] private readonly IDependencyCollection _deps = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private ISandboxHelper _sandboxHelper = default!; + [Dependency] private IDependencyCollection _deps = default!; /// /// Tags defined in engine need to be instantiated here because of sandboxing @@ -52,7 +52,7 @@ public sealed class MarkupTagManager if (_engineTypes.Contains(type)) continue; - var instance = (IMarkupTagHandler) _sandboxHelper.CreateInstance(type); + var instance = (IMarkupTagHandler)_sandboxHelper.CreateInstance(type); _markupTagTypes[instance.Name.ToLower()] = instance; } diff --git a/Robust.Client/UserInterface/Screens/DebugBuiltinConnectionScreen.xaml.cs b/Robust.Client/UserInterface/Screens/DebugBuiltinConnectionScreen.xaml.cs index 2b959b7c96..2844a9b169 100644 --- a/Robust.Client/UserInterface/Screens/DebugBuiltinConnectionScreen.xaml.cs +++ b/Robust.Client/UserInterface/Screens/DebugBuiltinConnectionScreen.xaml.cs @@ -21,10 +21,10 @@ namespace Robust.Client.UserInterface.Screens; [GenerateTypedNameReferences, ContentAccessAllowed] public sealed partial class DebugBuiltinConnectionScreen : UIScreen { - [Dependency] private readonly IBaseClient _client = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IUserInterfaceManager _userInterface = default!; - [Dependency] private readonly IClientNetManager _net = default!; + [Dependency] private IBaseClient _client = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IUserInterfaceManager _userInterface = default!; + [Dependency] private IClientNetManager _net = default!; // ReSharper disable once InconsistentNaming private static readonly Regex IPv6Regex = new(@"\[(.*:.*:.*)](?::(\d+))?"); diff --git a/Robust.Client/UserInterface/UiCommands.cs b/Robust.Client/UserInterface/UiCommands.cs index db9fbc732d..4052c06097 100644 --- a/Robust.Client/UserInterface/UiCommands.cs +++ b/Robust.Client/UserInterface/UiCommands.cs @@ -6,9 +6,9 @@ using Robust.Shared.Reflection; namespace Robust.Client.UserInterface { - sealed class ChangeSceneCommpand : LocalizedCommands + sealed partial class ChangeSceneCommpand : LocalizedCommands { - [Dependency] private readonly IReflectionManager _reflection = default!; + [Dependency] private IReflectionManager _reflection = default!; public override string Command => "scene"; public override void Execute(IConsoleShell shell, string argStr, string[] args) diff --git a/Robust.Client/UserInterface/UserInterfaceManager.cs b/Robust.Client/UserInterface/UserInterfaceManager.cs index 4c2c669c2d..942e2f5ffe 100644 --- a/Robust.Client/UserInterface/UserInterfaceManager.cs +++ b/Robust.Client/UserInterface/UserInterfaceManager.cs @@ -34,24 +34,24 @@ namespace Robust.Client.UserInterface /// public static readonly Type XamlHotReloadWarmupType = typeof(DropDownDebugConsole); - [Dependency] private readonly IDependencyCollection _rootDependencies = default!; - [Dependency] private readonly IInputManager _inputManager = default!; - [Dependency] private readonly IFontManager _fontManager = default!; - [Dependency] private readonly IClydeInternal _clyde = default!; - [Dependency] private readonly IResourceCache _resourceCache = default!; - [Dependency] private readonly IEyeManager _eyeManager = default!; - [Dependency] private readonly IStateManager _stateManager = default!; - [Dependency] private readonly IPrototypeManager _protoManager = default!; - [Dependency] private readonly IUserInterfaceManagerInternal _userInterfaceManager = default!; - [Dependency] private readonly IDynamicTypeFactoryInternal _typeFactory = default!; - [Dependency] private readonly IUserInterfaceManager _uiManager = default!; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; - [Dependency] private readonly ProfManager _prof = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IEntitySystemManager _systemManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IRuntimeLog _runtime = default!; - [Dependency] private readonly IClipboardManager _clipboard = null!; + [Dependency] private IDependencyCollection _rootDependencies = default!; + [Dependency] private IInputManager _inputManager = default!; + [Dependency] private IFontManager _fontManager = default!; + [Dependency] private IClydeInternal _clyde = default!; + [Dependency] private IResourceCache _resourceCache = default!; + [Dependency] private IEyeManager _eyeManager = default!; + [Dependency] private IStateManager _stateManager = default!; + [Dependency] private IPrototypeManager _protoManager = default!; + [Dependency] private IUserInterfaceManagerInternal _userInterfaceManager = default!; + [Dependency] private IDynamicTypeFactoryInternal _typeFactory = default!; + [Dependency] private IUserInterfaceManager _uiManager = default!; + [Dependency] private IConfigurationManager _configurationManager = default!; + [Dependency] private ProfManager _prof = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IEntitySystemManager _systemManager = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IRuntimeLog _runtime = default!; + [Dependency] private IClipboardManager _clipboard = null!; private IAudioSource? _clickSource; private IAudioSource? _hoverSource; diff --git a/Robust.Client/UserInterface/XAML/Proxy/XamlHotReloadManager.cs b/Robust.Client/UserInterface/XAML/Proxy/XamlHotReloadManager.cs index 86fb916ec4..d6a83e8d72 100644 --- a/Robust.Client/UserInterface/XAML/Proxy/XamlHotReloadManager.cs +++ b/Robust.Client/UserInterface/XAML/Proxy/XamlHotReloadManager.cs @@ -18,13 +18,13 @@ namespace Robust.Client.UserInterface.XAML.Proxy; /// /// Its behavior is described there. /// -internal sealed class XamlHotReloadManager : IXamlHotReloadManager +internal sealed partial class XamlHotReloadManager : IXamlHotReloadManager { - [Dependency] private readonly IConfigurationManager _cfg = null!; - [Dependency] private readonly ILogManager _logManager = null!; - [Dependency] private readonly IResourceManagerInternal _resources = null!; - [Dependency] private readonly ITaskManager _taskManager = null!; - [Dependency] private readonly IXamlProxyManager _xamlProxyManager = null!; + [Dependency] private IConfigurationManager _cfg = null!; + [Dependency] private ILogManager _logManager = null!; + [Dependency] private IResourceManagerInternal _resources = null!; + [Dependency] private ITaskManager _taskManager = null!; + [Dependency] private IXamlProxyManager _xamlProxyManager = null!; private ISawmill _sawmill = null!; private FileSystemWatcher? _watcher; diff --git a/Robust.Client/UserInterface/XAML/Proxy/XamlProxyHelper.cs b/Robust.Client/UserInterface/XAML/Proxy/XamlProxyHelper.cs index f6ff948064..9857cabdfc 100644 --- a/Robust.Client/UserInterface/XAML/Proxy/XamlProxyHelper.cs +++ b/Robust.Client/UserInterface/XAML/Proxy/XamlProxyHelper.cs @@ -3,7 +3,7 @@ using Robust.Shared.IoC; namespace Robust.Client.UserInterface.XAML.Proxy; -internal sealed class XamlProxyHelper: IXamlProxyHelper +internal sealed partial class XamlProxyHelper : IXamlProxyHelper { [Dependency] private IXamlProxyManager _xamlProxyManager = default!; diff --git a/Robust.Client/UserInterface/XAML/Proxy/XamlProxyManager.cs b/Robust.Client/UserInterface/XAML/Proxy/XamlProxyManager.cs index 4303deff6c..fcd712d3f5 100644 --- a/Robust.Client/UserInterface/XAML/Proxy/XamlProxyManager.cs +++ b/Robust.Client/UserInterface/XAML/Proxy/XamlProxyManager.cs @@ -15,12 +15,12 @@ namespace Robust.Client.UserInterface.XAML.Proxy; /// /// The real implementation of . /// -public sealed class XamlProxyManager: IXamlProxyManager +public sealed partial class XamlProxyManager : IXamlProxyManager { ISawmill _sawmill = null!; [Dependency] IReflectionManager _reflectionManager = null!; [Dependency] ILogManager _logManager = null!; - [Dependency] private readonly IConfigurationManager _cfg = null!; + [Dependency] private IConfigurationManager _cfg = null!; XamlImplementationStorage _xamlImplementationStorage = null!; @@ -120,7 +120,7 @@ public sealed class XamlProxyManager: IXamlProxyManager // initialize XamlJitCompiler lazily because constructing it has // very high CPU cost XamlJitCompiler xjit; - lock(this) + lock (this) { xjit = _xamlJitCompiler ??= new XamlJitCompiler(); } diff --git a/Robust.Client/Utility/DiscordRichPresence.cs b/Robust.Client/Utility/DiscordRichPresence.cs index 971479ce5e..2462bf4f47 100644 --- a/Robust.Client/Utility/DiscordRichPresence.cs +++ b/Robust.Client/Utility/DiscordRichPresence.cs @@ -11,17 +11,17 @@ using LogLevel = DiscordRPC.Logging.LogLevel; namespace Robust.Client.Utility { - internal sealed class DiscordRichPresence : IDiscordRichPresence + internal sealed partial class DiscordRichPresence : IDiscordRichPresence { - private static RichPresence _defaultPresence = new() {}; + private static RichPresence _defaultPresence = new() { }; private RichPresence? _activePresence; private DiscordRpcClient? _client; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private IConfigurationManager _configurationManager = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private ILocalizationManager _loc = default!; private bool _initialized; diff --git a/Robust.Client/Utility/ReloadManager.cs b/Robust.Client/Utility/ReloadManager.cs index 5408f6a9c8..04c7ff60ca 100644 --- a/Robust.Client/Utility/ReloadManager.cs +++ b/Robust.Client/Utility/ReloadManager.cs @@ -14,14 +14,14 @@ using Timer = Robust.Shared.Timing.Timer; namespace Robust.Client.Utility; -internal sealed class ReloadManager : IReloadManager +internal sealed partial class ReloadManager : IReloadManager { - [Dependency] private readonly IClyde _clyde = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly ILogManager _logMan = default!; - [Dependency] private readonly IResourceManagerInternal _res = default!; + [Dependency] private IClyde _clyde = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private ILogManager _logMan = default!; + [Dependency] private IResourceManagerInternal _res = default!; #if TOOLS - [Dependency] private readonly ITaskManager _tasks = default!; + [Dependency] private ITaskManager _tasks = default!; #endif private readonly TimeSpan _reloadDelay = TimeSpan.FromMilliseconds(10); diff --git a/Robust.Client/ViewVariables/ClientViewVariablesManager.cs b/Robust.Client/ViewVariables/ClientViewVariablesManager.cs index 98fe54fba6..a4aecf4df6 100644 --- a/Robust.Client/ViewVariables/ClientViewVariablesManager.cs +++ b/Robust.Client/ViewVariables/ClientViewVariablesManager.cs @@ -20,11 +20,11 @@ namespace Robust.Client.ViewVariables { internal sealed partial class ClientViewVariablesManager : ViewVariablesManager, IClientViewVariablesManagerInternal { - [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!; - [Dependency] private readonly IClientNetManager _netManager = default!; - [Dependency] private readonly IRobustSerializer _robustSerializer = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IViewVariableControlFactory _controlFactory = default!; + [Dependency] private IUserInterfaceManager _userInterfaceManager = default!; + [Dependency] private IClientNetManager _netManager = default!; + [Dependency] private IRobustSerializer _robustSerializer = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IViewVariableControlFactory _controlFactory = default!; private uint _nextReqId = 1; private readonly Vector2i _defaultWindowSize = (640, 420); diff --git a/Robust.Client/ViewVariables/Editors/VVPropEditorEntProtoId.cs b/Robust.Client/ViewVariables/Editors/VVPropEditorEntProtoId.cs index 042145db86..449dd1162c 100644 --- a/Robust.Client/ViewVariables/Editors/VVPropEditorEntProtoId.cs +++ b/Robust.Client/ViewVariables/Editors/VVPropEditorEntProtoId.cs @@ -5,9 +5,9 @@ using Robust.Shared.Prototypes; namespace Robust.Client.ViewVariables.Editors; -internal sealed class VVPropEditorEntProtoId : VVPropEditor +internal sealed partial class VVPropEditorEntProtoId : VVPropEditor { - [Dependency] private readonly IPrototypeManager _protoMan = default!; + [Dependency] private IPrototypeManager _protoMan = default!; public VVPropEditorEntProtoId() { diff --git a/Robust.Client/ViewVariables/Editors/VVPropEditorKeyValuePair.cs b/Robust.Client/ViewVariables/Editors/VVPropEditorKeyValuePair.cs index 0496aa283c..b33e709c0c 100644 --- a/Robust.Client/ViewVariables/Editors/VVPropEditorKeyValuePair.cs +++ b/Robust.Client/ViewVariables/Editors/VVPropEditorKeyValuePair.cs @@ -7,9 +7,9 @@ using static Robust.Client.UserInterface.Controls.BoxContainer; namespace Robust.Client.ViewVariables.Editors { - public sealed class VVPropEditorKeyValuePair : VVPropEditor + public sealed partial class VVPropEditorKeyValuePair : VVPropEditor { - [Dependency] private readonly IClientViewVariablesManagerInternal _viewVariables = default!; + [Dependency] private IClientViewVariablesManagerInternal _viewVariables = default!; private VVPropEditor? _propertyEditorK; private VVPropEditor? _propertyEditorV; @@ -53,8 +53,8 @@ namespace Robust.Client.ViewVariables.Editors public override void WireNetworkSelector(uint sessionId, object[] selectorChain) { - var keySelector = new ViewVariablesSelectorKeyValuePair {Key = true}; - var valueSelector = new ViewVariablesSelectorKeyValuePair {Key = false}; + var keySelector = new ViewVariablesSelectorKeyValuePair { Key = true }; + var valueSelector = new ViewVariablesSelectorKeyValuePair { Key = false }; var keyChain = selectorChain.Append(keySelector).ToArray(); var valueChain = selectorChain.Append(valueSelector).ToArray(); diff --git a/Robust.Client/ViewVariables/Editors/VVPropEditorNullableEntProtoId.cs b/Robust.Client/ViewVariables/Editors/VVPropEditorNullableEntProtoId.cs index cbb0c644b8..9fdd74be8f 100644 --- a/Robust.Client/ViewVariables/Editors/VVPropEditorNullableEntProtoId.cs +++ b/Robust.Client/ViewVariables/Editors/VVPropEditorNullableEntProtoId.cs @@ -5,9 +5,9 @@ using Robust.Shared.Prototypes; namespace Robust.Client.ViewVariables.Editors; -internal sealed class VVPropEditorNullableEntProtoId : VVPropEditor +internal sealed partial class VVPropEditorNullableEntProtoId : VVPropEditor { - [Dependency] private readonly IPrototypeManager _protoMan = default!; + [Dependency] private IPrototypeManager _protoMan = default!; public VVPropEditorNullableEntProtoId() { diff --git a/Robust.Client/ViewVariables/Editors/VVPropEditorProtoId.cs b/Robust.Client/ViewVariables/Editors/VVPropEditorProtoId.cs index 01f977bea4..988f59e7c9 100644 --- a/Robust.Client/ViewVariables/Editors/VVPropEditorProtoId.cs +++ b/Robust.Client/ViewVariables/Editors/VVPropEditorProtoId.cs @@ -7,10 +7,10 @@ using Robust.Shared.Prototypes; namespace Robust.Client.ViewVariables.Editors; -internal sealed class VVPropEditorProtoId : VVPropEditor where T : class, IPrototype +internal sealed partial class VVPropEditorProtoId : VVPropEditor where T : class, IPrototype { - [Dependency] private readonly ILocalizationManager _loc = default!; - [Dependency] private readonly IPrototypeManager _protoManager = default!; + [Dependency] private ILocalizationManager _loc = default!; + [Dependency] private IPrototypeManager _protoManager = default!; private ViewVariablesAddWindow? _addWindow; private LineEdit? _lineEdit; diff --git a/Robust.Client/ViewVariables/Editors/VVPropEditorReference.cs b/Robust.Client/ViewVariables/Editors/VVPropEditorReference.cs index 6ee11b9ff9..f5da332dcc 100644 --- a/Robust.Client/ViewVariables/Editors/VVPropEditorReference.cs +++ b/Robust.Client/ViewVariables/Editors/VVPropEditorReference.cs @@ -6,9 +6,9 @@ using Robust.Shared.ViewVariables; namespace Robust.Client.ViewVariables.Editors { - internal sealed class VVPropEditorReference : VVPropEditor + internal sealed partial class VVPropEditorReference : VVPropEditor { - [Dependency] private readonly IClientViewVariablesManager _vvMan = default!; + [Dependency] private IClientViewVariablesManager _vvMan = default!; private object? _localValue; private ViewVariablesObjectSelector? _selector; @@ -22,7 +22,7 @@ namespace Robust.Client.ViewVariables.Editors { if (value == null) { - return new Label {Text = "null", Align = Label.AlignMode.Right}; + return new Label { Text = "null", Align = Label.AlignMode.Right }; } _localValue = value; diff --git a/Robust.Client/ViewVariables/Editors/VVPropEditorTuple.cs b/Robust.Client/ViewVariables/Editors/VVPropEditorTuple.cs index fab426c663..cac2b499ce 100644 --- a/Robust.Client/ViewVariables/Editors/VVPropEditorTuple.cs +++ b/Robust.Client/ViewVariables/Editors/VVPropEditorTuple.cs @@ -11,9 +11,9 @@ using CS = System.Runtime.CompilerServices; namespace Robust.Client.ViewVariables.Editors; -internal sealed class VVPropEditorTuple : VVPropEditor +internal sealed partial class VVPropEditorTuple : VVPropEditor { - [Dependency] private readonly IClientViewVariablesManagerInternal _viewVariables = default!; + [Dependency] private IClientViewVariablesManagerInternal _viewVariables = default!; private bool _readOnly; private readonly List _tuple = []; @@ -103,7 +103,7 @@ internal sealed class VVPropEditorTuple : VVPropEditor { for (var i = 0; i < _editors.Count; i++) { - object[] chain = [..selectorChain, new ViewVariablesTupleIndexSelector(i)]; + object[] chain = [.. selectorChain, new ViewVariablesTupleIndexSelector(i)]; _editors[i].WireNetworkSelector(sessionId, chain); } } diff --git a/Robust.Client/ViewVariables/ViewVariableControlFactory.cs b/Robust.Client/ViewVariables/ViewVariableControlFactory.cs index 28ffe765f1..8a86939c7f 100644 --- a/Robust.Client/ViewVariables/ViewVariableControlFactory.cs +++ b/Robust.Client/ViewVariables/ViewVariableControlFactory.cs @@ -15,45 +15,45 @@ using CS = System.Runtime.CompilerServices; namespace Robust.Client.ViewVariables; -internal sealed class ViewVariableControlFactory : IViewVariableControlFactory +internal sealed partial class ViewVariableControlFactory : IViewVariableControlFactory { - [Dependency] private readonly IPrototypeManager _protoManager = default!; - [Dependency] private readonly IResourceManager _resManager = default!; - [Dependency] private readonly IDependencyCollection _dependencyManager = default!; + [Dependency] private IPrototypeManager _protoManager = default!; + [Dependency] private IResourceManager _resManager = default!; + [Dependency] private IDependencyCollection _dependencyManager = default!; private readonly Dictionary> _factoriesByType = new(); private readonly List _factoriesWithCondition = new(); public ViewVariableControlFactory() { - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.SByte)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Byte)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.UShort)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Short)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.UInt)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Int)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.ULong)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Long)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Float)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Float)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Double)); - RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Decimal)); - RegisterForType(_ => new VVPropEditorString()); - RegisterForType(_ => new VVPropEditorNullableEntProtoId()); - RegisterForType(_ => new VVPropEditorEntProtoId()); - RegisterForType(_ => new VVPropEditorVector2(intVec: false)); - RegisterForType(_ => new VVPropEditorVector2(intVec: true)); - RegisterForType(_ => new VVPropEditorBoolean()); - RegisterForType(_ => new VVPropEditorAngle()); - RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.Box2)); - RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.Box2i)); - RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.UIBox2)); - RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.UIBox2i)); - RegisterForType(_ => new VVPropEditorEntityCoordinates()); - RegisterForType(_ => new VVPropEditorEntityUid()); - RegisterForType(_ => new VVPropEditorNetEntity()); - RegisterForType(_ => new VVPropEditorColor()); - RegisterForType(_ => new VVPropEditorTimeSpan()); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.SByte)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Byte)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.UShort)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Short)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.UInt)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Int)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.ULong)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Long)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Float)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Float)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Double)); + RegisterForType(_ => new VVPropEditorNumeric(VVPropEditorNumeric.NumberType.Decimal)); + RegisterForType(_ => new VVPropEditorString()); + RegisterForType(_ => new VVPropEditorNullableEntProtoId()); + RegisterForType(_ => new VVPropEditorEntProtoId()); + RegisterForType(_ => new VVPropEditorVector2(intVec: false)); + RegisterForType(_ => new VVPropEditorVector2(intVec: true)); + RegisterForType(_ => new VVPropEditorBoolean()); + RegisterForType(_ => new VVPropEditorAngle()); + RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.Box2)); + RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.Box2i)); + RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.UIBox2)); + RegisterForType(_ => new VVPropEditorUIBox2(VVPropEditorUIBox2.BoxType.UIBox2i)); + RegisterForType(_ => new VVPropEditorEntityCoordinates()); + RegisterForType(_ => new VVPropEditorEntityUid()); + RegisterForType(_ => new VVPropEditorNetEntity()); + RegisterForType(_ => new VVPropEditorColor()); + RegisterForType(_ => new VVPropEditorTimeSpan()); RegisterWithCondition( type => type != typeof(ViewVariablesBlobMembers.ServerValueTypeToken), diff --git a/Robust.Client/ViewVariables/ViewVariablesCommand.cs b/Robust.Client/ViewVariables/ViewVariablesCommand.cs index c9567f3b26..683d2053e2 100644 --- a/Robust.Client/ViewVariables/ViewVariablesCommand.cs +++ b/Robust.Client/ViewVariables/ViewVariablesCommand.cs @@ -9,11 +9,11 @@ using Robust.Shared.ViewVariables.Commands; namespace Robust.Client.ViewVariables { [UsedImplicitly] - public sealed class ViewVariablesCommand : ViewVariablesBaseCommand + public sealed partial class ViewVariablesCommand : ViewVariablesBaseCommand { - [Dependency] private readonly IClientViewVariablesManager _cvvm = default!; - [Dependency] private readonly IUserInterfaceManager _ui = default!; - [Dependency] private readonly IEntityManager _entities = default!; + [Dependency] private IClientViewVariablesManager _cvvm = default!; + [Dependency] private IUserInterfaceManager _ui = default!; + [Dependency] private IEntityManager _entities = default!; public override string Command => "vv"; diff --git a/Robust.Server/Audio/AudioSystem.cs b/Robust.Server/Audio/AudioSystem.cs index 3f2d39241f..4f03a0a7ff 100644 --- a/Robust.Server/Audio/AudioSystem.cs +++ b/Robust.Server/Audio/AudioSystem.cs @@ -20,8 +20,8 @@ namespace Robust.Server.Audio; public sealed partial class AudioSystem : SharedAudioSystem { - [Dependency] private readonly PvsOverrideSystem _pvs = default!; - [Dependency] private readonly IResourceManager _resourceManager = default!; + [Dependency] private PvsOverrideSystem _pvs = default!; + [Dependency] private IResourceManager _resourceManager = default!; private readonly Dictionary _cachedAudioLengths = new(); diff --git a/Robust.Server/BaseServer.cs b/Robust.Server/BaseServer.cs index aed88aa9cc..7275de3726 100644 --- a/Robust.Server/BaseServer.cs +++ b/Robust.Server/BaseServer.cs @@ -51,7 +51,7 @@ namespace Robust.Server /// /// The master class that runs the rest of the engine. /// - internal sealed class BaseServer : IBaseServerInternal, IPostInjectInit + internal sealed partial class BaseServer : IBaseServerInternal, IPostInjectInit { private static readonly Gauge ServerUpTime = Metrics.CreateGauge( "robust_server_uptime", @@ -70,47 +70,47 @@ namespace Robust.Server "Time usage of the main loop Update()s", new HistogramConfiguration { - LabelNames = new[] {"area"}, + LabelNames = new[] { "area" }, Buckets = Histogram.ExponentialBuckets(0.000_01, 2, 13) }); - [Dependency] private readonly INetConfigurationManagerInternal _config = default!; - [Dependency] private readonly IServerEntityManager _entityManager = default!; - [Dependency] private readonly ILogManager _log = default!; - [Dependency] private readonly IRobustSerializer _serializer = default!; - [Dependency] private readonly IGameTiming _time = default!; - [Dependency] private readonly IResourceManagerInternal _resources = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly ITimerManager _timerManager = default!; - [Dependency] private readonly IServerGameStateManager _stateManager = default!; - [Dependency] private readonly IServerNetManager _network = default!; - [Dependency] private readonly ISystemConsoleManager _systemConsole = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; - [Dependency] private readonly IModLoaderInternal _modLoader = default!; - [Dependency] private readonly IWatchdogApiInternal _watchdogApi = default!; - [Dependency] private readonly HubManager _hubManager = default!; - [Dependency] private readonly IScriptHost _scriptHost = default!; - [Dependency] private readonly IMetricsManagerInternal _metricsManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IRobustMappedStringSerializer _stringSerializer = default!; - [Dependency] private readonly ILocalizationManagerInternal _loc = default!; - [Dependency] private readonly IServerConsoleHost _consoleHost = default!; - [Dependency] private readonly IParallelManagerInternal _parallelMgr = default!; - [Dependency] private readonly ProfManager _prof = default!; - [Dependency] private readonly IPrototypeManagerInternal _prototype = default!; - [Dependency] private readonly IPlacementManager _placement = default!; - [Dependency] private readonly IServerViewVariablesInternal _viewVariables = default!; - [Dependency] private readonly ISerializationManager _serialization = default!; - [Dependency] private readonly IStatusHost _statusHost = default!; - [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly IReplayRecordingManagerInternal _replay = default!; - [Dependency] private readonly IGamePrototypeLoadManager _protoLoadMan = default!; - [Dependency] private readonly UploadedContentManager _uploadedContMan = default!; - [Dependency] private readonly NetworkResourceManager _netResMan = default!; - [Dependency] private readonly IReflectionManager _refMan = default!; - [Dependency] private readonly ITransferManager _transfer = default!; - [Dependency] private readonly ServerTransferTestManager _transferTest = default!; + [Dependency] private INetConfigurationManagerInternal _config = default!; + [Dependency] private IServerEntityManager _entityManager = default!; + [Dependency] private ILogManager _log = default!; + [Dependency] private IRobustSerializer _serializer = default!; + [Dependency] private IGameTiming _time = default!; + [Dependency] private IResourceManagerInternal _resources = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private ITimerManager _timerManager = default!; + [Dependency] private IServerGameStateManager _stateManager = default!; + [Dependency] private IServerNetManager _network = default!; + [Dependency] private ISystemConsoleManager _systemConsole = default!; + [Dependency] private ITaskManager _taskManager = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; + [Dependency] private IModLoaderInternal _modLoader = default!; + [Dependency] private IWatchdogApiInternal _watchdogApi = default!; + [Dependency] private HubManager _hubManager = default!; + [Dependency] private IScriptHost _scriptHost = default!; + [Dependency] private IMetricsManagerInternal _metricsManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IRobustMappedStringSerializer _stringSerializer = default!; + [Dependency] private ILocalizationManagerInternal _loc = default!; + [Dependency] private IServerConsoleHost _consoleHost = default!; + [Dependency] private IParallelManagerInternal _parallelMgr = default!; + [Dependency] private ProfManager _prof = default!; + [Dependency] private IPrototypeManagerInternal _prototype = default!; + [Dependency] private IPlacementManager _placement = default!; + [Dependency] private IServerViewVariablesInternal _viewVariables = default!; + [Dependency] private ISerializationManager _serialization = default!; + [Dependency] private IStatusHost _statusHost = default!; + [Dependency] private IComponentFactory _componentFactory = default!; + [Dependency] private IReplayRecordingManagerInternal _replay = default!; + [Dependency] private IGamePrototypeLoadManager _protoLoadMan = default!; + [Dependency] private UploadedContentManager _uploadedContMan = default!; + [Dependency] private NetworkResourceManager _netResMan = default!; + [Dependency] private IReflectionManager _refMan = default!; + [Dependency] private ITransferManager _transfer = default!; + [Dependency] private ServerTransferTestManager _transferTest = default!; private readonly Stopwatch _uptimeStopwatch = new(); @@ -428,7 +428,7 @@ namespace Robust.Server if (OperatingSystem.IsWindows() && _config.GetCVar(CVars.SysWinTickPeriod) >= 0) { - WindowsTickPeriod.TimeBeginPeriod((uint) _config.GetCVar(CVars.SysWinTickPeriod)); + WindowsTickPeriod.TimeBeginPeriod((uint)_config.GetCVar(CVars.SysWinTickPeriod)); } _config.CheckUnusedCVars(); @@ -602,7 +602,7 @@ namespace Robust.Server { _config.OnValueChanged(CVars.NetTickrate, i => { - var b = (ushort) i; + var b = (ushort)i; _time.TickRate = b; _logger.Info($"Tickrate changed to: {b} on tick {_time.CurTick}"); @@ -623,7 +623,7 @@ namespace Robust.Server var startOffset = TimeSpan.FromSeconds(_config.GetCVar(CVars.NetTimeStartOffset)); _time.TimeBase = (startOffset, GameTick.First); - _time.TickRate = (ushort) _config.GetCVar(CVars.NetTickrate); + _time.TickRate = (ushort)_config.GetCVar(CVars.NetTickrate); _logger.Info($"Name: {ServerName}"); _logger.Info($"TickRate: {_time.TickRate}({_time.TickPeriod.TotalMilliseconds:0.00}ms)"); @@ -711,7 +711,7 @@ namespace Robust.Server if (OperatingSystem.IsWindows() && _config.GetCVar(CVars.SysWinTickPeriod) >= 0) { - WindowsTickPeriod.TimeEndPeriod((uint) _config.GetCVar(CVars.SysWinTickPeriod)); + WindowsTickPeriod.TimeEndPeriod((uint)_config.GetCVar(CVars.SysWinTickPeriod)); } _config.Shutdown(); diff --git a/Robust.Server/Configuration/ServerNetConfigurationManager.cs b/Robust.Server/Configuration/ServerNetConfigurationManager.cs index 61e5218181..1ec534824f 100644 --- a/Robust.Server/Configuration/ServerNetConfigurationManager.cs +++ b/Robust.Server/Configuration/ServerNetConfigurationManager.cs @@ -9,10 +9,10 @@ using Robust.Shared.Replays; namespace Robust.Server.Configuration; -internal sealed class ServerNetConfigurationManager : NetConfigurationManager, IServerNetConfigurationManager +internal sealed partial class ServerNetConfigurationManager : NetConfigurationManager, IServerNetConfigurationManager { - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IReplayRecordingManager _replayRecording = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IReplayRecordingManager _replayRecording = default!; private readonly Dictionary> _replicatedCVars = new(); diff --git a/Robust.Server/Console/Commands/AddComponentCommand.cs b/Robust.Server/Console/Commands/AddComponentCommand.cs index c50c985ff0..d1ca64fe6a 100644 --- a/Robust.Server/Console/Commands/AddComponentCommand.cs +++ b/Robust.Server/Console/Commands/AddComponentCommand.cs @@ -6,10 +6,10 @@ using Robust.Shared.IoC; namespace Robust.Server.Console.Commands { [UsedImplicitly] - internal sealed class AddComponentCommand : LocalizedCommands + internal sealed partial class AddComponentCommand : LocalizedCommands { - [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IComponentFactory _componentFactory = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "addcomp"; diff --git a/Robust.Server/Console/Commands/MapCommands.cs b/Robust.Server/Console/Commands/MapCommands.cs index 8e5d4bd866..7f09c3c017 100644 --- a/Robust.Server/Console/Commands/MapCommands.cs +++ b/Robust.Server/Console/Commands/MapCommands.cs @@ -14,10 +14,10 @@ using Robust.Shared.Utility; namespace Robust.Server.Console.Commands { - public sealed class SaveGridCommand : LocalizedCommands + public sealed partial class SaveGridCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _ent = default!; - [Dependency] private readonly IResourceManager _resource = default!; + [Dependency] private IEntityManager _ent = default!; + [Dependency] private IResourceManager _resource = default!; public override string Command => "savegrid"; @@ -45,7 +45,7 @@ namespace Robust.Server.Console.Commands } bool saveSuccess = _ent.System().TrySaveGrid(uid, new ResPath(args[1])); - if(saveSuccess) + if (saveSuccess) { shell.WriteLine("Save successful. Look in the user data directory."); } @@ -69,10 +69,10 @@ namespace Robust.Server.Console.Commands } } - public sealed class LoadGridCommand : LocalizedCommands + public sealed partial class LoadGridCommand : LocalizedCommands { - [Dependency] private readonly IEntitySystemManager _system = default!; - [Dependency] private readonly IResourceManager _resource = default!; + [Dependency] private IEntitySystemManager _system = default!; + [Dependency] private IResourceManager _resource = default!; public override string Command => "loadgrid"; @@ -158,11 +158,11 @@ namespace Robust.Server.Console.Commands } } - public sealed class SaveMap : LocalizedCommands + public sealed partial class SaveMap : LocalizedCommands { - [Dependency] private readonly IEntityManager _entManager = default!; - [Dependency] private readonly IEntitySystemManager _system = default!; - [Dependency] private readonly IResourceManager _resource = default!; + [Dependency] private IEntityManager _entManager = default!; + [Dependency] private IEntitySystemManager _system = default!; + [Dependency] private IResourceManager _resource = default!; public override string Command => "savemap"; @@ -209,7 +209,7 @@ namespace Robust.Server.Console.Commands } if (sys.IsInitialized(mapId) && - ( args.Length < 3 || !bool.TryParse(args[2], out var force) || !force)) + (args.Length < 3 || !bool.TryParse(args[2], out var force) || !force)) { shell.WriteError(Loc.GetString("cmd-savemap-init-warning")); return; @@ -217,21 +217,21 @@ namespace Robust.Server.Console.Commands shell.WriteLine(Loc.GetString("cmd-savemap-attempt", ("mapId", mapId), ("path", args[1]))); bool saveSuccess = _system.GetEntitySystem().TrySaveMap(mapId, new ResPath(args[1])); - if(saveSuccess) + if (saveSuccess) { - shell.WriteLine(Loc.GetString("cmd-savemap-success")); + shell.WriteLine(Loc.GetString("cmd-savemap-success")); } else { - shell.WriteError(Loc.GetString("cmd-savemap-error")); + shell.WriteError(Loc.GetString("cmd-savemap-error")); } } } - public sealed class LoadMap : LocalizedCommands + public sealed partial class LoadMap : LocalizedCommands { - [Dependency] private readonly IEntitySystemManager _system = default!; - [Dependency] private readonly IResourceManager _resource = default!; + [Dependency] private IEntitySystemManager _system = default!; + [Dependency] private IResourceManager _resource = default!; public override string Command => "loadmap"; @@ -323,7 +323,7 @@ namespace Robust.Server.Console.Commands return; } - var opts = new DeserializationOptions {StoreYamlUids = storeUids}; + var opts = new DeserializationOptions { StoreYamlUids = storeUids }; var path = new ResPath(args[1]); _system.GetEntitySystem().TryLoadMapWithId(mapId, path, out _, out _, opts, offset, rot); diff --git a/Robust.Server/Console/Commands/PlayerCommands.cs b/Robust.Server/Console/Commands/PlayerCommands.cs index 6f504d844b..735a1b7763 100644 --- a/Robust.Server/Console/Commands/PlayerCommands.cs +++ b/Robust.Server/Console/Commands/PlayerCommands.cs @@ -8,9 +8,9 @@ using Robust.Shared.Network; namespace Robust.Server.Console.Commands { - public sealed class ListPlayers : LocalizedCommands + public sealed partial class ListPlayers : LocalizedCommands { - [Dependency] private readonly IPlayerManager _players = default!; + [Dependency] private IPlayerManager _players = default!; public override string Command => "listplayers"; public override void Execute(IConsoleShell shell, string argStr, string[] args) @@ -39,10 +39,10 @@ namespace Robust.Server.Console.Commands } } - internal sealed class KickCommand : LocalizedCommands + internal sealed partial class KickCommand : LocalizedCommands { - [Dependency] private readonly IPlayerManager _players = default!; - [Dependency] private readonly IServerNetManager _netManager = default!; + [Dependency] private IPlayerManager _players = default!; + [Dependency] private IServerNetManager _netManager = default!; public override string Command => "kick"; diff --git a/Robust.Server/Console/Commands/ProfileEntitySpawningCommand.cs b/Robust.Server/Console/Commands/ProfileEntitySpawningCommand.cs index 37902decc9..207be1f1b4 100644 --- a/Robust.Server/Console/Commands/ProfileEntitySpawningCommand.cs +++ b/Robust.Server/Console/Commands/ProfileEntitySpawningCommand.cs @@ -9,9 +9,9 @@ using Robust.Shared.Timing; namespace Robust.Server.Console.Commands; -public sealed class ProfileEntitySpawningCommand : IConsoleCommand +public sealed partial class ProfileEntitySpawningCommand : IConsoleCommand { - [Dependency] private readonly IEntityManager _entities = default!; + [Dependency] private IEntityManager _entities = default!; public string Command => "profileEntitySpawning"; public string Description => "Profiles entity spawning with n entities"; diff --git a/Robust.Server/Console/Commands/ReloadLocalizationsCommand.cs b/Robust.Server/Console/Commands/ReloadLocalizationsCommand.cs index c783e5f8e2..c2f2deb254 100644 --- a/Robust.Server/Console/Commands/ReloadLocalizationsCommand.cs +++ b/Robust.Server/Console/Commands/ReloadLocalizationsCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Localization; namespace Robust.Server.Console.Commands { - internal sealed class ReloadLocalizationsCommand : LocalizedCommands + internal sealed partial class ReloadLocalizationsCommand : LocalizedCommands { - [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private ILocalizationManager _loc = default!; public override string Command => "rldloc"; diff --git a/Robust.Server/Console/Commands/RemoveComponentCommand.cs b/Robust.Server/Console/Commands/RemoveComponentCommand.cs index 79522d00e9..8b8b7639d3 100644 --- a/Robust.Server/Console/Commands/RemoveComponentCommand.cs +++ b/Robust.Server/Console/Commands/RemoveComponentCommand.cs @@ -7,10 +7,10 @@ using Robust.Shared.IoC; namespace Robust.Server.Console.Commands { [UsedImplicitly] - internal sealed class RemoveComponentCommand : LocalizedCommands + internal sealed partial class RemoveComponentCommand : LocalizedCommands { - [Dependency] private readonly IComponentFactory _compFactory = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IComponentFactory _compFactory = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "rmcomp"; diff --git a/Robust.Server/Console/Commands/SpinCommand.cs b/Robust.Server/Console/Commands/SpinCommand.cs index f60369a4a6..583932ebbb 100644 --- a/Robust.Server/Console/Commands/SpinCommand.cs +++ b/Robust.Server/Console/Commands/SpinCommand.cs @@ -7,9 +7,9 @@ using Robust.Shared.Physics.Systems; namespace Robust.Server.Console.Commands; -public sealed class SpinCommand : LocalizedCommands +public sealed partial class SpinCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entities = default!; + [Dependency] private IEntityManager _entities = default!; public override string Command => "spin"; diff --git a/Robust.Server/Console/Commands/SysCommands.cs b/Robust.Server/Console/Commands/SysCommands.cs index b05583ad0e..1b44c4a9be 100644 --- a/Robust.Server/Console/Commands/SysCommands.cs +++ b/Robust.Server/Console/Commands/SysCommands.cs @@ -11,7 +11,7 @@ namespace Robust.Server.Console.Commands // Disabled for now since it doesn't actually work. sealed class RestartCommand : LocalizedCommands { - [Dependency] private readonly IBaseServer _server = default!; + [Dependency] private IBaseServer _server = default!; public override string Command => "restart"; @@ -22,9 +22,9 @@ namespace Robust.Server.Console.Commands } */ - sealed class ShutdownCommand : LocalizedCommands + sealed partial class ShutdownCommand : LocalizedCommands { - [Dependency] private readonly IBaseServer _server = default!; + [Dependency] private IBaseServer _server = default!; public override string Command => "shutdown"; @@ -34,9 +34,9 @@ namespace Robust.Server.Console.Commands } } - sealed class NetworkAuditCommand : LocalizedCommands + sealed partial class NetworkAuditCommand : LocalizedCommands { - [Dependency] private readonly INetManager _netManager = default!; + [Dependency] private INetManager _netManager = default!; public override string Command => "netaudit"; public override void Execute(IConsoleShell shell, string argStr, string[] args) @@ -57,9 +57,9 @@ namespace Robust.Server.Console.Commands } } - sealed class ShowTimeCommand : LocalizedCommands + sealed partial class ShowTimeCommand : LocalizedCommands { - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private IGameTiming _timing = default!; public override string Command => "showtime"; diff --git a/Robust.Server/Console/Commands/ViewSubscriberCommand.cs b/Robust.Server/Console/Commands/ViewSubscriberCommand.cs index 0684e828c1..8effcc0430 100644 --- a/Robust.Server/Console/Commands/ViewSubscriberCommand.cs +++ b/Robust.Server/Console/Commands/ViewSubscriberCommand.cs @@ -6,9 +6,9 @@ using Robust.Shared.Player; namespace Robust.Server.Console.Commands { - public sealed class AddViewSubscriberCommand : LocalizedCommands + public sealed partial class AddViewSubscriberCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entities = default!; + [Dependency] private IEntityManager _entities = default!; public override string Command => "addview"; @@ -43,9 +43,9 @@ namespace Robust.Server.Console.Commands _entities.EntitySysManager.GetEntitySystem().AddViewSubscriber(uid.Value, playerSession); } - public sealed class RemoveViewSubscriberCommand : LocalizedCommands + public sealed partial class RemoveViewSubscriberCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entities = default!; + [Dependency] private IEntityManager _entities = default!; public override string Command => "removeview"; diff --git a/Robust.Server/Console/ServerConsoleHost.cs b/Robust.Server/Console/ServerConsoleHost.cs index 86b29ba437..7df779f084 100644 --- a/Robust.Server/Console/ServerConsoleHost.cs +++ b/Robust.Server/Console/ServerConsoleHost.cs @@ -17,15 +17,15 @@ namespace Robust.Server.Console { /// [Virtual] - internal class ServerConsoleHost : ConsoleHost, IServerConsoleHost, IConsoleHostInternal + internal partial class ServerConsoleHost : ConsoleHost, IServerConsoleHost, IConsoleHostInternal { - [Dependency] private readonly IConGroupController _groupController = default!; - [Dependency] private readonly IPlayerManager _players = default!; - [Dependency] private readonly ISystemConsoleManager _systemConsole = default!; - [Dependency] private readonly ToolshedManager _toolshed = default!; - [Dependency] private readonly ProfManager _prof = default!; + [Dependency] private IConGroupController _groupController = default!; + [Dependency] private IPlayerManager _players = default!; + [Dependency] private ISystemConsoleManager _systemConsole = default!; + [Dependency] private ToolshedManager _toolshed = default!; + [Dependency] private ProfManager _prof = default!; - public ServerConsoleHost() : base(isServer: true) {} + public ServerConsoleHost() : base(isServer: true) { } public override event ConAnyCommandCallback? AnyCommandExecuted; @@ -254,7 +254,7 @@ namespace Robust.Server.Console result = new CompletionResult(options.ToArray(), hints); } - done: + done: result ??= CompletionResult.Empty; diff --git a/Robust.Server/Console/SystemConsoleManager.cs b/Robust.Server/Console/SystemConsoleManager.cs index 4e92c603a2..21db91ebd1 100644 --- a/Robust.Server/Console/SystemConsoleManager.cs +++ b/Robust.Server/Console/SystemConsoleManager.cs @@ -14,13 +14,13 @@ using Con = System.Console; namespace Robust.Server.Console { - internal sealed class SystemConsoleManager : ISystemConsoleManager, IPostInjectInit, IDisposable + internal sealed partial class SystemConsoleManager : ISystemConsoleManager, IPostInjectInit, IDisposable { - [Dependency] private readonly IServerConsoleHost _conShell = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; - [Dependency] private readonly IBaseServer _baseServer = default!; - [Dependency] private readonly IServerNetManager _netManager = default!; - [Dependency] private readonly IGameTiming _time = default!; + [Dependency] private IServerConsoleHost _conShell = default!; + [Dependency] private ITaskManager _taskManager = default!; + [Dependency] private IBaseServer _baseServer = default!; + [Dependency] private IServerNetManager _netManager = default!; + [Dependency] private IGameTiming _time = default!; // // Command entry stuff. @@ -142,10 +142,10 @@ namespace Robust.Server.Console // Set up the new thread & thread accessories var rlc = new CancellationTokenSource(); var chan = Channel.CreateBounded(new BoundedChannelOptions(capacity: 32) - { - FullMode=BoundedChannelFullMode.Wait, - SingleReader=true, - } + { + FullMode = BoundedChannelFullMode.Wait, + SingleReader = true, + } ); _rdLine = ( @@ -175,7 +175,7 @@ namespace Robust.Server.Console { ConsoleKeyInfo key = Con.ReadKey(true); if (Con.WindowWidth > 0) - Con.SetCursorPosition(0, Con.CursorTop); + Con.SetCursorPosition(0, Con.CursorTop); if (!Char.IsControl(key.KeyChar)) { currentBuffer = currentBuffer.Insert(internalCursor++, key.KeyChar.ToString()); diff --git a/Robust.Server/DataMetrics/MetricsManager.UpdateMetrics.cs b/Robust.Server/DataMetrics/MetricsManager.UpdateMetrics.cs index d91ffa1b89..ab572618fd 100644 --- a/Robust.Server/DataMetrics/MetricsManager.UpdateMetrics.cs +++ b/Robust.Server/DataMetrics/MetricsManager.UpdateMetrics.cs @@ -19,7 +19,7 @@ internal sealed partial class MetricsManager private TimeSpan _fixedUpdateInterval; private TimeSpan _nextFixedUpdate; - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; private void InitializeUpdateMetrics() { diff --git a/Robust.Server/DataMetrics/MetricsManager.cs b/Robust.Server/DataMetrics/MetricsManager.cs index 88c19ec36b..4c587b7505 100644 --- a/Robust.Server/DataMetrics/MetricsManager.cs +++ b/Robust.Server/DataMetrics/MetricsManager.cs @@ -46,10 +46,10 @@ public interface IMetricsManager internal sealed partial class MetricsManager : IMetricsManagerInternal, IDisposable { - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IEntitySystemManager _entitySystemManager = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private ITaskManager _taskManager = default!; private bool _initialized; diff --git a/Robust.Server/GameObjects/EntitySystems/InputSystem.cs b/Robust.Server/GameObjects/EntitySystems/InputSystem.cs index 0b9c12c942..57a5ab2a15 100644 --- a/Robust.Server/GameObjects/EntitySystems/InputSystem.cs +++ b/Robust.Server/GameObjects/EntitySystems/InputSystem.cs @@ -12,9 +12,9 @@ namespace Robust.Server.GameObjects /// /// Server side processing of incoming user commands. /// - public sealed class InputSystem : SharedInputSystem + public sealed partial class InputSystem : SharedInputSystem { - [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; private readonly Dictionary _playerInputs = new(); diff --git a/Robust.Server/GameObjects/EntitySystems/MapSystem.cs b/Robust.Server/GameObjects/EntitySystems/MapSystem.cs index 9a7f78d944..ad74f02a5b 100644 --- a/Robust.Server/GameObjects/EntitySystems/MapSystem.cs +++ b/Robust.Server/GameObjects/EntitySystems/MapSystem.cs @@ -12,10 +12,10 @@ using Robust.Shared.Map.Events; namespace Robust.Server.GameObjects { - public sealed class MapSystem : SharedMapSystem + public sealed partial class MapSystem : SharedMapSystem { - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly PvsSystem _pvs = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private PvsSystem _pvs = default!; private bool _deleteEmptyGrids; diff --git a/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs b/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs index 451dcda44d..05805b5b4f 100644 --- a/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs +++ b/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs @@ -12,9 +12,9 @@ using Robust.Shared.Physics.Systems; namespace Robust.Server.GameObjects { [UsedImplicitly] - public sealed class PhysicsSystem : SharedPhysicsSystem + public sealed partial class PhysicsSystem : SharedPhysicsSystem { - [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private IConfigurationManager _configurationManager = default!; public override void Initialize() { diff --git a/Robust.Server/GameObjects/EntitySystems/PointLightSystem.cs b/Robust.Server/GameObjects/EntitySystems/PointLightSystem.cs index 0bf898eff6..33cdc7cb85 100644 --- a/Robust.Server/GameObjects/EntitySystems/PointLightSystem.cs +++ b/Robust.Server/GameObjects/EntitySystems/PointLightSystem.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Server.GameObjects; -public sealed class PointLightSystem : SharedPointLightSystem +public sealed partial class PointLightSystem : SharedPointLightSystem { - [Dependency] private readonly MetaDataSystem _metadata = default!; + [Dependency] private MetaDataSystem _metadata = default!; public override void Initialize() { @@ -36,7 +36,7 @@ public sealed class PointLightSystem : SharedPointLightSystem private bool IsHighPriority(SharedPointLightComponent comp) { - return comp is {Enabled: true, CastShadows: true, Radius: > 7, LifeStage: <= ComponentLifeStage.Running}; + return comp is { Enabled: true, CastShadows: true, Radius: > 7, LifeStage: <= ComponentLifeStage.Running }; } protected override void UpdatePriority(EntityUid uid, SharedPointLightComponent comp, MetaDataComponent meta) diff --git a/Robust.Server/GameObjects/EntitySystems/ServerOccluderSystem.cs b/Robust.Server/GameObjects/EntitySystems/ServerOccluderSystem.cs index 51e0e14cc2..5702a48c5b 100644 --- a/Robust.Server/GameObjects/EntitySystems/ServerOccluderSystem.cs +++ b/Robust.Server/GameObjects/EntitySystems/ServerOccluderSystem.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Server.GameObjects; [UsedImplicitly] -public sealed class ServerOccluderSystem : OccluderSystem +public sealed partial class ServerOccluderSystem : OccluderSystem { - [Dependency] private readonly MetaDataSystem _metadata = default!; + [Dependency] private MetaDataSystem _metadata = default!; public override void Initialize() { @@ -17,7 +17,7 @@ public sealed class ServerOccluderSystem : OccluderSystem private void OnFlagRemoveAttempt(Entity ent, ref MetaFlagRemoveAttemptEvent args) { - if (ent.Comp is {Enabled: true, LifeStage: <= ComponentLifeStage.Running}) + if (ent.Comp is { Enabled: true, LifeStage: <= ComponentLifeStage.Running }) args.ToRemove &= ~MetaDataFlags.PvsPriority; } diff --git a/Robust.Server/GameObjects/EntitySystems/VisibilitySystem.cs b/Robust.Server/GameObjects/EntitySystems/VisibilitySystem.cs index 4a4674081a..f8bb5a83e0 100644 --- a/Robust.Server/GameObjects/EntitySystems/VisibilitySystem.cs +++ b/Robust.Server/GameObjects/EntitySystems/VisibilitySystem.cs @@ -6,10 +6,10 @@ using Robust.Shared.ViewVariables; namespace Robust.Server.GameObjects { - public sealed class VisibilitySystem : SharedVisibilitySystem + public sealed partial class VisibilitySystem : SharedVisibilitySystem { - [Dependency] private readonly PvsSystem _pvs = default!; - [Dependency] private readonly IViewVariablesManager _vvManager = default!; + [Dependency] private PvsSystem _pvs = default!; + [Dependency] private IViewVariablesManager _vvManager = default!; private EntityQuery _xformQuery; private EntityQuery _metaQuery; diff --git a/Robust.Server/GameObjects/ServerEntityManager.cs b/Robust.Server/GameObjects/ServerEntityManager.cs index 1f47b2100b..9721093413 100644 --- a/Robust.Server/GameObjects/ServerEntityManager.cs +++ b/Robust.Server/GameObjects/ServerEntityManager.cs @@ -27,19 +27,19 @@ namespace Robust.Server.GameObjects /// Manager for entities -- controls things like template loading and instantiation /// [UsedImplicitly] // DI Container - public sealed class ServerEntityManager : EntityManager, IServerEntityManager + public sealed partial class ServerEntityManager : EntityManager, IServerEntityManager { private static readonly Gauge EntitiesCount = Metrics.CreateGauge( "robust_entities_count", "Amount of alive entities."); - [Dependency] private readonly IReplayRecordingManager _replay = default!; - [Dependency] private readonly IServerNetManager _networkManager = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private IReplayRecordingManager _replay = default!; + [Dependency] private IServerNetManager _networkManager = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IConfigurationManager _configurationManager = default!; #if EXCEPTION_TOLERANCE - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; #endif private ISawmill _netEntSawmill = default!; @@ -213,7 +213,7 @@ namespace Robust.Server.GameObjects { _netEntSawmill.Warning( "Got late MsgEntity! Diff: {0}, msgT: {2}, cT: {3}, player: {1}, msg: {4}", - (int) msgT.Value - (int) cT.Value, + (int)msgT.Value - (int)cT.Value, message.MsgChannel.UserName, msgT, cT, diff --git a/Robust.Server/GameStates/PvsOverrideSystem.cs b/Robust.Server/GameStates/PvsOverrideSystem.cs index 6fb021690b..6fe133329e 100644 --- a/Robust.Server/GameStates/PvsOverrideSystem.cs +++ b/Robust.Server/GameStates/PvsOverrideSystem.cs @@ -12,10 +12,10 @@ using Robust.Shared.Utility; namespace Robust.Server.GameStates; -public sealed class PvsOverrideSystem : SharedPvsOverrideSystem +public sealed partial class PvsOverrideSystem : SharedPvsOverrideSystem { - [Dependency] private readonly IPlayerManager _player = default!; - [Dependency] private readonly IConsoleHost _console = default!; + [Dependency] private IPlayerManager _player = default!; + [Dependency] private IConsoleHost _console = default!; private readonly HashSet _hasOverride = new(); diff --git a/Robust.Server/GameStates/PvsSystem.Dirty.cs b/Robust.Server/GameStates/PvsSystem.Dirty.cs index c7a180ccb7..e7c548c882 100644 --- a/Robust.Server/GameStates/PvsSystem.Dirty.cs +++ b/Robust.Server/GameStates/PvsSystem.Dirty.cs @@ -14,7 +14,7 @@ namespace Robust.Server.GameStates /// internal sealed partial class PvsSystem { - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; /// /// if it's a new entity we need to GetEntityState from tick 0. diff --git a/Robust.Server/GameStates/PvsSystem.Serialize.cs b/Robust.Server/GameStates/PvsSystem.Serialize.cs index d4df28dea0..25a72ec864 100644 --- a/Robust.Server/GameStates/PvsSystem.Serialize.cs +++ b/Robust.Server/GameStates/PvsSystem.Serialize.cs @@ -14,7 +14,7 @@ namespace Robust.Server.GameStates; internal sealed partial class PvsSystem { - [Dependency] private readonly IRobustSerializer _serializer = default!; + [Dependency] private IRobustSerializer _serializer = default!; /// /// Get and serialize objects for each player. Compressing & sending the states is done later. diff --git a/Robust.Server/GameStates/PvsSystem.cs b/Robust.Server/GameStates/PvsSystem.cs index 26ca25493b..2095023f22 100644 --- a/Robust.Server/GameStates/PvsSystem.cs +++ b/Robust.Server/GameStates/PvsSystem.cs @@ -27,19 +27,19 @@ namespace Robust.Server.GameStates; internal sealed partial class PvsSystem : EntitySystem { - [Dependency] private readonly IConfigurationManager _configManager = default!; - [Dependency] private readonly INetworkedMapManager _mapManager = default!; - [Dependency] private readonly IServerEntityNetworkManager _netEntMan = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IParallelManager _parallelManager = default!; - [Dependency] private readonly IServerGameStateManager _serverGameStateManager = default!; - [Dependency] private readonly IServerNetConfigurationManager _netConfigManager = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly InputSystem _input = default!; - [Dependency] private readonly IServerNetManager _netMan = default!; - [Dependency] private readonly IParallelManagerInternal _parallelMgr = default!; - [Dependency] private readonly PvsOverrideSystem _pvsOverride = default!; - [Dependency] private readonly IServerReplayRecordingManager _replay = default!; + [Dependency] private IConfigurationManager _configManager = default!; + [Dependency] private INetworkedMapManager _mapManager = default!; + [Dependency] private IServerEntityNetworkManager _netEntMan = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IParallelManager _parallelManager = default!; + [Dependency] private IServerGameStateManager _serverGameStateManager = default!; + [Dependency] private IServerNetConfigurationManager _netConfigManager = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private InputSystem _input = default!; + [Dependency] private IServerNetManager _netMan = default!; + [Dependency] private IParallelManagerInternal _parallelMgr = default!; + [Dependency] private PvsOverrideSystem _pvsOverride = default!; + [Dependency] private IServerReplayRecordingManager _replay = default!; // TODO make this a cvar. Make it in terms of seconds and tie it to tick rate? // Main issue is that I CBF figuring out the logic for handling it changing mid-game. diff --git a/Robust.Server/GameStates/ServerGameStateManager.cs b/Robust.Server/GameStates/ServerGameStateManager.cs index 8e316f3ede..38bcd49a13 100644 --- a/Robust.Server/GameStates/ServerGameStateManager.cs +++ b/Robust.Server/GameStates/ServerGameStateManager.cs @@ -16,13 +16,13 @@ namespace Robust.Server.GameStates { /// [UsedImplicitly] - public sealed class ServerGameStateManager : IServerGameStateManager, IPostInjectInit + public sealed partial class ServerGameStateManager : IServerGameStateManager, IPostInjectInit { private PvsSystem _pvs = default!; - [Dependency] private readonly EntityManager _entityManager = default!; - [Dependency] private readonly IServerNetManager _networkManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private EntityManager _entityManager = default!; + [Dependency] private IServerNetManager _networkManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; private ISawmill _logger = default!; diff --git a/Robust.Server/Physics/Commands/BoxStackCommand.cs b/Robust.Server/Physics/Commands/BoxStackCommand.cs index 6677ac58a0..bd9283ab8f 100644 --- a/Robust.Server/Physics/Commands/BoxStackCommand.cs +++ b/Robust.Server/Physics/Commands/BoxStackCommand.cs @@ -13,9 +13,9 @@ using Robust.Shared.Physics.Systems; namespace Robust.Server.Physics.Commands; -public sealed class BoxStackCommand : IConsoleCommand +public sealed partial class BoxStackCommand : IConsoleCommand { - [Dependency] private readonly IEntityManager _entManager = default!; + [Dependency] private IEntityManager _entManager = default!; public string Command => "boxstack"; public string Description => string.Empty; diff --git a/Robust.Server/Physics/GridFixtureSystem.cs b/Robust.Server/Physics/GridFixtureSystem.cs index 63cec1e2d3..873e2e7c31 100644 --- a/Robust.Server/Physics/GridFixtureSystem.cs +++ b/Robust.Server/Physics/GridFixtureSystem.cs @@ -25,13 +25,13 @@ namespace Robust.Server.Physics /// public sealed partial class GridFixtureSystem : SharedGridFixtureSystem { - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IConGroupController _conGroup = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly SharedMapSystem _maps = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly SharedTransformSystem _xformSystem = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IConGroupController _conGroup = default!; + [Dependency] private EntityLookupSystem _lookup = default!; + [Dependency] private SharedMapSystem _maps = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; + [Dependency] private SharedTransformSystem _xformSystem = default!; private readonly Dictionary> _nodes = new(); diff --git a/Robust.Server/Physics/MergeGridsCommand.cs b/Robust.Server/Physics/MergeGridsCommand.cs index 462d04171d..7e00b40e50 100644 --- a/Robust.Server/Physics/MergeGridsCommand.cs +++ b/Robust.Server/Physics/MergeGridsCommand.cs @@ -8,9 +8,9 @@ using Robust.Shared.Toolshed; namespace Robust.Server.Physics; -public sealed class MergeGridsCommand : LocalizedCommands +public sealed partial class MergeGridsCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entManager = default!; + [Dependency] private IEntityManager _entManager = default!; public override string Command => "merge_grids"; diff --git a/Robust.Server/Placement/PlacementManager.cs b/Robust.Server/Placement/PlacementManager.cs index 763c37328c..a7868c8730 100644 --- a/Robust.Server/Placement/PlacementManager.cs +++ b/Robust.Server/Placement/PlacementManager.cs @@ -20,16 +20,16 @@ using Robust.Shared.Prototypes; namespace Robust.Server.Placement { - public sealed class PlacementManager : IPlacementManager + public sealed partial class PlacementManager : IPlacementManager { - [Dependency] private readonly IComponentFactory _factory = default!; - [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; - [Dependency] private readonly IServerNetManager _networkManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IPrototypeManager _prototype = default!; - [Dependency] private readonly IServerEntityManager _entityManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IComponentFactory _factory = default!; + [Dependency] private ITileDefinitionManager _tileDefinitionManager = default!; + [Dependency] private IServerNetManager _networkManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IPrototypeManager _prototype = default!; + [Dependency] private IServerEntityManager _entityManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private ILogManager _logManager = default!; private EntityLookupSystem _lookup => _entityManager.System(); private SharedMapSystem _maps => _entityManager.System(); @@ -283,7 +283,7 @@ namespace Robust.Server.Placement _entityManager.GetComponent(entity).Coordinates, PlacementEventAction.Erase, msg.MsgChannel.UserId); - + _entityManager.EventBus.RaiseEvent(EventSource.Local, placementEraseEvent); _entityManager.DeleteEntity(entity); } diff --git a/Robust.Server/Player/PlayerManager.cs b/Robust.Server/Player/PlayerManager.cs index c5fde767b7..b46f18a4bc 100644 --- a/Robust.Server/Player/PlayerManager.cs +++ b/Robust.Server/Player/PlayerManager.cs @@ -23,17 +23,17 @@ namespace Robust.Server.Player /// /// This class will manage connected player sessions. /// - internal sealed class PlayerManager : SharedPlayerManager, IPlayerManager + internal sealed partial class PlayerManager : SharedPlayerManager, IPlayerManager { private static readonly Gauge PlayerCountMetric = Metrics .CreateGauge("robust_player_count", "Number of players on the server."); - [Dependency] private readonly IBaseServer _baseServer = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IServerNetManager _network = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IServerNetConfigurationManager _cfg = default!; + [Dependency] private IBaseServer _baseServer = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IServerNetManager _network = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IServerNetConfigurationManager _cfg = default!; public BoundKeyMap KeyMap { get; private set; } = default!; @@ -120,7 +120,7 @@ namespace Robust.Server.Player private void HandlePlayerListReq(MsgPlayerListReq message) { var channel = message.MsgChannel; - var session = (CommonSession) GetSessionByChannel(channel); + var session = (CommonSession)GetSessionByChannel(channel); session.InitialPlayerListReqDone = true; if (!session.InitialResourcesDone) @@ -131,7 +131,7 @@ namespace Robust.Server.Player public void MarkPlayerResourcesSent(INetChannel channel) { - var session = (CommonSession) GetSessionByChannel(channel); + var session = (CommonSession)GetSessionByChannel(channel); session.InitialResourcesDone = true; if (!session.InitialPlayerListReqDone) @@ -179,31 +179,31 @@ namespace Robust.Server.Player return true; } - internal ICommonSession AddDummySession(NetUserId user, string name) - { + internal ICommonSession AddDummySession(NetUserId user, string name) + { #if FULL_RELEASE // Lets not make it completely trivial to fake player counts. throw new NotSupportedException(); #endif - Lock.EnterWriteLock(); - DummySession session; - try - { - UserIdMap[name] = user; - if (!PlayerData.TryGetValue(user, out var data)) - PlayerData[user] = data = new(user, name); + Lock.EnterWriteLock(); + DummySession session; + try + { + UserIdMap[name] = user; + if (!PlayerData.TryGetValue(user, out var data)) + PlayerData[user] = data = new(user, name); - session = new DummySession(user, name, data); - InternalSessions.Add(user, session); + session = new DummySession(user, name, data); + InternalSessions.Add(user, session); + } + finally + { + Lock.ExitWriteLock(); + } + + UpdateState(session); + + return session; } - finally - { - Lock.ExitWriteLock(); - } - - UpdateState(session); - - return session; - } } } diff --git a/Robust.Server/Prototypes/ServerPrototypeManager.cs b/Robust.Server/Prototypes/ServerPrototypeManager.cs index 25c381ed98..02e44b9112 100644 --- a/Robust.Server/Prototypes/ServerPrototypeManager.cs +++ b/Robust.Server/Prototypes/ServerPrototypeManager.cs @@ -11,14 +11,14 @@ using Robust.Shared.Prototypes; namespace Robust.Server.Prototypes { - public sealed class ServerPrototypeManager : PrototypeManager + public sealed partial class ServerPrototypeManager : PrototypeManager { #if TOOLS - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IConGroupController _conGroups = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IConGroupController _conGroups = default!; #endif - [Dependency] private readonly INetManager _netManager = default!; - [Dependency] private readonly IBaseServerInternal _server = default!; + [Dependency] private INetManager _netManager = default!; + [Dependency] private IBaseServerInternal _server = default!; public ServerPrototypeManager() { diff --git a/Robust.Server/Replays/ReplayRecordingManager.cs b/Robust.Server/Replays/ReplayRecordingManager.cs index ce71004afb..47c7dc74a1 100644 --- a/Robust.Server/Replays/ReplayRecordingManager.cs +++ b/Robust.Server/Replays/ReplayRecordingManager.cs @@ -9,9 +9,9 @@ using Robust.Shared.Utility; namespace Robust.Server.Replays; -internal sealed class ReplayRecordingManager : SharedReplayRecordingManager, IServerReplayRecordingManager +internal sealed partial class ReplayRecordingManager : SharedReplayRecordingManager, IServerReplayRecordingManager { - [Dependency] private readonly IEntitySystemManager _sysMan = default!; + [Dependency] private IEntitySystemManager _sysMan = default!; private PvsSystem _pvs = default!; private PvsSession _pvsSession = new(default!, new ResizableMemoryRegion(1)) { DisableCulling = true }; diff --git a/Robust.Server/Scripting/ScriptHost.cs b/Robust.Server/Scripting/ScriptHost.cs index ec34f21efe..ff945b7e12 100644 --- a/Robust.Server/Scripting/ScriptHost.cs +++ b/Robust.Server/Scripting/ScriptHost.cs @@ -31,14 +31,14 @@ using static Robust.Shared.Network.Messages.MsgScriptCompletionResponse; namespace Robust.Server.Scripting { - internal sealed class ScriptHost : IScriptHost + internal sealed partial class ScriptHost : IScriptHost { - [Dependency] private readonly IServerNetManager _netManager = default!; - [Dependency] private readonly IConGroupController _conGroupController = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IDependencyCollection _dependencyCollection = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IServerNetManager _netManager = default!; + [Dependency] private IConGroupController _conGroupController = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IDependencyCollection _dependencyCollection = default!; + [Dependency] private ILogManager _logManager = default!; readonly Dictionary> _instances = new(); @@ -272,7 +272,7 @@ namespace Robust.Server.Scripting if (!_instances.TryGetValue(session, out var instances) || !instances.TryGetValue(message.ScriptSession, out var instance)) - return; + return; var replyMessage = new MsgScriptCompletionResponse(); replyMessage.ScriptSession = message.ScriptSession; @@ -308,7 +308,7 @@ namespace Robust.Server.Scripting .GetCompletionsAsync(document, message.Cursor) ?? Task.FromResult(CompletionList.Empty)); var ires = ImmutableArray.CreateBuilder(); - foreach (var r in results.ItemsList) + foreach (var r in results.ItemsList) ires.Add(new LiteResult( displayText: r.DisplayText, displayTextPrefix: r.DisplayTextPrefix, @@ -374,7 +374,7 @@ namespace Robust.Server.Scripting protected override void WriteSyntax(object toString) { - if (_scriptInstance.RunningScript && toString?.ToString() is {} code) + if (_scriptInstance.RunningScript && toString?.ToString() is { } code) { var options = ScriptInstanceShared.GetScriptOptions(_reflectionManager); var script = CSharpScript.Create(code, options, typeof(ScriptGlobals)); @@ -389,7 +389,7 @@ namespace Robust.Server.Scripting public override void write(object toString) { - if (_scriptInstance.RunningScript && toString.ToString() is {} value) + if (_scriptInstance.RunningScript && toString.ToString() is { } value) { _scriptInstance.OutputBuffer.AddText(value); } diff --git a/Robust.Server/ServerHub/AdvertiseNowCommand.cs b/Robust.Server/ServerHub/AdvertiseNowCommand.cs index e146cba885..02876257f3 100644 --- a/Robust.Server/ServerHub/AdvertiseNowCommand.cs +++ b/Robust.Server/ServerHub/AdvertiseNowCommand.cs @@ -3,9 +3,9 @@ using Robust.Shared.IoC; namespace Robust.Server.ServerHub; -internal sealed class AdvertiseNowCommand : LocalizedCommands +internal sealed partial class AdvertiseNowCommand : LocalizedCommands { - [Dependency] private readonly HubManager _hubManager = default!; + [Dependency] private HubManager _hubManager = default!; public override string Command => "hub_advertise_now"; diff --git a/Robust.Server/ServerHub/HubManager.cs b/Robust.Server/ServerHub/HubManager.cs index 5bd07ad850..68338d98cf 100644 --- a/Robust.Server/ServerHub/HubManager.cs +++ b/Robust.Server/ServerHub/HubManager.cs @@ -14,11 +14,11 @@ using System.Threading.Tasks; namespace Robust.Server.ServerHub; -internal sealed class HubManager +internal sealed partial class HubManager { - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly ILogManager _log = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private ILogManager _log = default!; private ISawmill _sawmill = default!; diff --git a/Robust.Server/ServerStatus/StatusHost.cs b/Robust.Server/ServerStatus/StatusHost.cs index aa4cfab9d7..01efd0f9a3 100644 --- a/Robust.Server/ServerStatus/StatusHost.cs +++ b/Robust.Server/ServerStatus/StatusHost.cs @@ -33,11 +33,11 @@ namespace Robust.Server.ServerStatus { private const string Sawmill = "statushost"; - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IServerNetManager _netManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IDependencyCollection _deps = default!; - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IServerNetManager _netManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IDependencyCollection _deps = default!; + [Dependency] private ILogManager _logMan = default!; private readonly List _handlers = new(); private HttpListener? _listener; diff --git a/Robust.Server/ServerStatus/WatchdogApi.cs b/Robust.Server/ServerStatus/WatchdogApi.cs index dc65643829..327753abc3 100644 --- a/Robust.Server/ServerStatus/WatchdogApi.cs +++ b/Robust.Server/ServerStatus/WatchdogApi.cs @@ -18,13 +18,13 @@ using Robust.Shared.Utility; namespace Robust.Server.ServerStatus { - internal sealed class WatchdogApi : IWatchdogApiInternal, IPostInjectInit + internal sealed partial class WatchdogApi : IWatchdogApiInternal, IPostInjectInit { - [Dependency] private readonly IStatusHost _statusHost = default!; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; - [Dependency] private readonly IBaseServer _baseServer = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IStatusHost _statusHost = default!; + [Dependency] private IConfigurationManager _configurationManager = default!; + [Dependency] private ITaskManager _taskManager = default!; + [Dependency] private IBaseServer _baseServer = default!; + [Dependency] private IGameTiming _gameTiming = default!; // Ping watchdog every 15 seconds. private static readonly TimeSpan PingGap = TimeSpan.FromSeconds(15); diff --git a/Robust.Server/Toolshed/Commands/Players/PlayersCommand.cs b/Robust.Server/Toolshed/Commands/Players/PlayersCommand.cs index 7b5911d857..a7154c92fc 100644 --- a/Robust.Server/Toolshed/Commands/Players/PlayersCommand.cs +++ b/Robust.Server/Toolshed/Commands/Players/PlayersCommand.cs @@ -15,9 +15,9 @@ using Robust.Shared.Utility; namespace Robust.Server.Toolshed.Commands.Players; [ToolshedCommand] -public sealed class PlayerCommand : ToolshedCommand +public sealed partial class PlayerCommand : ToolshedCommand { - [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; [CommandImplementation("list")] public IEnumerable Players() diff --git a/Robust.Server/Upload/GamePrototypeLoadManager.cs b/Robust.Server/Upload/GamePrototypeLoadManager.cs index 8912624bcf..e3fabb0884 100644 --- a/Robust.Server/Upload/GamePrototypeLoadManager.cs +++ b/Robust.Server/Upload/GamePrototypeLoadManager.cs @@ -10,12 +10,12 @@ namespace Robust.Server.Upload; /// /// Manages sending runtime-loaded prototypes from game staff to clients. /// -public sealed class GamePrototypeLoadManager : SharedPrototypeLoadManager +public sealed partial class GamePrototypeLoadManager : SharedPrototypeLoadManager { - [Dependency] private readonly IServerNetManager _netManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IConGroupController _controller = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IServerNetManager _netManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IConGroupController _controller = default!; + [Dependency] private ILogManager _logManager = default!; private ISawmill _sawmill = default!; diff --git a/Robust.Server/Upload/NetworkResourceManager.cs b/Robust.Server/Upload/NetworkResourceManager.cs index c52458770c..1797f9aaf6 100644 --- a/Robust.Server/Upload/NetworkResourceManager.cs +++ b/Robust.Server/Upload/NetworkResourceManager.cs @@ -29,14 +29,14 @@ public sealed class NetworkResourcesUploadedEvent } } -public sealed class NetworkResourceManager : SharedNetworkResourceManager +public sealed partial class NetworkResourceManager : SharedNetworkResourceManager { internal const int AckInitial = 1; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IServerNetManager _serverNetManager = default!; - [Dependency] private readonly IConfigurationManager _cfgManager = default!; - [Dependency] private readonly IConGroupController _controller = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IServerNetManager _serverNetManager = default!; + [Dependency] private IConfigurationManager _cfgManager = default!; + [Dependency] private IConGroupController _controller = default!; [Obsolete("Use ResourcesUploaded instead")] public event Action? OnResourceUploaded; @@ -117,7 +117,7 @@ public sealed class NetworkResourceManager : SharedNetworkResourceManager } #pragma warning restore CS0618 // Type or member is obsolete - ResourcesUploaded?.Invoke(new NetworkResourcesUploadedEvent(session, [..ingested])); + ResourcesUploaded?.Invoke(new NetworkResourcesUploadedEvent(session, [.. ingested])); } protected override void ValidateUpload(uint size) diff --git a/Robust.Server/Upload/UploadedContentManager.cs b/Robust.Server/Upload/UploadedContentManager.cs index 69621121fb..8aad7c0873 100644 --- a/Robust.Server/Upload/UploadedContentManager.cs +++ b/Robust.Server/Upload/UploadedContentManager.cs @@ -7,12 +7,12 @@ namespace Robust.Server.Upload; /// /// Responsible for sending uploaded content to clients when they connect. /// -internal sealed class UploadedContentManager +internal sealed partial class UploadedContentManager { - [Dependency] private readonly IServerNetManager _netManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly GamePrototypeLoadManager _prototypeLoadManager = default!; - [Dependency] private readonly NetworkResourceManager _networkResourceManager = default!; + [Dependency] private IServerNetManager _netManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private GamePrototypeLoadManager _prototypeLoadManager = default!; + [Dependency] private NetworkResourceManager _networkResourceManager = default!; public void Initialize() { diff --git a/Robust.Server/ViewVariables/ServerViewVariablesManager.cs b/Robust.Server/ViewVariables/ServerViewVariablesManager.cs index d03881e646..8c18fecd6e 100644 --- a/Robust.Server/ViewVariables/ServerViewVariablesManager.cs +++ b/Robust.Server/ViewVariables/ServerViewVariablesManager.cs @@ -19,14 +19,14 @@ namespace Robust.Server.ViewVariables { internal sealed partial class ServerViewVariablesManager : ViewVariablesManager, IServerViewVariablesInternal { - [Dependency] private readonly INetManager _netManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IConGroupController _groupController = default!; - [Dependency] private readonly IRobustSerializer _robustSerializer = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IDependencyCollection _dependencyCollection = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private INetManager _netManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private IPlayerManager _playerManager = default!; + [Dependency] private IConGroupController _groupController = default!; + [Dependency] private IRobustSerializer _robustSerializer = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IDependencyCollection _dependencyCollection = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; private readonly Dictionary _sessions = new(); diff --git a/Robust.Shared.IntegrationTests/GameObjects/EntitySystemManager_Tests.cs b/Robust.Shared.IntegrationTests/GameObjects/EntitySystemManager_Tests.cs index 23fbf28c66..1ad4e7407d 100644 --- a/Robust.Shared.IntegrationTests/GameObjects/EntitySystemManager_Tests.cs +++ b/Robust.Shared.IntegrationTests/GameObjects/EntitySystemManager_Tests.cs @@ -9,7 +9,7 @@ using Robust.Shared.Physics.Components; namespace Robust.UnitTesting.Shared.GameObjects { [TestFixture, TestOf(typeof(EntitySystemManager))] - internal sealed class EntitySystemManager_Tests: OurRobustUnitTest + internal sealed partial class EntitySystemManager_Tests: OurRobustUnitTest { public abstract class ESystemBase : IEntitySystem @@ -28,22 +28,22 @@ namespace Robust.UnitTesting.Shared.GameObjects public abstract class ESystemBase2 : ESystemBase { } internal sealed class ESystemB : ESystemBase2 { } - internal sealed class ESystemDepA : ESystemBase + internal sealed partial class ESystemDepA : ESystemBase { - [Dependency] public readonly ESystemDepB ESystemDepB = default!; + [Dependency] public ESystemDepB ESystemDepB = default!; } - internal sealed class ESystemDepB : ESystemBase + internal sealed partial class ESystemDepB : ESystemBase { - [Dependency] public readonly ESystemDepA ESystemDepA = default!; + [Dependency] public ESystemDepA ESystemDepA = default!; } - internal sealed class ESystemDepAll : EntitySystem + internal sealed partial class ESystemDepAll : EntitySystem { - [Dependency] public readonly ESystemDepA ESystemDepA = default!; - [Dependency] public readonly IConfigurationManager Config = default!; - [Dependency] public readonly EntityQuery TransformQuery = default!; - [Dependency] public readonly EntityQuery PhysicsQuery = default!; + [Dependency] public ESystemDepA ESystemDepA = default!; + [Dependency] public IConfigurationManager Config = default!; + [Dependency] public EntityQuery TransformQuery = default!; + [Dependency] public EntityQuery PhysicsQuery = default!; } /* diff --git a/Robust.Shared.IntegrationTests/GameObjects/Systems/AnchoredSystemTests.cs b/Robust.Shared.IntegrationTests/GameObjects/Systems/AnchoredSystemTests.cs index 0e90228dd9..9f04c1f2d5 100644 --- a/Robust.Shared.IntegrationTests/GameObjects/Systems/AnchoredSystemTests.cs +++ b/Robust.Shared.IntegrationTests/GameObjects/Systems/AnchoredSystemTests.cs @@ -93,9 +93,9 @@ namespace Robust.UnitTesting.Shared.GameObjects.Systems } [Reflect(false)] - internal sealed class MoveEventTestSystem : EntitySystem + internal sealed partial class MoveEventTestSystem : EntitySystem { - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private SharedTransformSystem _transform = default!; public override void Initialize() { diff --git a/Robust.Shared.IntegrationTests/Physics/CollisionPredictionTest.cs b/Robust.Shared.IntegrationTests/Physics/CollisionPredictionTest.cs index 5c82d264b7..2e5f0cd20d 100644 --- a/Robust.Shared.IntegrationTests/Physics/CollisionPredictionTest.cs +++ b/Robust.Shared.IntegrationTests/Physics/CollisionPredictionTest.cs @@ -427,10 +427,10 @@ internal sealed class CollisionTestMoveEvent(NetEntity ent, MapCoordinates coord public MapCoordinates Coords = coords; } -internal sealed class CollisionPredictionTestSystem : EntitySystem +internal sealed partial class CollisionPredictionTestSystem : EntitySystem { - [Dependency] private readonly SharedTransformSystem _xform = default!; - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private SharedTransformSystem _xform = default!; + [Dependency] private IGameTiming _timing = default!; public bool CollisionStarted; public bool CollisionEnded; diff --git a/Robust.Shared.Scripting/ScriptGlobalsShared.cs b/Robust.Shared.Scripting/ScriptGlobalsShared.cs index ff37f7a9ac..f384b772c0 100644 --- a/Robust.Shared.Scripting/ScriptGlobalsShared.cs +++ b/Robust.Shared.Scripting/ScriptGlobalsShared.cs @@ -22,18 +22,23 @@ namespace Robust.Shared.Scripting [SuppressMessage("ReSharper", "IdentifierTypo")] [SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "CA1822")] - public abstract class ScriptGlobalsShared : IInvocationContext + public abstract partial class ScriptGlobalsShared : IInvocationContext { private const BindingFlags DefaultHelpFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public; - [field: Dependency] public IEntityManager ent { get; } = default!; - [field: Dependency] public IEntitySystemManager esm { get; } = default!; - [field: Dependency] public IPrototypeManager prot { get; } = default!; - [field: Dependency] public IMapManager map { get; } = default!; - [field: Dependency] public IDependencyCollection dependencies { get; } = default!; - - [field: Dependency] public ToolshedManager shed { get; } = default!; + [Dependency] private IEntityManager _ent = null!; + public IEntityManager ent => _ent; + [Dependency] private IEntitySystemManager _esm = null!; + public IEntitySystemManager esm => _esm; + [Dependency] private IPrototypeManager _prot = null!; + public IPrototypeManager prot => _prot; + [Dependency] private IMapManager _map = null!; + public IMapManager map => _map; + [Dependency] private IDependencyCollection _dependencies = null!; + public IDependencyCollection dependencies => _dependencies; + [Dependency] private ToolshedManager _shed = null!; + public ToolshedManager shed => _shed; public ToolshedManager Toolshed => shed; public ToolshedEnvironment Environment => shed.DefaultEnvironment; diff --git a/Robust.Shared.Tests/IoC/IoCManager_Test.cs b/Robust.Shared.Tests/IoC/IoCManager_Test.cs index 5b3d9684ed..8ddd9be07b 100644 --- a/Robust.Shared.Tests/IoC/IoCManager_Test.cs +++ b/Robust.Shared.Tests/IoC/IoCManager_Test.cs @@ -10,7 +10,7 @@ namespace Robust.Shared.Tests.IoC /// This fixture CAN NOT be parallelized, because is a static singleton. /// [TestFixture, TestOf(typeof(IoCManager))] - internal sealed class IoCManager_Test + internal sealed partial class IoCManager_Test { [OneTimeSetUp] public void OneTimeSetup() @@ -139,13 +139,13 @@ namespace Robust.Shared.Tests.IoC Assert.That(IoCManager.Resolve(), Is.EqualTo(obj)); } - private sealed class DependencyA + private sealed partial class DependencyA { - [Dependency] public readonly DependencyB _depB = default!; + [Dependency] public DependencyB _depB = default!; } - private sealed class DependencyB + private sealed partial class DependencyB { - [Dependency] public readonly DependencyA _depA = default!; + [Dependency] public DependencyA _depA = default!; } [Test] @@ -238,12 +238,12 @@ namespace Robust.Shared.Tests.IoC } [Virtual] - public class TestFieldInjectionParent + public partial class TestFieldInjectionParent { [Dependency] #pragma warning disable 649 #pragma warning disable RA0032 - private readonly TestFieldInjection myself = default!; + private TestFieldInjection myself = default!; [Dependency] public TestFieldInjection myotherself = default!; @@ -257,12 +257,12 @@ namespace Robust.Shared.Tests.IoC } } - public sealed class TestFieldInjection : TestFieldInjectionParent + public sealed partial class TestFieldInjection : TestFieldInjectionParent { #pragma warning disable RA0032 // Duplicate [Dependency] field. I wrote this test 7 years idk if this makes sense. [Dependency] #pragma warning disable 649 - private readonly TestFieldInjection myuniqueself = default!; + private TestFieldInjection myuniqueself = default!; [Dependency] public TestFieldInjection mydifferentself = default!; @@ -287,11 +287,11 @@ namespace Robust.Shared.Tests.IoC } } - public sealed class TestUnregisteredInjection + public sealed partial class TestUnregisteredInjection { [Dependency] #pragma warning disable 414 - private readonly IIoCFailInterface FailInterface = default!; + private IIoCFailInterface FailInterface = default!; #pragma warning restore 414 } @@ -307,8 +307,8 @@ namespace Robust.Shared.Tests.IoC } } - public sealed class ExplicitInjectionTest + public sealed partial class ExplicitInjectionTest { - [Dependency] public readonly IDependencyCollection DependencyCollection = default!; + [Dependency] public IDependencyCollection DependencyCollection = default!; } } diff --git a/Robust.Shared/Asynchronous/TaskManager.cs b/Robust.Shared/Asynchronous/TaskManager.cs index d18a68d4a9..2648525a56 100644 --- a/Robust.Shared/Asynchronous/TaskManager.cs +++ b/Robust.Shared/Asynchronous/TaskManager.cs @@ -6,11 +6,11 @@ using Robust.Shared.IoC; namespace Robust.Shared.Asynchronous { - internal sealed class TaskManager : ITaskManager + internal sealed partial class TaskManager : ITaskManager { private RobustSynchronizationContext _mainThreadContext = default!; - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; public void Initialize() { diff --git a/Robust.Shared/Audio/AudioDebugCommands.cs b/Robust.Shared/Audio/AudioDebugCommands.cs index d952b48dd2..150d7efa06 100644 --- a/Robust.Shared/Audio/AudioDebugCommands.cs +++ b/Robust.Shared/Audio/AudioDebugCommands.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Shared.Audio; -internal sealed class AudioDebugCommands : LocalizedCommands +internal sealed partial class AudioDebugCommands : LocalizedCommands { - [Dependency] private readonly IEntitySystemManager _entitySystem = default!; + [Dependency] private IEntitySystemManager _entitySystem = default!; public override string Command => "audio_length"; diff --git a/Robust.Shared/Audio/Systems/SharedAudioSystem.cs b/Robust.Shared/Audio/Systems/SharedAudioSystem.cs index e1f9df0a00..747b973562 100644 --- a/Robust.Shared/Audio/Systems/SharedAudioSystem.cs +++ b/Robust.Shared/Audio/Systems/SharedAudioSystem.cs @@ -29,13 +29,13 @@ namespace Robust.Shared.Audio.Systems; /// public abstract partial class SharedAudioSystem : EntitySystem { - [Dependency] protected readonly IConfigurationManager CfgManager = default!; - [Dependency] protected readonly IGameTiming Timing = default!; - [Dependency] private readonly INetManager _netManager = default!; - [Dependency] protected readonly IPrototypeManager ProtoMan = default!; - [Dependency] protected readonly IRobustRandom RandMan = default!; - [Dependency] protected readonly MetaDataSystem MetadataSys = default!; - [Dependency] protected readonly SharedTransformSystem XformSystem = default!; + [Dependency] protected IConfigurationManager CfgManager = default!; + [Dependency] protected IGameTiming Timing = default!; + [Dependency] private INetManager _netManager = default!; + [Dependency] protected IPrototypeManager ProtoMan = default!; + [Dependency] protected IRobustRandom RandMan = default!; + [Dependency] protected MetaDataSystem MetadataSys = default!; + [Dependency] protected SharedTransformSystem XformSystem = default!; public const float AudioDespawnBuffer = 1f; diff --git a/Robust.Shared/ComponentTrees/ComponentTreeSystem.cs b/Robust.Shared/ComponentTrees/ComponentTreeSystem.cs index 1908aac801..ded59959fe 100644 --- a/Robust.Shared/ComponentTrees/ComponentTreeSystem.cs +++ b/Robust.Shared/ComponentTrees/ComponentTreeSystem.cs @@ -19,14 +19,14 @@ namespace Robust.Shared.ComponentTrees; /// Keeps track of s for various rendering-related components. /// [UsedImplicitly] -public abstract class ComponentTreeSystem : EntitySystem +public abstract partial class ComponentTreeSystem : EntitySystem where TTreeComp : Component, IComponentTreeComponent, new() where TComp : Component, IComponentTreeEntry { - [Dependency] private readonly RecursiveMoveSystem _recursiveMoveSys = default!; - [Dependency] protected readonly SharedTransformSystem XformSystem = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private RecursiveMoveSystem _recursiveMoveSys = default!; + [Dependency] protected SharedTransformSystem XformSystem = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; private readonly Queue> _updateQueue = new(); protected EntityQuery Query; diff --git a/Robust.Shared/ComponentTrees/RecursiveMoveSystem.cs b/Robust.Shared/ComponentTrees/RecursiveMoveSystem.cs index 1955471ab4..f44086d71f 100644 --- a/Robust.Shared/ComponentTrees/RecursiveMoveSystem.cs +++ b/Robust.Shared/ComponentTrees/RecursiveMoveSystem.cs @@ -12,9 +12,9 @@ namespace Robust.Shared.ComponentTrees; /// /// This is used by some client-side systems (e.g., sprites, lights, etc). However this can be quite expensive and if possible should not be used by the server. /// -internal sealed class RecursiveMoveSystem : EntitySystem +internal sealed partial class RecursiveMoveSystem : EntitySystem { - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private SharedTransformSystem _transform = default!; public delegate void TreeRecursiveMoveEventHandler(EntityUid uid, TransformComponent xform); diff --git a/Robust.Shared/Configuration/ConfigurationCommands.cs b/Robust.Shared/Configuration/ConfigurationCommands.cs index 2ddb71aa77..c7debdf7b0 100644 --- a/Robust.Shared/Configuration/ConfigurationCommands.cs +++ b/Robust.Shared/Configuration/ConfigurationCommands.cs @@ -81,9 +81,9 @@ namespace Robust.Shared.Configuration } [SuppressMessage("ReSharper", "StringLiteralTypo")] - internal sealed class CVarCommand : LocalizedCommands + internal sealed partial class CVarCommand : LocalizedCommands { - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; public override string Command => "cvar"; @@ -155,9 +155,9 @@ namespace Robust.Shared.Configuration } } - internal sealed class CVarSubsCommand : LocalizedCommands + internal sealed partial class CVarSubsCommand : LocalizedCommands { - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; public override string Command => "cvar_subs"; @@ -198,9 +198,9 @@ namespace Robust.Shared.Configuration } } - internal sealed class ConfigMarkRollbackCommand : IConsoleCommand + internal sealed partial class ConfigMarkRollbackCommand : IConsoleCommand { - [Dependency] private readonly IConfigurationManager _cfg = null!; + [Dependency] private IConfigurationManager _cfg = null!; public string Command => "config_rollback_mark"; public string Description => ""; @@ -230,9 +230,9 @@ namespace Robust.Shared.Configuration } } - internal sealed class ConfigUnmarkRollbackCommand : IConsoleCommand + internal sealed partial class ConfigUnmarkRollbackCommand : IConsoleCommand { - [Dependency] private readonly IConfigurationManager _cfg = null!; + [Dependency] private IConfigurationManager _cfg = null!; public string Command => "config_rollback_unmark"; public string Description => ""; @@ -263,9 +263,9 @@ namespace Robust.Shared.Configuration } - internal sealed class ConfigApplyRollbackCommand : IConsoleCommand + internal sealed partial class ConfigApplyRollbackCommand : IConsoleCommand { - [Dependency] private readonly IConfigurationManager _cfg = null!; + [Dependency] private IConfigurationManager _cfg = null!; public string Command => "config_rollback_apply"; public string Description => ""; diff --git a/Robust.Shared/Configuration/ConfigurationManager.cs b/Robust.Shared/Configuration/ConfigurationManager.cs index 376787f502..72844ae3dd 100644 --- a/Robust.Shared/Configuration/ConfigurationManager.cs +++ b/Robust.Shared/Configuration/ConfigurationManager.cs @@ -21,8 +21,8 @@ namespace Robust.Shared.Configuration [Virtual] internal partial class ConfigurationManager : IConfigurationManagerInternal { - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private ILogManager _logManager = default!; private const char TABLE_DELIMITER = '.'; protected readonly Dictionary _configVars = new(); diff --git a/Robust.Shared/Configuration/NetConfigurationManager.cs b/Robust.Shared/Configuration/NetConfigurationManager.cs index f13c0e7149..736b6d5286 100644 --- a/Robust.Shared/Configuration/NetConfigurationManager.cs +++ b/Robust.Shared/Configuration/NetConfigurationManager.cs @@ -66,10 +66,10 @@ namespace Robust.Shared.Configuration } /// - internal abstract class NetConfigurationManager : ConfigurationManager, INetConfigurationManagerInternal + internal abstract partial class NetConfigurationManager : ConfigurationManager, INetConfigurationManagerInternal { - [Dependency] protected readonly INetManager NetManager = null!; - [Dependency] protected readonly IGameTiming Timing = null!; + [Dependency] protected INetManager NetManager = null!; + [Dependency] protected IGameTiming Timing = null!; private readonly List _netVarsMessages = new(); diff --git a/Robust.Shared/Console/Commands/ConfigurationCommands.cs b/Robust.Shared/Console/Commands/ConfigurationCommands.cs index 50aec3af9b..f591c6636c 100644 --- a/Robust.Shared/Console/Commands/ConfigurationCommands.cs +++ b/Robust.Shared/Console/Commands/ConfigurationCommands.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Shared.Console.Commands; [UsedImplicitly] -public sealed class SaveConfig : LocalizedCommands +public sealed partial class SaveConfig : LocalizedCommands { - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; public override string Command => "saveconfig"; diff --git a/Robust.Shared/Console/Commands/DumpDependencyInjectors.cs b/Robust.Shared/Console/Commands/DumpDependencyInjectors.cs index 941f821c32..49ec4c192e 100644 --- a/Robust.Shared/Console/Commands/DumpDependencyInjectors.cs +++ b/Robust.Shared/Console/Commands/DumpDependencyInjectors.cs @@ -3,9 +3,9 @@ using Robust.Shared.Localization; namespace Robust.Shared.Console.Commands; -internal sealed class DumpDependencyInjectors : LocalizedCommands +internal sealed partial class DumpDependencyInjectors : LocalizedCommands { - [Dependency] private readonly IDependencyCollection _dependencies = default!; + [Dependency] private IDependencyCollection _dependencies = default!; public override string Command => "dump_dependency_injectors"; diff --git a/Robust.Shared/Console/Commands/DumpEventTablesCommand.cs b/Robust.Shared/Console/Commands/DumpEventTablesCommand.cs index 3d9f2a1fee..3bec6d1ccc 100644 --- a/Robust.Shared/Console/Commands/DumpEventTablesCommand.cs +++ b/Robust.Shared/Console/Commands/DumpEventTablesCommand.cs @@ -4,10 +4,10 @@ using Robust.Shared.Localization; namespace Robust.Shared.Console.Commands; -internal sealed class DumpEventTablesCommand : LocalizedCommands +internal sealed partial class DumpEventTablesCommand : LocalizedCommands { - [Dependency] private readonly EntityManager _entities = default!; - [Dependency] private readonly IComponentFactory _componentFactory = default!; + [Dependency] private EntityManager _entities = default!; + [Dependency] private IComponentFactory _componentFactory = default!; public override string Command => "dump_event_tables"; diff --git a/Robust.Shared/Console/Commands/DumpNetComponentsCommand.cs b/Robust.Shared/Console/Commands/DumpNetComponentsCommand.cs index 0f9d0615b4..d87373a879 100644 --- a/Robust.Shared/Console/Commands/DumpNetComponentsCommand.cs +++ b/Robust.Shared/Console/Commands/DumpNetComponentsCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Localization; namespace Robust.Shared.Console.Commands; -internal sealed class DumpNetComponentsCommand : LocalizedCommands +internal sealed partial class DumpNetComponentsCommand : LocalizedCommands { - [Dependency] private readonly IComponentFactory _componentFactory = default!; + [Dependency] private IComponentFactory _componentFactory = default!; public override string Command => "dump_net_comps"; diff --git a/Robust.Shared/Console/Commands/DumpSerializerTypeMapCommand.cs b/Robust.Shared/Console/Commands/DumpSerializerTypeMapCommand.cs index 1f24ab33f2..b859be87b0 100644 --- a/Robust.Shared/Console/Commands/DumpSerializerTypeMapCommand.cs +++ b/Robust.Shared/Console/Commands/DumpSerializerTypeMapCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Serialization; namespace Robust.Shared.Console.Commands; -internal sealed class DumpSerializerTypeMapCommand : LocalizedCommands +internal sealed partial class DumpSerializerTypeMapCommand : LocalizedCommands { - [Dependency] private readonly IRobustSerializerInternal _robustSerializer = default!; + [Dependency] private IRobustSerializerInternal _robustSerializer = default!; public override string Command => "dump_netserializer_type_map"; diff --git a/Robust.Shared/Console/Commands/DumpStringTableCommand.cs b/Robust.Shared/Console/Commands/DumpStringTableCommand.cs index 190a52f221..da65f9f3d7 100644 --- a/Robust.Shared/Console/Commands/DumpStringTableCommand.cs +++ b/Robust.Shared/Console/Commands/DumpStringTableCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Network; namespace Robust.Shared.Console.Commands; -internal sealed class DumpStringTableCommand : IConsoleCommand +internal sealed partial class DumpStringTableCommand : IConsoleCommand { - [Dependency] private readonly INetManager _netManager = default!; + [Dependency] private INetManager _netManager = default!; public string Command => "net_dumpstringtable"; public string Description => ""; diff --git a/Robust.Shared/Console/Commands/ExecCommand.cs b/Robust.Shared/Console/Commands/ExecCommand.cs index ad794a363f..34fc01db5f 100644 --- a/Robust.Shared/Console/Commands/ExecCommand.cs +++ b/Robust.Shared/Console/Commands/ExecCommand.cs @@ -8,11 +8,11 @@ using Robust.Shared.Utility; namespace Robust.Shared.Console.Commands { [UsedImplicitly] - internal sealed class ExecCommand : LocalizedCommands + internal sealed partial class ExecCommand : LocalizedCommands { private static readonly Regex CommentRegex = new Regex(@"^\s*#"); - [Dependency] private readonly IResourceManager _resources = default!; + [Dependency] private IResourceManager _resources = default!; public override string Command => "exec"; diff --git a/Robust.Shared/Console/Commands/LogCommands.cs b/Robust.Shared/Console/Commands/LogCommands.cs index a216b1b750..0bf96a3696 100644 --- a/Robust.Shared/Console/Commands/LogCommands.cs +++ b/Robust.Shared/Console/Commands/LogCommands.cs @@ -5,11 +5,11 @@ using Robust.Shared.Log; namespace Robust.Shared.Console.Commands; -internal sealed class LogSetLevelCommand : LocalizedCommands +internal sealed partial class LogSetLevelCommand : LocalizedCommands { private const string LevelNull = "null"; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private ILogManager _logManager = default!; public override string Command => "loglevel"; public override void Execute(IConsoleShell shell, string argStr, string[] args) @@ -60,9 +60,9 @@ internal sealed class LogSetLevelCommand : LocalizedCommands } } -internal sealed class TestLog : LocalizedCommands +internal sealed partial class TestLog : LocalizedCommands { - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private ILogManager _logManager = default!; public override string Command => "testlog"; diff --git a/Robust.Shared/Console/Commands/MapCommands.cs b/Robust.Shared/Console/Commands/MapCommands.cs index 217fa4fa94..1c679f414f 100644 --- a/Robust.Shared/Console/Commands/MapCommands.cs +++ b/Robust.Shared/Console/Commands/MapCommands.cs @@ -8,9 +8,9 @@ using Robust.Shared.Map.Components; namespace Robust.Shared.Console.Commands; -sealed class AddMapCommand : LocalizedEntityCommands +sealed partial class AddMapCommand : LocalizedEntityCommands { - [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; public override string Command => "addmap"; public override bool RequireServerOrSingleplayer => true; @@ -49,9 +49,9 @@ sealed class AddMapCommand : LocalizedEntityCommands } } -sealed class RemoveMapCommand : LocalizedEntityCommands +sealed partial class RemoveMapCommand : LocalizedEntityCommands { - [Dependency] private readonly IEntitySystemManager _systems = default!; + [Dependency] private IEntitySystemManager _systems = default!; public override string Command => "rmmap"; public override bool RequireServerOrSingleplayer => true; @@ -120,9 +120,9 @@ sealed class RemoveGridCommand : LocalizedEntityCommands } } -internal sealed class RunMapInitCommand : LocalizedEntityCommands +internal sealed partial class RunMapInitCommand : LocalizedEntityCommands { - [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; public override string Command => "mapinit"; public override bool RequireServerOrSingleplayer => true; @@ -154,11 +154,11 @@ internal sealed class RunMapInitCommand : LocalizedEntityCommands } } -internal sealed class ListMapsCommand : LocalizedEntityCommands +internal sealed partial class ListMapsCommand : LocalizedEntityCommands { - [Dependency] private readonly IEntityManager _entManager = default!; - [Dependency] private readonly IMapManager _map = default!; - [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private IEntityManager _entManager = default!; + [Dependency] private IMapManager _map = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; public override string Command => "lsmap"; @@ -188,10 +188,10 @@ internal sealed class ListMapsCommand : LocalizedEntityCommands } } -internal sealed class ListGridsCommand : LocalizedEntityCommands +internal sealed partial class ListGridsCommand : LocalizedEntityCommands { [Dependency] - private readonly SharedTransformSystem _transformSystem = default!; + private SharedTransformSystem _transformSystem = default!; public override string Command => "lsgrid"; diff --git a/Robust.Shared/Console/Commands/SerializerStatsCommand.cs b/Robust.Shared/Console/Commands/SerializerStatsCommand.cs index 6400e88d31..1b2c9c7af0 100644 --- a/Robust.Shared/Console/Commands/SerializerStatsCommand.cs +++ b/Robust.Shared/Console/Commands/SerializerStatsCommand.cs @@ -3,9 +3,9 @@ using Robust.Shared.Serialization; namespace Robust.Shared.Console.Commands; -internal sealed class SerializeStatsCommand : LocalizedCommands +internal sealed partial class SerializeStatsCommand : LocalizedCommands { - [Dependency] private readonly IRobustSerializerInternal _robustSerializer = default!; + [Dependency] private IRobustSerializerInternal _robustSerializer = default!; public override string Command => "szr_stats"; diff --git a/Robust.Shared/Console/Commands/SpawnCommand.cs b/Robust.Shared/Console/Commands/SpawnCommand.cs index 28f82a05e8..bfb9110d56 100644 --- a/Robust.Shared/Console/Commands/SpawnCommand.cs +++ b/Robust.Shared/Console/Commands/SpawnCommand.cs @@ -6,9 +6,9 @@ using Robust.Shared.Placement; namespace Robust.Shared.Console.Commands; -public sealed class SpawnCommand : LocalizedCommands +public sealed partial class SpawnCommand : LocalizedCommands { - [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private IEntityManager _entityManager = default!; public override string Command => "spawn"; public override bool RequireServerOrSingleplayer => true; diff --git a/Robust.Shared/Console/Commands/TeleportCommands.cs b/Robust.Shared/Console/Commands/TeleportCommands.cs index ee4aad9220..c028ae2a89 100644 --- a/Robust.Shared/Console/Commands/TeleportCommands.cs +++ b/Robust.Shared/Console/Commands/TeleportCommands.cs @@ -15,12 +15,12 @@ using Robust.Shared.Utility; namespace Robust.Shared.Console.Commands; -internal sealed class TeleportCommand : LocalizedEntityCommands +internal sealed partial class TeleportCommand : LocalizedEntityCommands { - [Dependency] private readonly IMapManager _map = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private IMapManager _map = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; public override string Command => "tp"; public override bool RequireServerOrSingleplayer => true; @@ -83,11 +83,11 @@ internal sealed class TeleportCommand : LocalizedEntityCommands } } -public sealed class TeleportToCommand : LocalizedEntityCommands +public sealed partial class TeleportToCommand : LocalizedEntityCommands { - [Dependency] private readonly ISharedPlayerManager _players = default!; - [Dependency] private readonly IEntityManager _entities = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private ISharedPlayerManager _players = default!; + [Dependency] private IEntityManager _entities = default!; + [Dependency] private SharedTransformSystem _transform = default!; public override string Command => "tpto"; public override bool RequireServerOrSingleplayer => true; @@ -191,10 +191,10 @@ public sealed class TeleportToCommand : LocalizedEntityCommands } } -sealed class LocationCommand : LocalizedEntityCommands +sealed partial class LocationCommand : LocalizedEntityCommands { - [Dependency] private readonly IEntityManager _ent = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private IEntityManager _ent = default!; + [Dependency] private SharedTransformSystem _transform = default!; public override string Command => "loc"; @@ -213,10 +213,10 @@ sealed class LocationCommand : LocalizedEntityCommands } } -sealed class TpGridCommand : LocalizedEntityCommands +sealed partial class TpGridCommand : LocalizedEntityCommands { - [Dependency] private readonly IEntityManager _ent = default!; - [Dependency] private readonly SharedMapSystem _map = default!; + [Dependency] private IEntityManager _ent = default!; + [Dependency] private SharedMapSystem _map = default!; public override string Command => "tpgrid"; public override bool RequireServerOrSingleplayer => true; diff --git a/Robust.Shared/Console/Commands/VfsCommands.cs b/Robust.Shared/Console/Commands/VfsCommands.cs index 1f13edb9d4..3bcca42bfe 100644 --- a/Robust.Shared/Console/Commands/VfsCommands.cs +++ b/Robust.Shared/Console/Commands/VfsCommands.cs @@ -4,9 +4,9 @@ using Robust.Shared.Utility; namespace Robust.Shared.Console.Commands; -public sealed class VfsListCommand : LocalizedCommands +public sealed partial class VfsListCommand : LocalizedCommands { - [Dependency] private readonly IResourceManager _resourceManager = default!; + [Dependency] private IResourceManager _resourceManager = default!; public override string Command => "vfs_ls"; diff --git a/Robust.Shared/Console/ConsoleHost.cs b/Robust.Shared/Console/ConsoleHost.cs index b26f246604..5b6c239ec1 100644 --- a/Robust.Shared/Console/ConsoleHost.cs +++ b/Robust.Shared/Console/ConsoleHost.cs @@ -17,16 +17,16 @@ using Robust.Shared.ViewVariables; namespace Robust.Shared.Console { /// - public abstract class ConsoleHost : IConsoleHost + public abstract partial class ConsoleHost : IConsoleHost { protected const string SawmillName = "con"; - [Dependency] protected readonly ILogManager LogManager = default!; - [Dependency] private readonly IReflectionManager ReflectionManager = default!; - [Dependency] protected readonly INetManager NetManager = default!; - [Dependency] private readonly IDynamicTypeFactoryInternal _typeFactory = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] protected readonly ILocalizationManager LocalizationManager = default!; + [Dependency] protected ILogManager LogManager = default!; + [Dependency] private IReflectionManager ReflectionManager = default!; + [Dependency] protected INetManager NetManager = default!; + [Dependency] private IDynamicTypeFactoryInternal _typeFactory = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] protected ILocalizationManager LocalizationManager = default!; [ViewVariables] protected readonly Dictionary RegisteredCommands = new(); [ViewVariables] private readonly HashSet _autoRegisteredCommands = []; diff --git a/Robust.Shared/Console/EntityConsoleHost.cs b/Robust.Shared/Console/EntityConsoleHost.cs index bea23aa229..40f9aa7260 100644 --- a/Robust.Shared/Console/EntityConsoleHost.cs +++ b/Robust.Shared/Console/EntityConsoleHost.cs @@ -13,11 +13,11 @@ namespace Robust.Shared.Console; /// /// See for details on what "entity" console commands are. /// -internal sealed class EntityConsoleHost +internal sealed partial class EntityConsoleHost { - [Dependency] private readonly IConsoleHost _consoleHost = default!; - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private IConsoleHost _consoleHost = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IEntitySystemManager _entitySystemManager = default!; private readonly HashSet _entityCommands = []; diff --git a/Robust.Shared/Console/LocalizedCommands.cs b/Robust.Shared/Console/LocalizedCommands.cs index c2a9815064..fd7868efcc 100644 --- a/Robust.Shared/Console/LocalizedCommands.cs +++ b/Robust.Shared/Console/LocalizedCommands.cs @@ -13,9 +13,9 @@ namespace Robust.Shared.Console; /// /// For server commands, it is much preferred to use . /// -public abstract class LocalizedCommands : IConsoleCommand +public abstract partial class LocalizedCommands : IConsoleCommand { - [Dependency] protected readonly ILocalizationManager LocalizationManager = default!; + [Dependency] protected ILocalizationManager LocalizationManager = default!; public ILocalizationManager Loc => LocalizationManager; @@ -57,8 +57,8 @@ public abstract class LocalizedCommands : IConsoleCommand /// These commands are allowed to take dependencies on entity systems, reducing boilerplate for many usages. /// /// -public abstract class LocalizedEntityCommands : LocalizedCommands, IEntityConsoleCommand +public abstract partial class LocalizedEntityCommands : LocalizedCommands, IEntityConsoleCommand { [Dependency] - protected readonly EntityManager EntityManager = default!; + protected EntityManager EntityManager = default!; } diff --git a/Robust.Shared/Containers/SharedContainerSystem.cs b/Robust.Shared/Containers/SharedContainerSystem.cs index b86a0a999d..6b6ca8bc6a 100644 --- a/Robust.Shared/Containers/SharedContainerSystem.cs +++ b/Robust.Shared/Containers/SharedContainerSystem.cs @@ -20,13 +20,13 @@ namespace Robust.Shared.Containers { public abstract partial class SharedContainerSystem { - [Dependency] private readonly IDynamicTypeFactoryInternal _dynFactory = default!; - [Dependency] private readonly INetManager _net = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly SharedJointSystem _joint = default!; - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private IDynamicTypeFactoryInternal _dynFactory = default!; + [Dependency] private INetManager _net = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; + [Dependency] private EntityLookupSystem _lookup = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private SharedJointSystem _joint = default!; + [Dependency] private IGameTiming _timing = default!; private EntityQuery _managerQuery; private EntityQuery _gridQuery; diff --git a/Robust.Shared/ContentPack/BaseModLoader.cs b/Robust.Shared/ContentPack/BaseModLoader.cs index 830ba56b20..93a6d1a59d 100644 --- a/Robust.Shared/ContentPack/BaseModLoader.cs +++ b/Robust.Shared/ContentPack/BaseModLoader.cs @@ -9,11 +9,11 @@ using Robust.Shared.Timing; namespace Robust.Shared.ContentPack { - internal abstract class BaseModLoader : IPostInjectInit + internal abstract partial class BaseModLoader : IPostInjectInit { - [Dependency] protected readonly IReflectionManager ReflectionManager = default!; - [Dependency] protected readonly ILogManager LogManager = default!; - [Dependency] private readonly IDependencyCollection _dependencies = default!; + [Dependency] protected IReflectionManager ReflectionManager = default!; + [Dependency] protected ILogManager LogManager = default!; + [Dependency] private IDependencyCollection _dependencies = default!; private readonly List _testingCallbacks = new(); diff --git a/Robust.Shared/ContentPack/ModLoader.cs b/Robust.Shared/ContentPack/ModLoader.cs index 64820e1cc3..8d6e55d17c 100644 --- a/Robust.Shared/ContentPack/ModLoader.cs +++ b/Robust.Shared/ContentPack/ModLoader.cs @@ -18,9 +18,9 @@ namespace Robust.Shared.ContentPack /// /// Class for managing the loading of assemblies into the engine. /// - internal sealed class ModLoader : BaseModLoader, IModLoaderInternal, IDisposable + internal sealed partial class ModLoader : BaseModLoader, IModLoaderInternal, IDisposable { - [Dependency] private readonly IResourceManagerInternal _res = default!; + [Dependency] private IResourceManagerInternal _res = default!; // List of extra assemblies side-loaded from the /Assemblies/ mounted path. private readonly List _sideModules = new(); diff --git a/Robust.Shared/ContentPack/ResourceManager.cs b/Robust.Shared/ContentPack/ResourceManager.cs index 53657554f9..b58f22eb18 100644 --- a/Robust.Shared/ContentPack/ResourceManager.cs +++ b/Robust.Shared/ContentPack/ResourceManager.cs @@ -18,8 +18,8 @@ namespace Robust.Shared.ContentPack [Virtual] internal partial class ResourceManager : IResourceManagerInternal { - [Dependency] private readonly IConfigurationManager _config = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IConfigurationManager _config = default!; + [Dependency] private ILogManager _logManager = default!; private (ResPath prefix, IContentRoot root)[] _contentRoots = new (ResPath prefix, IContentRoot root)[0]; diff --git a/Robust.Shared/EntitySerialization/EntityDeserializer.cs b/Robust.Shared/EntitySerialization/EntityDeserializer.cs index cd4bae33d4..a5be87519c 100644 --- a/Robust.Shared/EntitySerialization/EntityDeserializer.cs +++ b/Robust.Shared/EntitySerialization/EntityDeserializer.cs @@ -27,7 +27,7 @@ namespace Robust.Shared.EntitySerialization; /// This class provides methods for deserializing entities from yaml. It provides some more control over /// serialization than the methods provided by . /// -public sealed class EntityDeserializer : +public sealed partial class EntityDeserializer : ISerializationContext, ITypeSerializer, ITypeSerializer, @@ -44,14 +44,14 @@ public sealed class EntityDeserializer : public SerializationManager.SerializerProvider SerializerProvider { get; } = new(); - [Dependency] public readonly EntityManager EntMan = default!; - [Dependency] public readonly IGameTiming Timing = default!; - [Dependency] private readonly ISerializationManager _seriMan = default!; - [Dependency] private readonly IComponentFactory _factory = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; - [Dependency] private readonly SharedMapSystem _map = default!; - [Dependency] private readonly ILogManager _logMan = default!; - [Dependency] private readonly IDependencyCollection _deps = default!; + [Dependency] public EntityManager EntMan = default!; + [Dependency] public IGameTiming Timing = default!; + [Dependency] private ISerializationManager _seriMan = default!; + [Dependency] private IComponentFactory _factory = default!; + [Dependency] private IPrototypeManager _proto = default!; + [Dependency] private SharedMapSystem _map = default!; + [Dependency] private ILogManager _logMan = default!; + [Dependency] private IDependencyCollection _deps = default!; private readonly ISawmill _log; private Stopwatch _stopwatch = new(); diff --git a/Robust.Shared/EntitySerialization/EntitySerializer.cs b/Robust.Shared/EntitySerialization/EntitySerializer.cs index 79bb364a77..7d3971cad2 100644 --- a/Robust.Shared/EntitySerialization/EntitySerializer.cs +++ b/Robust.Shared/EntitySerialization/EntitySerializer.cs @@ -36,7 +36,7 @@ namespace Robust.Shared.EntitySerialization; /// document using the various "Write" methods. (e.g., ). After a one has finished using /// the generated data, the serializer needs to be reset () using it again to serialize other entities. /// -public sealed class EntitySerializer : ISerializationContext, +public sealed partial class EntitySerializer : ISerializationContext, ITypeSerializer, ITypeSerializer, ITypeSerializer @@ -50,14 +50,14 @@ public sealed class EntitySerializer : ISerializationContext, public SerializationManager.SerializerProvider SerializerProvider { get; } = new(); - [Dependency] public readonly EntityManager EntMan = default!; - [Dependency] public readonly IGameTiming Timing = default!; - [Dependency] private readonly IComponentFactory _factory = default!; - [Dependency] private readonly ISerializationManager _serialization = default!; - [Dependency] private readonly ITileDefinitionManager _tileDef = default!; - [Dependency] private readonly IConfigurationManager _conf = default!; - [Dependency] private readonly ILogManager _logMan = default!; - [Dependency] private readonly SharedMapSystem _map = default!; + [Dependency] public EntityManager EntMan = default!; + [Dependency] public IGameTiming Timing = default!; + [Dependency] private IComponentFactory _factory = default!; + [Dependency] private ISerializationManager _serialization = default!; + [Dependency] private ITileDefinitionManager _tileDef = default!; + [Dependency] private IConfigurationManager _conf = default!; + [Dependency] private ILogManager _logMan = default!; + [Dependency] private SharedMapSystem _map = default!; private readonly ISawmill _log; public readonly Dictionary YamlUidMap = new(); diff --git a/Robust.Shared/EntitySerialization/Systems/MapLoaderSystem.cs b/Robust.Shared/EntitySerialization/Systems/MapLoaderSystem.cs index 59d581f88b..429be6c545 100644 --- a/Robust.Shared/EntitySerialization/Systems/MapLoaderSystem.cs +++ b/Robust.Shared/EntitySerialization/Systems/MapLoaderSystem.cs @@ -24,10 +24,10 @@ namespace Robust.Shared.EntitySerialization.Systems; /// public sealed partial class MapLoaderSystem : EntitySystem { - [Dependency] private readonly IResourceManager _resourceManager = default!; - [Dependency] private readonly SharedMapSystem _mapSystem = default!; - [Dependency] private readonly SharedTransformSystem _xform = default!; - [Dependency] private readonly IDependencyCollection _dependency = default!; + [Dependency] private IResourceManager _resourceManager = default!; + [Dependency] private SharedMapSystem _mapSystem = default!; + [Dependency] private SharedTransformSystem _xform = default!; + [Dependency] private IDependencyCollection _dependency = default!; private Stopwatch _stopwatch = new(); diff --git a/Robust.Shared/Exceptions/RuntimeLog.cs b/Robust.Shared/Exceptions/RuntimeLog.cs index 9213e68d16..769dfa9068 100644 --- a/Robust.Shared/Exceptions/RuntimeLog.cs +++ b/Robust.Shared/Exceptions/RuntimeLog.cs @@ -9,9 +9,9 @@ using Robust.Shared.Log; namespace Robust.Shared.Exceptions { - internal sealed class RuntimeLog : IRuntimeLog, IPostInjectInit + internal sealed partial class RuntimeLog : IRuntimeLog, IPostInjectInit { - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private ILogManager _logManager = default!; private readonly Dictionary> exceptions = new(); private ISawmill _sawmill = default!; diff --git a/Robust.Shared/GameObjects/Components/Transform/TransformComponent.cs b/Robust.Shared/GameObjects/Components/Transform/TransformComponent.cs index e73ab638bb..f2e132d06c 100644 --- a/Robust.Shared/GameObjects/Components/Transform/TransformComponent.cs +++ b/Robust.Shared/GameObjects/Components/Transform/TransformComponent.cs @@ -25,7 +25,7 @@ namespace Robust.Shared.GameObjects [RegisterComponent, NetworkedComponent] public sealed partial class TransformComponent : Component, IComponentDebug { - [Dependency] private readonly IEntityManager _entMan = default!; + [Dependency] private IEntityManager _entMan = default!; // Currently this field just exists for VV. In future, it might become a real field [ViewVariables, PublicAPI] @@ -103,7 +103,7 @@ namespace Robust.Shared.GameObjects [ViewVariables] internal readonly HashSet _children = new(); - [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private IMapManager _mapManager = default!; /// /// Returns the index of the map which this object is on diff --git a/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs b/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs index a170c34745..3e2ee892ee 100644 --- a/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs +++ b/Robust.Shared/GameObjects/Components/UserInterface/BoundUserInterface.cs @@ -9,10 +9,10 @@ namespace Robust.Shared.GameObjects /// /// An abstract class to override to implement bound user interfaces. /// - public abstract class BoundUserInterface : IDisposable + public abstract partial class BoundUserInterface : IDisposable { - [Dependency] protected internal readonly IEntityManager EntMan = default!; - [Dependency] protected readonly ISharedPlayerManager PlayerManager = default!; + [Dependency] protected internal IEntityManager EntMan = default!; + [Dependency] protected ISharedPlayerManager PlayerManager = default!; protected readonly SharedUserInterfaceSystem UiSystem; public bool IsOpened { get; protected set; } diff --git a/Robust.Shared/GameObjects/EntityManager.Components.cs b/Robust.Shared/GameObjects/EntityManager.Components.cs index d730844600..b36fa6d1b2 100644 --- a/Robust.Shared/GameObjects/EntityManager.Components.cs +++ b/Robust.Shared/GameObjects/EntityManager.Components.cs @@ -23,7 +23,7 @@ namespace Robust.Shared.GameObjects { public partial class EntityManager { - [IoC.Dependency] private readonly IComponentFactory _componentFactory = default!; + [IoC.Dependency] private IComponentFactory _componentFactory = default!; #if EXCEPTION_TOLERANCE [IoC.Dependency] private readonly IRuntimeLog _runtimeLog = default!; diff --git a/Robust.Shared/GameObjects/EntityManager.cs b/Robust.Shared/GameObjects/EntityManager.cs index 7cc13328e0..2df50e9dbf 100644 --- a/Robust.Shared/GameObjects/EntityManager.cs +++ b/Robust.Shared/GameObjects/EntityManager.cs @@ -34,16 +34,16 @@ namespace Robust.Shared.GameObjects { #region Dependencies - [IoC.Dependency] protected readonly IPrototypeManager PrototypeManager = default!; - [IoC.Dependency] protected readonly ILogManager LogManager = default!; - [IoC.Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; - [IoC.Dependency] private readonly IMapManager _mapManager = default!; - [IoC.Dependency] private readonly IGameTiming _gameTiming = default!; - [IoC.Dependency] private readonly ISerializationManager _serManager = default!; - [IoC.Dependency] private readonly ProfManager _prof = default!; - [IoC.Dependency] private readonly INetManager _netMan = default!; - [IoC.Dependency] private readonly IReflectionManager _reflection = default!; - [IoC.Dependency] private readonly EntityConsoleHost _entityConsoleHost = default!; + [IoC.Dependency] protected IPrototypeManager PrototypeManager = default!; + [IoC.Dependency] protected ILogManager LogManager = default!; + [IoC.Dependency] private IEntitySystemManager _entitySystemManager = default!; + [IoC.Dependency] private IMapManager _mapManager = default!; + [IoC.Dependency] private IGameTiming _gameTiming = default!; + [IoC.Dependency] private ISerializationManager _serManager = default!; + [IoC.Dependency] private ProfManager _prof = default!; + [IoC.Dependency] private INetManager _netMan = default!; + [IoC.Dependency] private IReflectionManager _reflection = default!; + [IoC.Dependency] private EntityConsoleHost _entityConsoleHost = default!; // I feel like PJB might shed me for putting a system dependency here, but its required for setting entity // positions on spawn.... diff --git a/Robust.Shared/GameObjects/EntitySystem.cs b/Robust.Shared/GameObjects/EntitySystem.cs index 7a6bdee9e5..e4f7e94480 100644 --- a/Robust.Shared/GameObjects/EntitySystem.cs +++ b/Robust.Shared/GameObjects/EntitySystem.cs @@ -23,11 +23,11 @@ namespace Robust.Shared.GameObjects [Reflect(false), PublicAPI] public abstract partial class EntitySystem : IEntitySystem, IPostInjectInit { - [Dependency] protected readonly EntityManager EntityManager = default!; - [Dependency] protected readonly ILogManager LogManager = default!; - [Dependency] private readonly ISharedPlayerManager _playerMan = default!; - [Dependency] private readonly IReplayRecordingManager _replayMan = default!; - [Dependency] protected readonly ILocalizationManager Loc = default!; + [Dependency] protected EntityManager EntityManager = default!; + [Dependency] protected ILogManager LogManager = default!; + [Dependency] private ISharedPlayerManager _playerMan = default!; + [Dependency] private IReplayRecordingManager _replayMan = default!; + [Dependency] protected ILocalizationManager Loc = default!; protected IComponentFactory Factory => EntityManager.ComponentFactory; diff --git a/Robust.Shared/GameObjects/EntitySystemManager.cs b/Robust.Shared/GameObjects/EntitySystemManager.cs index 80b13d3db7..c22fb8b752 100644 --- a/Robust.Shared/GameObjects/EntitySystemManager.cs +++ b/Robust.Shared/GameObjects/EntitySystemManager.cs @@ -21,16 +21,16 @@ using Robust.Shared.Exceptions; namespace Robust.Shared.GameObjects { - public sealed class EntitySystemManager : IEntitySystemManager, IPostInjectInit + public sealed partial class EntitySystemManager : IEntitySystemManager, IPostInjectInit { - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] private readonly IEntityManager _entityManager = default!; - [Dependency] private readonly ProfManager _profManager = default!; - [Dependency] private readonly IDependencyCollection _dependencyCollection = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] private IEntityManager _entityManager = default!; + [Dependency] private ProfManager _profManager = default!; + [Dependency] private IDependencyCollection _dependencyCollection = default!; + [Dependency] private ILogManager _logManager = default!; #if EXCEPTION_TOLERANCE - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; #endif private ISawmill _sawmill = default!; diff --git a/Robust.Shared/GameObjects/EntitySystemUpdateOrderCommand.cs b/Robust.Shared/GameObjects/EntitySystemUpdateOrderCommand.cs index ec75bb18a6..94944358d3 100644 --- a/Robust.Shared/GameObjects/EntitySystemUpdateOrderCommand.cs +++ b/Robust.Shared/GameObjects/EntitySystemUpdateOrderCommand.cs @@ -6,9 +6,9 @@ using Robust.Shared.Toolshed; namespace Robust.Shared.GameObjects; [ToolshedCommand] -internal sealed class EntitySystemUpdateOrderCommand : ToolshedCommand +internal sealed partial class EntitySystemUpdateOrderCommand : ToolshedCommand { - [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + [Dependency] private IEntitySystemManager _entitySystemManager = default!; [CommandImplementation("tick")] public IEnumerable Tick() diff --git a/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs b/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs index 529d59e4dd..f900e090ed 100644 --- a/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs +++ b/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs @@ -4,7 +4,7 @@ using Robust.Shared.Physics.Systems; namespace Robust.Shared.GameObjects { - public sealed class CollideOnAnchorSystem : EntitySystem + public sealed partial class CollideOnAnchorSystem : EntitySystem { [Dependency] private SharedPhysicsSystem _physics = default!; diff --git a/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs b/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs index 8b181b1fa8..5a67cd8583 100644 --- a/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs +++ b/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs @@ -6,9 +6,9 @@ using Robust.Shared.Physics.Systems; namespace Robust.Shared.GameObjects { - public sealed class CollisionWakeSystem : EntitySystem + public sealed partial class CollisionWakeSystem : EntitySystem { - [Dependency] private readonly SharedPhysicsSystem _physics = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; private EntityQuery _query; public override void Initialize() diff --git a/Robust.Shared/GameObjects/Systems/EntityLookupSystem.cs b/Robust.Shared/GameObjects/Systems/EntityLookupSystem.cs index 7cd3f0f4d6..1d1e90c671 100644 --- a/Robust.Shared/GameObjects/Systems/EntityLookupSystem.cs +++ b/Robust.Shared/GameObjects/Systems/EntityLookupSystem.cs @@ -72,15 +72,15 @@ public record struct WorldAABBEvent public sealed partial class EntityLookupSystem : EntitySystem { - [Dependency] private readonly IManifoldManager _manifoldManager = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly INetManager _netMan = default!; - [Dependency] private readonly SharedContainerSystem _container = default!; - [Dependency] private readonly FixtureSystem _fixtures = default!; - [Dependency] private readonly SharedMapSystem _map = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private IManifoldManager _manifoldManager = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private INetManager _netMan = default!; + [Dependency] private SharedContainerSystem _container = default!; + [Dependency] private FixtureSystem _fixtures = default!; + [Dependency] private SharedMapSystem _map = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; + [Dependency] private SharedTransformSystem _transform = default!; private EntityQuery _broadQuery; private EntityQuery _containerQuery; diff --git a/Robust.Shared/GameObjects/Systems/MetaDataSystem.cs b/Robust.Shared/GameObjects/Systems/MetaDataSystem.cs index 22aa0e331e..cd02f4c1a9 100644 --- a/Robust.Shared/GameObjects/Systems/MetaDataSystem.cs +++ b/Robust.Shared/GameObjects/Systems/MetaDataSystem.cs @@ -7,10 +7,10 @@ using Robust.Shared.Utility; namespace Robust.Shared.GameObjects; -public abstract class MetaDataSystem : EntitySystem +public abstract partial class MetaDataSystem : EntitySystem { - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private IPrototypeManager _proto = default!; private EntityPausedEvent _pausedEvent; diff --git a/Robust.Shared/GameObjects/Systems/PrototypeReloadSystem.cs b/Robust.Shared/GameObjects/Systems/PrototypeReloadSystem.cs index 074183ba1c..e514d97e8e 100644 --- a/Robust.Shared/GameObjects/Systems/PrototypeReloadSystem.cs +++ b/Robust.Shared/GameObjects/Systems/PrototypeReloadSystem.cs @@ -9,10 +9,10 @@ namespace Robust.Shared.GameObjects; /// /// Responsible for applying relevant changes to active entities when prototypes are reloaded. /// -internal sealed class PrototypeReloadSystem : EntitySystem +internal sealed partial class PrototypeReloadSystem : EntitySystem { - [Dependency] private readonly IPrototypeManager _prototypes = default!; - [Dependency] private readonly IComponentFactory _componentFactory = default!; + [Dependency] private IPrototypeManager _prototypes = default!; + [Dependency] private IComponentFactory _componentFactory = default!; public override void Initialize() { diff --git a/Robust.Shared/GameObjects/Systems/SharedAppearanceSystem.cs b/Robust.Shared/GameObjects/Systems/SharedAppearanceSystem.cs index 55905a26df..1b74ec852b 100644 --- a/Robust.Shared/GameObjects/Systems/SharedAppearanceSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedAppearanceSystem.cs @@ -9,9 +9,9 @@ using Robust.Shared.Utility; namespace Robust.Shared.GameObjects; -public abstract class SharedAppearanceSystem : EntitySystem +public abstract partial class SharedAppearanceSystem : EntitySystem { - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private IGameTiming _timing = default!; public override void Initialize() { diff --git a/Robust.Shared/GameObjects/Systems/SharedEyeSystem.cs b/Robust.Shared/GameObjects/Systems/SharedEyeSystem.cs index b756f9605c..43c4a81429 100644 --- a/Robust.Shared/GameObjects/Systems/SharedEyeSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedEyeSystem.cs @@ -6,10 +6,10 @@ using Robust.Shared.Player; namespace Robust.Shared.GameObjects; -public abstract class SharedEyeSystem : EntitySystem +public abstract partial class SharedEyeSystem : EntitySystem { - [Dependency] private readonly SharedViewSubscriberSystem _views = default!; - [Dependency] protected readonly SharedTransformSystem TransformSystem = default!; + [Dependency] private SharedViewSubscriberSystem _views = default!; + [Dependency] protected SharedTransformSystem TransformSystem = default!; public override void Initialize() { diff --git a/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs b/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs index 6e9532392f..fafa4baa05 100644 --- a/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs @@ -19,11 +19,11 @@ using Robust.Shared.Serialization; namespace Robust.Shared.GameObjects { - public abstract class SharedGridFixtureSystem : EntitySystem + public abstract partial class SharedGridFixtureSystem : EntitySystem { - [Dependency] private readonly FixtureSystem _fixtures = default!; - [Dependency] private readonly SharedMapSystem _map = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private FixtureSystem _fixtures = default!; + [Dependency] private SharedMapSystem _map = default!; + [Dependency] private IConfigurationManager _cfg = default!; private bool _enabled; private float _fixtureEnlargement; diff --git a/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs b/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs index 0e8c73f423..5cbdd7f6f6 100644 --- a/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs @@ -11,11 +11,11 @@ namespace Robust.Shared.GameObjects; /// /// Handles moving entities between grids as they move around. /// -public sealed class SharedGridTraversalSystem : EntitySystem +public sealed partial class SharedGridTraversalSystem : EntitySystem { - [Dependency] private readonly IMapManagerInternal _mapManager = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private IMapManagerInternal _mapManager = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private IGameTiming _timing = default!; private EntityUid _recursionGuard; diff --git a/Robust.Shared/GameObjects/Systems/SharedMapSystem.cs b/Robust.Shared/GameObjects/Systems/SharedMapSystem.cs index 773140f497..2f99eb9c7a 100644 --- a/Robust.Shared/GameObjects/Systems/SharedMapSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedMapSystem.cs @@ -19,15 +19,15 @@ namespace Robust.Shared.GameObjects /// public abstract partial class SharedMapSystem : EntitySystem { - [Dependency] private readonly ITileDefinitionManager _tileMan = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] protected readonly IMapManager MapManager = default!; - [Dependency] private readonly IMapManagerInternal _mapInternal = default!; - [Dependency] private readonly INetManager _netManager = default!; - [Dependency] private readonly FixtureSystem _fixtures = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly MetaDataSystem _meta = default!; + [Dependency] private ITileDefinitionManager _tileMan = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] protected IMapManager MapManager = default!; + [Dependency] private IMapManagerInternal _mapInternal = default!; + [Dependency] private INetManager _netManager = default!; + [Dependency] private FixtureSystem _fixtures = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private MetaDataSystem _meta = default!; private EntityQuery _fixturesQuery; private EntityQuery _mapQuery; diff --git a/Robust.Shared/GameObjects/Systems/SharedTransformSystem.cs b/Robust.Shared/GameObjects/Systems/SharedTransformSystem.cs index b3a786a0a0..3d9b8a545c 100644 --- a/Robust.Shared/GameObjects/Systems/SharedTransformSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedTransformSystem.cs @@ -18,15 +18,15 @@ namespace Robust.Shared.GameObjects { public abstract partial class SharedTransformSystem : EntitySystem { - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly SharedMapSystem _map = default!; - [Dependency] private readonly MetaDataSystem _metaData = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly INetManager _netMan = default!; - [Dependency] private readonly SharedContainerSystem _container = default!; - [Dependency] private readonly SharedGridTraversalSystem _traversal = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private IMapManager _mapManager = default!; + [Dependency] private EntityLookupSystem _lookup = default!; + [Dependency] private SharedMapSystem _map = default!; + [Dependency] private MetaDataSystem _metaData = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; + [Dependency] private INetManager _netMan = default!; + [Dependency] private SharedContainerSystem _container = default!; + [Dependency] private SharedGridTraversalSystem _traversal = default!; private EntityQuery _mapQuery; private EntityQuery _gridQuery; diff --git a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs index 173ffd0fa5..7012d65c72 100644 --- a/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs @@ -18,16 +18,16 @@ using Robust.Shared.Utility; namespace Robust.Shared.GameObjects; -public abstract class SharedUserInterfaceSystem : EntitySystem +public abstract partial class SharedUserInterfaceSystem : EntitySystem { - [Dependency] private readonly IDynamicTypeFactory _factory = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly INetManager _netManager = default!; - [Dependency] private readonly IParallelManager _parallel = default!; - [Dependency] protected readonly IPrototypeManager ProtoManager = default!; - [Dependency] private readonly IReflectionManager _reflection = default!; - [Dependency] protected readonly ISharedPlayerManager Player = default!; - [Dependency] private readonly SharedTransformSystem _transforms = default!; + [Dependency] private IDynamicTypeFactory _factory = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private INetManager _netManager = default!; + [Dependency] private IParallelManager _parallel = default!; + [Dependency] protected IPrototypeManager ProtoManager = default!; + [Dependency] private IReflectionManager _reflection = default!; + [Dependency] protected ISharedPlayerManager Player = default!; + [Dependency] private SharedTransformSystem _transforms = default!; private EntityQuery _ignoreUIRangeQuery; private EntityQuery _xformQuery; diff --git a/Robust.Shared/IoC/DynamicTypeFactory.cs b/Robust.Shared/IoC/DynamicTypeFactory.cs index 6d759596ae..d34b8d18cb 100644 --- a/Robust.Shared/IoC/DynamicTypeFactory.cs +++ b/Robust.Shared/IoC/DynamicTypeFactory.cs @@ -161,12 +161,12 @@ namespace Robust.Shared.IoC } /// - internal sealed class DynamicTypeFactory : IDynamicTypeFactoryInternal + internal sealed partial class DynamicTypeFactory : IDynamicTypeFactoryInternal { // https://blog.ploeh.dk/2012/03/15/ImplementinganAbstractFactory/ - [Dependency] private readonly IDependencyCollection _dependencies = default!; - [Dependency] private readonly IModLoader _modLoader = default!; + [Dependency] private IDependencyCollection _dependencies = default!; + [Dependency] private IModLoader _modLoader = default!; /// public object CreateInstance(Type type, bool oneOff = false, bool inject = true) diff --git a/Robust.Shared/Localization/LocalizationManager.cs b/Robust.Shared/Localization/LocalizationManager.cs index cc719c6202..b7d3ea8f81 100644 --- a/Robust.Shared/Localization/LocalizationManager.cs +++ b/Robust.Shared/Localization/LocalizationManager.cs @@ -28,11 +28,11 @@ namespace Robust.Shared.Localization { protected static readonly ResPath LocaleDirPath = new("/Locale"); - [Dependency] private readonly IConfigurationManager _configuration = default!; - [Dependency] private readonly IResourceManager _res = default!; - [Dependency] private readonly ILogManager _log = default!; - [Dependency] private readonly IPrototypeManager _prototype = default!; - [Dependency] private readonly IEntityManager _entMan = default!; + [Dependency] private IConfigurationManager _configuration = default!; + [Dependency] private IResourceManager _res = default!; + [Dependency] private ILogManager _log = default!; + [Dependency] private IPrototypeManager _prototype = default!; + [Dependency] private IEntityManager _entMan = default!; private ISawmill _logSawmill = default!; private readonly Dictionary _contexts = new(); diff --git a/Robust.Shared/Map/Commands/AmbientLightCommand.cs b/Robust.Shared/Map/Commands/AmbientLightCommand.cs index b2f66c050c..a4f3835f00 100644 --- a/Robust.Shared/Map/Commands/AmbientLightCommand.cs +++ b/Robust.Shared/Map/Commands/AmbientLightCommand.cs @@ -9,9 +9,9 @@ namespace Robust.Shared.Map.Commands; /// /// Sets the ambient light for a particular map /// -public sealed class AmbientLightCommand : IConsoleCommand +public sealed partial class AmbientLightCommand : IConsoleCommand { - [Dependency] private readonly IEntitySystemManager _systems = default!; + [Dependency] private IEntitySystemManager _systems = default!; public string Command => $"setambientlight"; public string Description => Loc.GetString("cmd-set-ambient-light-desc"); diff --git a/Robust.Shared/Map/MapManager.cs b/Robust.Shared/Map/MapManager.cs index d58ab3175c..c5e853c8b6 100644 --- a/Robust.Shared/Map/MapManager.cs +++ b/Robust.Shared/Map/MapManager.cs @@ -13,11 +13,11 @@ namespace Robust.Shared.Map; [Virtual] internal partial class MapManager : IMapManagerInternal, IEntityEventSubscriber { - [Dependency] public readonly IGameTiming GameTiming = default!; - [Dependency] public readonly IEntityManager EntityManager = default!; - [Dependency] private readonly IManifoldManager _manifolds = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly IConsoleHost _conhost = default!; + [Dependency] public IGameTiming GameTiming = default!; + [Dependency] public IEntityManager EntityManager = default!; + [Dependency] private IManifoldManager _manifolds = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private IConsoleHost _conhost = default!; private ISawmill _sawmill = default!; diff --git a/Robust.Shared/Network/IHWId.cs b/Robust.Shared/Network/IHWId.cs index 2d5f272032..da80467c4b 100644 --- a/Robust.Shared/Network/IHWId.cs +++ b/Robust.Shared/Network/IHWId.cs @@ -50,9 +50,9 @@ internal sealed class DummyHWId : IHWId } #if DEBUG -internal sealed class HwidCommand : LocalizedCommands +internal sealed partial class HwidCommand : LocalizedCommands { - [Dependency] private readonly IHWId _hwId = default!; + [Dependency] private IHWId _hwId = default!; public override string Command => "hwid"; diff --git a/Robust.Shared/Network/NetManager.cs b/Robust.Shared/Network/NetManager.cs index db6e55c649..371f97327f 100644 --- a/Robust.Shared/Network/NetManager.cs +++ b/Robust.Shared/Network/NetManager.cs @@ -105,15 +105,15 @@ namespace Robust.Shared.Network private readonly Dictionary _bandwidthUsage = new(); - [Dependency] private readonly IRobustSerializer _serializer = default!; - [Dependency] private readonly IConfigurationManagerInternal _config = default!; - [Dependency] private readonly IAuthManager _authManager = default!; - [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly ILogManager _logMan = default!; - [Dependency] private readonly ProfManager _prof = default!; - [Dependency] private readonly HttpClientHolder _http = default!; - [Dependency] private readonly IHWId _hwId = default!; - [Dependency] private readonly ITransferManager _transfer = default!; + [Dependency] private IRobustSerializer _serializer = default!; + [Dependency] private IConfigurationManagerInternal _config = default!; + [Dependency] private IAuthManager _authManager = default!; + [Dependency] private IGameTiming _timing = default!; + [Dependency] private ILogManager _logMan = default!; + [Dependency] private ProfManager _prof = default!; + [Dependency] private HttpClientHolder _http = default!; + [Dependency] private IHWId _hwId = default!; + [Dependency] private ITransferManager _transfer = default!; /// /// Whether we bother to log problematic packets. Set by . diff --git a/Robust.Shared/Network/Transfer/TransferTest.cs b/Robust.Shared/Network/Transfer/TransferTest.cs index 83e37cd758..dfc2970cc8 100644 --- a/Robust.Shared/Network/Transfer/TransferTest.cs +++ b/Robust.Shared/Network/Transfer/TransferTest.cs @@ -6,11 +6,11 @@ using Robust.Shared.Utility; namespace Robust.Shared.Network.Transfer; -internal sealed class TransferTestCommand : IConsoleCommand +internal sealed partial class TransferTestCommand : IConsoleCommand { internal const string CommandKey = "transfer_test"; - [Dependency] private readonly ITransferManager _transferManager = null!; + [Dependency] private ITransferManager _transferManager = null!; public string Command => CommandKey; public string Description => ""; diff --git a/Robust.Shared/Physics/Controllers/VirtualController.cs b/Robust.Shared/Physics/Controllers/VirtualController.cs index cf8f547684..7b002d17d8 100644 --- a/Robust.Shared/Physics/Controllers/VirtualController.cs +++ b/Robust.Shared/Physics/Controllers/VirtualController.cs @@ -11,10 +11,10 @@ using Robust.Shared.Timing; namespace Robust.Shared.Physics.Controllers { [MeansImplicitUse] - public abstract class VirtualController : EntitySystem + public abstract partial class VirtualController : EntitySystem { - [Dependency] protected readonly SharedPhysicsSystem PhysicsSystem = default!; - [Dependency] protected readonly SharedTransformSystem TransformSystem = default!; + [Dependency] protected SharedPhysicsSystem PhysicsSystem = default!; + [Dependency] protected SharedTransformSystem TransformSystem = default!; private static readonly Stopwatch Stopwatch = new(); diff --git a/Robust.Shared/Physics/Systems/FixtureSystem.cs b/Robust.Shared/Physics/Systems/FixtureSystem.cs index 20da23e310..28d2db44d4 100644 --- a/Robust.Shared/Physics/Systems/FixtureSystem.cs +++ b/Robust.Shared/Physics/Systems/FixtureSystem.cs @@ -22,11 +22,11 @@ namespace Robust.Shared.Physics.Systems public sealed partial class FixtureSystem : EntitySystem { #if DEBUG - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private IGameTiming _timing = default!; #endif - [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly SharedBroadphaseSystem _broadphase = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; + [Dependency] private EntityLookupSystem _lookup = default!; + [Dependency] private SharedBroadphaseSystem _broadphase = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; private EntityQuery _physicsQuery; private EntityQuery _fixtureQuery; diff --git a/Robust.Shared/Physics/Systems/FixturesChangeSystem.cs b/Robust.Shared/Physics/Systems/FixturesChangeSystem.cs index bfdc432854..66e2ce90d4 100644 --- a/Robust.Shared/Physics/Systems/FixturesChangeSystem.cs +++ b/Robust.Shared/Physics/Systems/FixturesChangeSystem.cs @@ -4,10 +4,10 @@ using Robust.Shared.Physics.Components; namespace Robust.Shared.Physics.Systems; -public sealed class FixturesChangeSystem : EntitySystem +public sealed partial class FixturesChangeSystem : EntitySystem { - [Dependency] private readonly FixtureSystem _fixtures = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; + [Dependency] private FixtureSystem _fixtures = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; private EntityQuery _fixturesQuery; private EntityQuery _physicsQuery; diff --git a/Robust.Shared/Physics/Systems/RayCastSystem.cs b/Robust.Shared/Physics/Systems/RayCastSystem.cs index b4cff8dbbb..fb3187cf43 100644 --- a/Robust.Shared/Physics/Systems/RayCastSystem.cs +++ b/Robust.Shared/Physics/Systems/RayCastSystem.cs @@ -25,8 +25,8 @@ public sealed partial class RayCastSystem : EntitySystem * - If you wish to add more helper methods make a new partial and dump them there and have them call the below methods. */ - [Dependency] private readonly SharedBroadphaseSystem _broadphase = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; + [Dependency] private SharedBroadphaseSystem _broadphase = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; private readonly RayComparer _rayComparer = new(); diff --git a/Robust.Shared/Physics/Systems/SharedBroadphaseSystem.cs b/Robust.Shared/Physics/Systems/SharedBroadphaseSystem.cs index 068b1b2701..e6fbf61f9b 100644 --- a/Robust.Shared/Physics/Systems/SharedBroadphaseSystem.cs +++ b/Robust.Shared/Physics/Systems/SharedBroadphaseSystem.cs @@ -15,16 +15,16 @@ using Robust.Shared.Utility; namespace Robust.Shared.Physics.Systems { - public abstract class SharedBroadphaseSystem : EntitySystem + public abstract partial class SharedBroadphaseSystem : EntitySystem { - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IMapManagerInternal _mapManager = default!; - [Dependency] private readonly IParallelManager _parallel = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly SharedGridTraversalSystem _traversal = default!; - [Dependency] private readonly SharedMapSystem _map = default!; - [Dependency] private readonly SharedPhysicsSystem _physicsSystem = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IMapManagerInternal _mapManager = default!; + [Dependency] private IParallelManager _parallel = default!; + [Dependency] private EntityLookupSystem _lookup = default!; + [Dependency] private SharedGridTraversalSystem _traversal = default!; + [Dependency] private SharedMapSystem _map = default!; + [Dependency] private SharedPhysicsSystem _physicsSystem = default!; + [Dependency] private SharedTransformSystem _transform = default!; private EntityQuery _broadphaseQuery; private EntityQuery _fixturesQuery; diff --git a/Robust.Shared/Physics/Systems/SharedJointSystem.cs b/Robust.Shared/Physics/Systems/SharedJointSystem.cs index e7ca9fae72..78a648afb5 100644 --- a/Robust.Shared/Physics/Systems/SharedJointSystem.cs +++ b/Robust.Shared/Physics/Systems/SharedJointSystem.cs @@ -16,10 +16,10 @@ namespace Robust.Shared.Physics.Systems; public abstract partial class SharedJointSystem : EntitySystem { - [Dependency] private readonly SharedContainerSystem _container = default!; - [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private SharedContainerSystem _container = default!; + [Dependency] private SharedPhysicsSystem _physics = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private SharedTransformSystem _transform = default!; private EntityQuery _jointsQuery; private EntityQuery _physicsQuery; diff --git a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Fixtures.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Fixtures.cs index b68348d3cd..68ade2f776 100644 --- a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Fixtures.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Fixtures.cs @@ -10,7 +10,7 @@ namespace Robust.Shared.Physics.Systems; public abstract partial class SharedPhysicsSystem { - [Dependency] private readonly FixtureSystem _fixtures = default!; + [Dependency] private FixtureSystem _fixtures = default!; public void SetDensity(EntityUid uid, string fixtureId, Fixture fixture, float value, bool update = true, FixturesComponent? manager = null) { diff --git a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs index b75991b31c..b8ac8c333c 100644 --- a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs @@ -22,8 +22,8 @@ namespace Robust.Shared.Physics.Systems public partial class SharedPhysicsSystem { #if DEBUG - [Dependency] private readonly SharedDebugRayDrawingSystem _sharedDebugRaySystem = default!; - [Dependency] private readonly INetManager _netMan = default!; + [Dependency] private SharedDebugRayDrawingSystem _sharedDebugRaySystem = default!; + [Dependency] private INetManager _netMan = default!; #endif /// diff --git a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Velocities.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Velocities.cs index 34c48a781e..fbe39546fa 100644 --- a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Velocities.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Velocities.cs @@ -11,7 +11,7 @@ namespace Robust.Shared.Physics.Systems; public abstract partial class SharedPhysicsSystem { - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; /// /// Gets the linear velocity of a particular body at the specified point. diff --git a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs index b78b583f48..074cc7fd75 100644 --- a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs @@ -39,16 +39,16 @@ namespace Robust.Shared.Physics.Systems Buckets = Histogram.ExponentialBuckets(0.000_001, 1.5, 25) }); - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IManifoldManager _manifoldManager = default!; - [Dependency] private readonly IParallelManager _parallel = default!; - [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly SharedBroadphaseSystem _broadphase = default!; - [Dependency] private readonly SharedContainerSystem _containerSystem = default!; - [Dependency] private readonly SharedDebugPhysicsSystem _debugPhysics = default!; - [Dependency] private readonly SharedJointSystem _joints = default!; - [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly CollisionWakeSystem _wakeSystem = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private IManifoldManager _manifoldManager = default!; + [Dependency] private IParallelManager _parallel = default!; + [Dependency] private EntityLookupSystem _lookup = default!; + [Dependency] private SharedBroadphaseSystem _broadphase = default!; + [Dependency] private SharedContainerSystem _containerSystem = default!; + [Dependency] private SharedDebugPhysicsSystem _debugPhysics = default!; + [Dependency] private SharedJointSystem _joints = default!; + [Dependency] private SharedTransformSystem _transform = default!; + [Dependency] private CollisionWakeSystem _wakeSystem = default!; private int _substeps; diff --git a/Robust.Shared/Player/ActorSystem.cs b/Robust.Shared/Player/ActorSystem.cs index 56ebde5670..7d942d5f9a 100644 --- a/Robust.Shared/Player/ActorSystem.cs +++ b/Robust.Shared/Player/ActorSystem.cs @@ -7,9 +7,9 @@ namespace Robust.Shared.Player; /// /// System that handles . /// -public sealed class ActorSystem : EntitySystem +public sealed partial class ActorSystem : EntitySystem { - [Dependency] private readonly ISharedPlayerManager _playerManager = default!; + [Dependency] private ISharedPlayerManager _playerManager = default!; public override void Initialize() { diff --git a/Robust.Shared/Player/SharedPlayerManager.cs b/Robust.Shared/Player/SharedPlayerManager.cs index 54ab6686fd..2a78bb9e7d 100644 --- a/Robust.Shared/Player/SharedPlayerManager.cs +++ b/Robust.Shared/Player/SharedPlayerManager.cs @@ -11,11 +11,11 @@ namespace Robust.Shared.Player; internal abstract partial class SharedPlayerManager : ISharedPlayerManager { - [Dependency] protected readonly IEntityManager EntManager = default!; - [Dependency] protected readonly IComponentFactory Factory = default!; - [Dependency] protected readonly ILogManager LogMan = default!; - [Dependency] protected readonly IGameTiming Timing = default!; - [Dependency] private readonly INetManager _netMan = default!; + [Dependency] protected IEntityManager EntManager = default!; + [Dependency] protected IComponentFactory Factory = default!; + [Dependency] protected ILogManager LogMan = default!; + [Dependency] protected IGameTiming Timing = default!; + [Dependency] private INetManager _netMan = default!; protected ISawmill Sawmill = default!; diff --git a/Robust.Shared/Profiling/ProfManager.cs b/Robust.Shared/Profiling/ProfManager.cs index d8783310d9..67684503c7 100644 --- a/Robust.Shared/Profiling/ProfManager.cs +++ b/Robust.Shared/Profiling/ProfManager.cs @@ -14,10 +14,10 @@ namespace Robust.Shared.Profiling; // See ProfData.cs for description of profiling data layout. -public sealed class ProfManager +public sealed partial class ProfManager { - [IoC.Dependency] private readonly IConfigurationManager _cfg = default!; - [IoC.Dependency] private readonly ILogManager _logManager = default!; + [IoC.Dependency] private IConfigurationManager _cfg = default!; + [IoC.Dependency] private ILogManager _logManager = default!; /// /// Proxy to prof.enabled CVar. diff --git a/Robust.Shared/Prototypes/PrototypeManager.cs b/Robust.Shared/Prototypes/PrototypeManager.cs index c727ff6cee..527ae7ea2c 100644 --- a/Robust.Shared/Prototypes/PrototypeManager.cs +++ b/Robust.Shared/Prototypes/PrototypeManager.cs @@ -28,15 +28,15 @@ namespace Robust.Shared.Prototypes { public abstract partial class PrototypeManager : IPrototypeManagerInternal { - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] protected readonly IResourceManager Resources = default!; - [Dependency] protected readonly ITaskManager TaskManager = default!; - [Dependency] private readonly ISerializationManager _serializationManager = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ILocalizationManager _locMan = default!; - [Dependency] private readonly IComponentFactory _factory = default!; - [Dependency] private readonly IEntityManager _entMan = default!; - [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] protected IResourceManager Resources = default!; + [Dependency] protected ITaskManager TaskManager = default!; + [Dependency] private ISerializationManager _serializationManager = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private ILocalizationManager _locMan = default!; + [Dependency] private IComponentFactory _factory = default!; + [Dependency] private IEntityManager _entMan = default!; + [Dependency] private IRobustRandom _random = default!; private readonly Dictionary> _prototypeDataCache = new(); private EntityDiffContext _context = new(); diff --git a/Robust.Shared/Reflection/ReflectionManager.cs b/Robust.Shared/Reflection/ReflectionManager.cs index 112ca726b5..5e947ec790 100644 --- a/Robust.Shared/Reflection/ReflectionManager.cs +++ b/Robust.Shared/Reflection/ReflectionManager.cs @@ -13,9 +13,9 @@ using Robust.Shared.ViewVariables; namespace Robust.Shared.Reflection { - public abstract class ReflectionManager : IReflectionManager + public abstract partial class ReflectionManager : IReflectionManager { - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private ILogManager _logMan = default!; /// /// Enumerable over prefixes that are added to the type provided to diff --git a/Robust.Shared/Replays/ReplayRecordingCommands.cs b/Robust.Shared/Replays/ReplayRecordingCommands.cs index 516fbb92bb..c0cba1b3bb 100644 --- a/Robust.Shared/Replays/ReplayRecordingCommands.cs +++ b/Robust.Shared/Replays/ReplayRecordingCommands.cs @@ -6,10 +6,10 @@ using Robust.Shared.ContentPack; namespace Robust.Shared.Replays; -internal sealed class ReplayStartCommand : LocalizedCommands +internal sealed partial class ReplayStartCommand : LocalizedCommands { - [Dependency] private readonly IReplayRecordingManager _replay = default!; - [Dependency] private readonly IResourceManager _resMan = default!; + [Dependency] private IReplayRecordingManager _replay = default!; + [Dependency] private IResourceManager _resMan = default!; public override string Command => "replay_recording_start"; public override string Description => LocalizationManager.GetString($"cmd-replay-recording-start-desc"); @@ -67,9 +67,9 @@ internal sealed class ReplayStartCommand : LocalizedCommands } } -internal sealed class ReplayStopCommand : LocalizedCommands +internal sealed partial class ReplayStopCommand : LocalizedCommands { - [Dependency] private readonly IReplayRecordingManager _replay = default!; + [Dependency] private IReplayRecordingManager _replay = default!; public override string Command => "replay_recording_stop"; public override string Description => LocalizationManager.GetString($"cmd-replay-recording-stop-desc"); @@ -87,9 +87,9 @@ internal sealed class ReplayStopCommand : LocalizedCommands } } -internal sealed class ReplayStatsCommand : LocalizedCommands +internal sealed partial class ReplayStatsCommand : LocalizedCommands { - [Dependency] private readonly IReplayRecordingManager _replay = default!; + [Dependency] private IReplayRecordingManager _replay = default!; public override string Command => "replay_recording_stats"; public override string Description => LocalizationManager.GetString($"cmd-replay-recording-stats-desc"); diff --git a/Robust.Shared/Replays/SharedReplayRecordingManager.cs b/Robust.Shared/Replays/SharedReplayRecordingManager.cs index 40cb32de0b..aff88e9ca8 100644 --- a/Robust.Shared/Replays/SharedReplayRecordingManager.cs +++ b/Robust.Shared/Replays/SharedReplayRecordingManager.cs @@ -39,13 +39,13 @@ internal abstract partial class SharedReplayRecordingManager : IReplayRecordingM // I don't think anybody's gonna write 256 MB of chunk at once yeah? private const int MaxTickBatchSize = 256 * 1024; - [Dependency] protected readonly IGameTiming Timing = default!; - [Dependency] protected readonly INetConfigurationManager NetConf = default!; - [Dependency] private readonly IComponentFactory _factory = default!; - [Dependency] private readonly IRobustSerializer _serializer = default!; - [Dependency] private readonly INetManager _netMan = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; + [Dependency] protected IGameTiming Timing = default!; + [Dependency] protected INetConfigurationManager NetConf = default!; + [Dependency] private IComponentFactory _factory = default!; + [Dependency] private IRobustSerializer _serializer = default!; + [Dependency] private INetManager _netMan = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private ITaskManager _taskManager = default!; public event Action>? RecordingStarted; public event Action? RecordingStopped; diff --git a/Robust.Shared/Sandboxing/SandboxHelper.cs b/Robust.Shared/Sandboxing/SandboxHelper.cs index 8906586b7c..a46f8509d7 100644 --- a/Robust.Shared/Sandboxing/SandboxHelper.cs +++ b/Robust.Shared/Sandboxing/SandboxHelper.cs @@ -17,9 +17,9 @@ namespace Robust.Shared.Sandboxing object CreateInstance(Type type); } - internal sealed class SandboxHelper : ISandboxHelper + internal sealed partial class SandboxHelper : ISandboxHelper { - [Dependency] private readonly IModLoader _modLoader = default!; + [Dependency] private IModLoader _modLoader = default!; public object CreateInstance(Type type) { diff --git a/Robust.Shared/Serialization/Manager/SerializationManager.cs b/Robust.Shared/Serialization/Manager/SerializationManager.cs index 60895b6220..be2253cb9c 100644 --- a/Robust.Shared/Serialization/Manager/SerializationManager.cs +++ b/Robust.Shared/Serialization/Manager/SerializationManager.cs @@ -19,7 +19,7 @@ namespace Robust.Shared.Serialization.Manager { public sealed partial class SerializationManager : ISerializationManager { - [Dependency] private readonly IReflectionManager _reflectionManager = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; public IReflectionManager ReflectionManager => _reflectionManager; @@ -33,8 +33,10 @@ namespace Robust.Shared.Serialization.Manager // Always has a dummy value of 0 for any types that should be copied by ref private readonly ConcurrentDictionary _copyByRefRegistrations = new(); - [field: IoC.Dependency] - public IDependencyCollection DependencyCollection { get; } = default!; + [IoC.Dependency] + private IDependencyCollection _dependencyCollection = null!; + + public IDependencyCollection DependencyCollection => _dependencyCollection; public void Initialize() { diff --git a/Robust.Shared/Serialization/RobustMappedStringSerializer.cs b/Robust.Shared/Serialization/RobustMappedStringSerializer.cs index 19d9b6510d..ead07fe952 100644 --- a/Robust.Shared/Serialization/RobustMappedStringSerializer.cs +++ b/Robust.Shared/Serialization/RobustMappedStringSerializer.cs @@ -97,7 +97,7 @@ namespace Robust.Shared.Serialization /// private const uint FirstMappedIndexStart = 2; - [Dependency] private readonly INetManager _net = default!; + [Dependency] private INetManager _net = default!; // I don't want to create 50 line changes in this commit so... // ReSharper disable once InconsistentNaming diff --git a/Robust.Shared/Serialization/RobustSerializer.cs b/Robust.Shared/Serialization/RobustSerializer.cs index cff7ae776c..bb50495f8a 100644 --- a/Robust.Shared/Serialization/RobustSerializer.cs +++ b/Robust.Shared/Serialization/RobustSerializer.cs @@ -15,9 +15,9 @@ namespace Robust.Shared.Serialization { internal abstract partial class RobustSerializer : IRobustSerializerInternal { - [Dependency] private readonly IReflectionManager _reflectionManager = default!; - [Dependency] protected readonly IRobustMappedStringSerializer MappedStringSerializer = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IReflectionManager _reflectionManager = default!; + [Dependency] protected IRobustMappedStringSerializer MappedStringSerializer = default!; + [Dependency] private ILogManager _logManager = default!; private readonly Dictionary> _cachedSerialized = new(); diff --git a/Robust.Shared/Spawners/SharedTimedDespawnSystem.cs b/Robust.Shared/Spawners/SharedTimedDespawnSystem.cs index 5e8febd6d2..46fcdb56c6 100644 --- a/Robust.Shared/Spawners/SharedTimedDespawnSystem.cs +++ b/Robust.Shared/Spawners/SharedTimedDespawnSystem.cs @@ -5,9 +5,9 @@ using Robust.Shared.Timing; namespace Robust.Shared.Spawners; -public abstract class SharedTimedDespawnSystem : EntitySystem +public abstract partial class SharedTimedDespawnSystem : EntitySystem { - [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private IGameTiming _timing = default!; private readonly HashSet _queuedDespawnEntities = new(); diff --git a/Robust.Shared/Threading/ParallelManager.cs b/Robust.Shared/Threading/ParallelManager.cs index fa69039de1..eee66de0e8 100644 --- a/Robust.Shared/Threading/ParallelManager.cs +++ b/Robust.Shared/Threading/ParallelManager.cs @@ -70,10 +70,10 @@ internal interface IParallelManagerInternal : IParallelManager void Initialize(); } -internal sealed class ParallelManager : IParallelManagerInternal +internal sealed partial class ParallelManager : IParallelManagerInternal { - [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly ILogManager _logs = default!; + [Dependency] private IConfigurationManager _cfg = default!; + [Dependency] private ILogManager _logs = default!; public event Action? ParallelCountChanged; public int ParallelProcessCount { get; private set; } diff --git a/Robust.Shared/Timing/TimerManager.cs b/Robust.Shared/Timing/TimerManager.cs index 8de6444485..c696c64fe1 100644 --- a/Robust.Shared/Timing/TimerManager.cs +++ b/Robust.Shared/Timing/TimerManager.cs @@ -5,9 +5,9 @@ using Robust.Shared.IoC; namespace Robust.Shared.Timing { - internal sealed class TimerManager : ITimerManager + internal sealed partial class TimerManager : ITimerManager { - [Dependency] private readonly IRuntimeLog _runtimeLog = default!; + [Dependency] private IRuntimeLog _runtimeLog = default!; private readonly List<(Timer, CancellationToken)> _timers = new(); diff --git a/Robust.Shared/Toolshed/Commands/Entities/NearbyCommand.cs b/Robust.Shared/Toolshed/Commands/Entities/NearbyCommand.cs index 19269bc63f..43cee7d24e 100644 --- a/Robust.Shared/Toolshed/Commands/Entities/NearbyCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Entities/NearbyCommand.cs @@ -8,9 +8,9 @@ using Robust.Shared.IoC; namespace Robust.Shared.Toolshed.Commands.Entities; [ToolshedCommand] -internal sealed class NearbyCommand : ToolshedCommand +internal sealed partial class NearbyCommand : ToolshedCommand { - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; private EntityLookupSystem? _lookup; diff --git a/Robust.Shared/Toolshed/Commands/Entities/WithCommand.cs b/Robust.Shared/Toolshed/Commands/Entities/WithCommand.cs index 17f84745cf..767bd4bcb6 100644 --- a/Robust.Shared/Toolshed/Commands/Entities/WithCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Entities/WithCommand.cs @@ -9,9 +9,9 @@ using Robust.Shared.Toolshed.TypeParsers; namespace Robust.Shared.Toolshed.Commands.Entities; [ToolshedCommand] -internal sealed class WithCommand : ToolshedCommand +internal sealed partial class WithCommand : ToolshedCommand { - [Dependency] private readonly IComponentFactory _componentFactory = default!; + [Dependency] private IComponentFactory _componentFactory = default!; [CommandImplementation] public IEnumerable With( diff --git a/Robust.Shared/Toolshed/Commands/GameTiming/CurTickCommand.cs b/Robust.Shared/Toolshed/Commands/GameTiming/CurTickCommand.cs index 625a67fc48..503decea63 100644 --- a/Robust.Shared/Toolshed/Commands/GameTiming/CurTickCommand.cs +++ b/Robust.Shared/Toolshed/Commands/GameTiming/CurTickCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.Timing; namespace Robust.Shared.Toolshed.Commands.GameTiming; [ToolshedCommand] -public sealed class CurTickCommand : ToolshedCommand +public sealed partial class CurTickCommand : ToolshedCommand { - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; [CommandImplementation] public GameTick CurTime() => _gameTiming.CurTick; diff --git a/Robust.Shared/Toolshed/Commands/GameTiming/CurTimeCommand.cs b/Robust.Shared/Toolshed/Commands/GameTiming/CurTimeCommand.cs index cc1ebdeb3d..9350df237f 100644 --- a/Robust.Shared/Toolshed/Commands/GameTiming/CurTimeCommand.cs +++ b/Robust.Shared/Toolshed/Commands/GameTiming/CurTimeCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.Timing; namespace Robust.Shared.Toolshed.Commands.GameTiming; [ToolshedCommand] -public sealed class CurTimeCommand : ToolshedCommand +public sealed partial class CurTimeCommand : ToolshedCommand { - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; [CommandImplementation] public TimeSpan CurTime() => _gameTiming.CurTime; diff --git a/Robust.Shared/Toolshed/Commands/GameTiming/RealTimeCommand.cs b/Robust.Shared/Toolshed/Commands/GameTiming/RealTimeCommand.cs index 37b3a6b654..8efcab4d6c 100644 --- a/Robust.Shared/Toolshed/Commands/GameTiming/RealTimeCommand.cs +++ b/Robust.Shared/Toolshed/Commands/GameTiming/RealTimeCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.Timing; namespace Robust.Shared.Toolshed.Commands.GameTiming; [ToolshedCommand] -public sealed class RealTimeCommand : ToolshedCommand +public sealed partial class RealTimeCommand : ToolshedCommand { - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; [CommandImplementation] public TimeSpan CurTime() => _gameTiming.RealTime; diff --git a/Robust.Shared/Toolshed/Commands/GameTiming/ServerTimeCommand.cs b/Robust.Shared/Toolshed/Commands/GameTiming/ServerTimeCommand.cs index d3d13f2741..05a8400243 100644 --- a/Robust.Shared/Toolshed/Commands/GameTiming/ServerTimeCommand.cs +++ b/Robust.Shared/Toolshed/Commands/GameTiming/ServerTimeCommand.cs @@ -5,9 +5,9 @@ using Robust.Shared.Timing; namespace Robust.Shared.Toolshed.Commands.GameTiming; [ToolshedCommand] -public sealed class ServerTimeCommand : ToolshedCommand +public sealed partial class ServerTimeCommand : ToolshedCommand { - [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private IGameTiming _gameTiming = default!; [CommandImplementation] public TimeSpan CurTime() => _gameTiming.ServerTime; diff --git a/Robust.Shared/Toolshed/Commands/Generic/PickCommand.cs b/Robust.Shared/Toolshed/Commands/Generic/PickCommand.cs index ddb1f6873d..e396038497 100644 --- a/Robust.Shared/Toolshed/Commands/Generic/PickCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Generic/PickCommand.cs @@ -6,9 +6,9 @@ using Robust.Shared.Random; namespace Robust.Shared.Toolshed.Commands.Generic; [ToolshedCommand] -public sealed class PickCommand : ToolshedCommand +public sealed partial class PickCommand : ToolshedCommand { - [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private IRobustRandom _random = default!; [CommandImplementation, TakesPipedTypeAsGeneric] public T Pick([PipedArgument] IEnumerable input) diff --git a/Robust.Shared/Toolshed/Commands/Generic/SelectCommand.cs b/Robust.Shared/Toolshed/Commands/Generic/SelectCommand.cs index f30df3d4c1..27fdc72e3d 100644 --- a/Robust.Shared/Toolshed/Commands/Generic/SelectCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Generic/SelectCommand.cs @@ -7,9 +7,9 @@ using Robust.Shared.Toolshed.TypeParsers; namespace Robust.Shared.Toolshed.Commands.Generic; [ToolshedCommand] -public sealed class SelectCommand : ToolshedCommand +public sealed partial class SelectCommand : ToolshedCommand { - [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private IRobustRandom _random = default!; [CommandImplementation, TakesPipedTypeAsGeneric] public IEnumerable Select([PipedArgument] IEnumerable enumerable, Quantity quantity, [CommandInverted] bool inverted) diff --git a/Robust.Shared/Toolshed/Commands/Math/RngCommand.cs b/Robust.Shared/Toolshed/Commands/Math/RngCommand.cs index 515b9edc7a..f9648fa5bd 100644 --- a/Robust.Shared/Toolshed/Commands/Math/RngCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Math/RngCommand.cs @@ -4,9 +4,9 @@ using Robust.Shared.Random; namespace Robust.Shared.Toolshed.Commands.Math; [ToolshedCommand] -public sealed class RngCommand : ToolshedCommand +public sealed partial class RngCommand : ToolshedCommand { - [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private IRobustRandom _random = default!; [CommandImplementation("to")] public int To( diff --git a/Robust.Shared/Toolshed/Commands/Misc/BuildInfoCommand.cs b/Robust.Shared/Toolshed/Commands/Misc/BuildInfoCommand.cs index d20ce69484..399f9c6590 100644 --- a/Robust.Shared/Toolshed/Commands/Misc/BuildInfoCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Misc/BuildInfoCommand.cs @@ -6,9 +6,9 @@ using Robust.Shared.Utility; namespace Robust.Shared.Toolshed.Commands.Misc; [ToolshedCommand] -internal sealed class BuildInfoCommand : ToolshedCommand +internal sealed partial class BuildInfoCommand : ToolshedCommand { - [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private IConfigurationManager _cfg = default!; private static readonly string Gold = Color.Gold.ToHex(); diff --git a/Robust.Shared/Toolshed/Commands/Vfs/VfsCommand.cs b/Robust.Shared/Toolshed/Commands/Vfs/VfsCommand.cs index 640742ac51..b14ed13a08 100644 --- a/Robust.Shared/Toolshed/Commands/Vfs/VfsCommand.cs +++ b/Robust.Shared/Toolshed/Commands/Vfs/VfsCommand.cs @@ -11,9 +11,9 @@ namespace Robust.Shared.Toolshed.Commands.Vfs; /// /// [PublicAPI] -public abstract class VfsCommand : ToolshedCommand +public abstract partial class VfsCommand : ToolshedCommand { - [Dependency] protected readonly IResourceManager Resources = default!; + [Dependency] protected IResourceManager Resources = default!; /// /// The name of the variable storing a ResPath? representing the user's current VFS location. diff --git a/Robust.Shared/Toolshed/Invocation/OldShellInvocationContext.cs b/Robust.Shared/Toolshed/Invocation/OldShellInvocationContext.cs index d2a6fedd8a..f63a11be0f 100644 --- a/Robust.Shared/Toolshed/Invocation/OldShellInvocationContext.cs +++ b/Robust.Shared/Toolshed/Invocation/OldShellInvocationContext.cs @@ -10,10 +10,11 @@ using Robust.Shared.Utility; namespace Robust.Shared.Toolshed.Invocation; /// -internal sealed class OldShellInvocationContext : IInvocationContext +internal sealed partial class OldShellInvocationContext : IInvocationContext { - [field: Dependency] - public ToolshedManager Toolshed { get; } = default!; + [Dependency] + private ToolshedManager _toolshed = null!; + public ToolshedManager Toolshed => _toolshed; public ToolshedEnvironment Environment => Toolshed.DefaultEnvironment; diff --git a/Robust.Shared/Toolshed/ToolshedCommand.Entities.cs b/Robust.Shared/Toolshed/ToolshedCommand.Entities.cs index 5152201aa5..b78c2c609f 100644 --- a/Robust.Shared/Toolshed/ToolshedCommand.Entities.cs +++ b/Robust.Shared/Toolshed/ToolshedCommand.Entities.cs @@ -10,10 +10,10 @@ namespace Robust.Shared.Toolshed; public abstract partial class ToolshedCommand { [PublicAPI, IoC.Dependency] - protected readonly IEntityManager EntityManager = default!; + protected IEntityManager EntityManager = default!; [PublicAPI, IoC.Dependency] - protected readonly IEntitySystemManager EntitySystemManager = default!; + protected IEntitySystemManager EntitySystemManager = default!; /// /// Returns the entity that's executing this command, if any. diff --git a/Robust.Shared/Toolshed/ToolshedCommand.cs b/Robust.Shared/Toolshed/ToolshedCommand.cs index c24f194df1..2dc74a8c30 100644 --- a/Robust.Shared/Toolshed/ToolshedCommand.cs +++ b/Robust.Shared/Toolshed/ToolshedCommand.cs @@ -45,8 +45,8 @@ namespace Robust.Shared.Toolshed; [Reflect(false)] public abstract partial class ToolshedCommand { - [Dependency] protected readonly ToolshedManager Toolshed = default!; - [Dependency] protected readonly ILocalizationManager Loc = default!; + [Dependency] protected ToolshedManager Toolshed = default!; + [Dependency] protected ILocalizationManager Loc = default!; /// /// The user-facing name of the command. diff --git a/Robust.Shared/Toolshed/ToolshedEnvironment.cs b/Robust.Shared/Toolshed/ToolshedEnvironment.cs index 2200c8cd48..bc7befba97 100644 --- a/Robust.Shared/Toolshed/ToolshedEnvironment.cs +++ b/Robust.Shared/Toolshed/ToolshedEnvironment.cs @@ -11,12 +11,12 @@ using Robust.Shared.Utility; namespace Robust.Shared.Toolshed; -public sealed class ToolshedEnvironment +public sealed partial class ToolshedEnvironment { - [Dependency] private readonly IReflectionManager _reflection = default!; - [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ToolshedManager _toolshedManager = default!; - [Dependency] private readonly IDependencyCollection _dependency = default!; + [Dependency] private IReflectionManager _reflection = default!; + [Dependency] private ILogManager _logManager = default!; + [Dependency] private ToolshedManager _toolshedManager = default!; + [Dependency] private IDependencyCollection _dependency = default!; // Dictionary of commands, not including sub-commands private readonly Dictionary _commands = new(); diff --git a/Robust.Shared/Toolshed/ToolshedManager.cs b/Robust.Shared/Toolshed/ToolshedManager.cs index 7f1b629f73..7b63e9fe2b 100644 --- a/Robust.Shared/Toolshed/ToolshedManager.cs +++ b/Robust.Shared/Toolshed/ToolshedManager.cs @@ -25,15 +25,15 @@ namespace Robust.Shared.Toolshed; /// public sealed partial class ToolshedManager { - [Dependency] private readonly IDynamicTypeFactoryInternal _typeFactory = default!; - [Dependency] private readonly IEntityManager _entity = default!; - [Dependency] private readonly IReflectionManager _reflection = default!; - [Dependency] private readonly ILogManager _logManager = default!; + [Dependency] private IDynamicTypeFactoryInternal _typeFactory = default!; + [Dependency] private IEntityManager _entity = default!; + [Dependency] private IReflectionManager _reflection = default!; + [Dependency] private ILogManager _logManager = default!; #if !CLIENT_SCRIPTING - [Dependency] private readonly INetManager _net = default!; + [Dependency] private INetManager _net = default!; #endif - [Dependency] private readonly ISharedPlayerManager _player = default!; - [Dependency] private readonly IConsoleHost _conHost = default!; + [Dependency] private ISharedPlayerManager _player = default!; + [Dependency] private IConsoleHost _conHost = default!; private ISawmill _log = default!; diff --git a/Robust.Shared/Toolshed/TypeParsers/ComponentTypeParser.cs b/Robust.Shared/Toolshed/TypeParsers/ComponentTypeParser.cs index 4c83fd3942..523ea8903c 100644 --- a/Robust.Shared/Toolshed/TypeParsers/ComponentTypeParser.cs +++ b/Robust.Shared/Toolshed/TypeParsers/ComponentTypeParser.cs @@ -13,9 +13,9 @@ using Robust.Shared.Utility; namespace Robust.Shared.Toolshed.TypeParsers; -public sealed class ComponentTypeParser : CustomTypeParser +public sealed partial class ComponentTypeParser : CustomTypeParser { - [Dependency] private readonly IComponentFactory _factory = default!; + [Dependency] private IComponentFactory _factory = default!; public override bool TryParse(ParserContext ctx, [NotNullWhen(true)] out Type? result) { diff --git a/Robust.Shared/Toolshed/TypeParsers/EntityTypeParser.cs b/Robust.Shared/Toolshed/TypeParsers/EntityTypeParser.cs index e4bc868f27..e752f14804 100644 --- a/Robust.Shared/Toolshed/TypeParsers/EntityTypeParser.cs +++ b/Robust.Shared/Toolshed/TypeParsers/EntityTypeParser.cs @@ -9,9 +9,9 @@ using Robust.Shared.Utility; namespace Robust.Shared.Toolshed.TypeParsers; -internal sealed class EntityTypeParser : TypeParser +internal sealed partial class EntityTypeParser : TypeParser { - [Dependency] private readonly IEntityManager _entMan = default!; + [Dependency] private IEntityManager _entMan = default!; public static bool TryParseEntity(IEntityManager entMan, ParserContext ctx, out EntityUid result) { @@ -57,9 +57,9 @@ internal sealed class EntityTypeParser : TypeParser => CompletionResult.FromHint(ToolshedCommand.GetArgHint(arg, typeof(NetEntity))); } -internal sealed class NetEntityTypeParser : TypeParser +internal sealed partial class NetEntityTypeParser : TypeParser { - [Dependency] private readonly IEntityManager _entMan = default!; + [Dependency] private IEntityManager _entMan = default!; public override bool TryParse(ParserContext ctx, out NetEntity result) { @@ -104,10 +104,10 @@ internal sealed class NetEntityTypeParser : TypeParser => CompletionResult.FromHint(ToolshedCommand.GetArgHint(arg, typeof(NetEntity))); } -internal sealed class EntityTypeParser : TypeParser> +internal sealed partial class EntityTypeParser : TypeParser> where T : IComponent { - [Dependency] private readonly IEntityManager _entMan = default!; + [Dependency] private IEntityManager _entMan = default!; public override bool TryParse(ParserContext parser, out Entity result) { @@ -147,11 +147,11 @@ internal sealed class EntityTypeParser : TypeParser> } } -internal sealed class EntityTypeParser : TypeParser> +internal sealed partial class EntityTypeParser : TypeParser> where T1 : IComponent where T2 : IComponent { - [Dependency] private readonly IEntityManager _entMan = default!; + [Dependency] private IEntityManager _entMan = default!; public override bool TryParse(ParserContext parser, out Entity result) { @@ -189,12 +189,12 @@ internal sealed class EntityTypeParser : TypeParser> } } -internal sealed class EntityTypeParser : TypeParser> +internal sealed partial class EntityTypeParser : TypeParser> where T1 : IComponent where T2 : IComponent where T3 : IComponent { - [Dependency] private readonly IEntityManager _entMan = default!; + [Dependency] private IEntityManager _entMan = default!; public override bool TryParse(ParserContext parser, out Entity result) { diff --git a/Robust.Shared/Toolshed/TypeParsers/PrototypeTypeParser.cs b/Robust.Shared/Toolshed/TypeParsers/PrototypeTypeParser.cs index ff6261136c..c97805e9ce 100644 --- a/Robust.Shared/Toolshed/TypeParsers/PrototypeTypeParser.cs +++ b/Robust.Shared/Toolshed/TypeParsers/PrototypeTypeParser.cs @@ -12,11 +12,11 @@ using Robust.Shared.Utility; namespace Robust.Shared.Toolshed.TypeParsers; -public sealed class ProtoIdTypeParser : TypeParser> +public sealed partial class ProtoIdTypeParser : TypeParser> where T : class, IPrototype { - [Dependency] private readonly IConfigurationManager _config = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private IConfigurationManager _config = default!; + [Dependency] private IPrototypeManager _proto = default!; public override bool TryParse(ParserContext ctx, out ProtoId result) { @@ -58,10 +58,10 @@ public sealed class ProtoIdTypeParser : TypeParser> } } -public sealed class EntProtoIdTypeParser : TypeParser +public sealed partial class EntProtoIdTypeParser : TypeParser { - [Dependency] private readonly IConfigurationManager _config = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private IConfigurationManager _config = default!; + [Dependency] private IPrototypeManager _proto = default!; public override bool TryParse(ParserContext ctx, out EntProtoId result) { diff --git a/Robust.Shared/Toolshed/TypeParsers/ReflectionTypeParser.cs b/Robust.Shared/Toolshed/TypeParsers/ReflectionTypeParser.cs index 0a165554a6..21b02eb27f 100644 --- a/Robust.Shared/Toolshed/TypeParsers/ReflectionTypeParser.cs +++ b/Robust.Shared/Toolshed/TypeParsers/ReflectionTypeParser.cs @@ -13,9 +13,9 @@ namespace Robust.Shared.Toolshed.TypeParsers; /// /// This is custom type parser that uses reflection to search for constructible types that are the children of some base type. /// -internal sealed class ReflectionTypeParser : CustomTypeParser where TBase : class +internal sealed partial class ReflectionTypeParser : CustomTypeParser where TBase : class { - [Dependency] private readonly IReflectionManager _reflection = default!; + [Dependency] private IReflectionManager _reflection = default!; private Dictionary? _cache; private CompletionOption[]? _options; diff --git a/Robust.Shared/Toolshed/TypeParsers/SessionTypeParser.cs b/Robust.Shared/Toolshed/TypeParsers/SessionTypeParser.cs index 06bafb09fd..fde42a96c8 100644 --- a/Robust.Shared/Toolshed/TypeParsers/SessionTypeParser.cs +++ b/Robust.Shared/Toolshed/TypeParsers/SessionTypeParser.cs @@ -14,7 +14,7 @@ namespace Robust.Shared.Toolshed.TypeParsers; /// /// Parse a username to an /// -internal sealed class SessionTypeParser : TypeParser +internal sealed partial class SessionTypeParser : TypeParser { [Dependency] private ISharedPlayerManager _player = default!; diff --git a/Robust.Shared/Toolshed/TypeParsers/TypeParser.cs b/Robust.Shared/Toolshed/TypeParsers/TypeParser.cs index 158c7546c4..3e8c15493c 100644 --- a/Robust.Shared/Toolshed/TypeParsers/TypeParser.cs +++ b/Robust.Shared/Toolshed/TypeParsers/TypeParser.cs @@ -34,16 +34,16 @@ public interface ITypeParser public virtual bool ShowTypeArgSignature => true; } -public abstract class BaseParser : ITypeParser, IPostInjectInit where T : notnull +public abstract partial class BaseParser : ITypeParser, IPostInjectInit where T : notnull { public virtual bool EnableValueRef => true; public virtual bool ShowTypeArgSignature => true; // TODO TOOLSHED Localization // Ensure that all of the type parser auto-completions actually use localized strings - [Dependency] protected readonly ILocalizationManager Loc = default!; - [Dependency] private readonly ILogManager _log = default!; - [Dependency] protected readonly ToolshedManager Toolshed = default!; + [Dependency] protected ILocalizationManager Loc = default!; + [Dependency] private ILogManager _log = default!; + [Dependency] protected ToolshedManager Toolshed = default!; protected ISawmill Log = default!; diff --git a/Robust.Shared/Toolshed/TypeParsers/TypeTypeParser.cs b/Robust.Shared/Toolshed/TypeParsers/TypeTypeParser.cs index 738f6e8728..acdeead00b 100644 --- a/Robust.Shared/Toolshed/TypeParsers/TypeTypeParser.cs +++ b/Robust.Shared/Toolshed/TypeParsers/TypeTypeParser.cs @@ -19,9 +19,9 @@ namespace Robust.Shared.Toolshed.TypeParsers; // TODO: This should be able to parse more types, currently it only knows the ones in SimpleTypes. -public sealed class TypeTypeParser : TypeParser +public sealed partial class TypeTypeParser : TypeParser { - [Dependency] private readonly IModLoader _modLoader = default!; + [Dependency] private IModLoader _modLoader = default!; public Dictionary Types = new() { diff --git a/Robust.Shared/Upload/SharedNetworkResourceManager.cs b/Robust.Shared/Upload/SharedNetworkResourceManager.cs index 84fac8f166..d3937a1ac5 100644 --- a/Robust.Shared/Upload/SharedNetworkResourceManager.cs +++ b/Robust.Shared/Upload/SharedNetworkResourceManager.cs @@ -21,7 +21,7 @@ namespace Robust.Shared.Upload; /// Manager that allows resources to be added at runtime by admins. /// They will be sent to all clients automatically. /// -public abstract class SharedNetworkResourceManager : IDisposable, IPostInjectInit +public abstract partial class SharedNetworkResourceManager : IDisposable, IPostInjectInit { /// /// Transfer key for client -> server uploads by privileged clients. @@ -33,12 +33,12 @@ public abstract class SharedNetworkResourceManager : IDisposable, IPostInjectIni /// internal const string TransferKeyNetworkDownload = "TransferKeyNetworkDownload"; - [Dependency] private readonly IReplayRecordingManager _replay = default!; - [Dependency] protected readonly INetManager NetManager = default!; - [Dependency] protected readonly IResourceManager ResourceManager = default!; - [Dependency] protected readonly ITransferManager TransferManager = default!; - [Dependency] protected readonly ILogManager LogManager = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; + [Dependency] private IReplayRecordingManager _replay = default!; + [Dependency] protected INetManager NetManager = default!; + [Dependency] protected IResourceManager ResourceManager = default!; + [Dependency] protected ITransferManager TransferManager = default!; + [Dependency] protected ILogManager LogManager = default!; + [Dependency] private ITaskManager _taskManager = default!; protected ISawmill Sawmill = default!; diff --git a/Robust.Shared/Upload/SharedPrototypeLoadManager.cs b/Robust.Shared/Upload/SharedPrototypeLoadManager.cs index 362f04b4a9..a32b6cecc2 100644 --- a/Robust.Shared/Upload/SharedPrototypeLoadManager.cs +++ b/Robust.Shared/Upload/SharedPrototypeLoadManager.cs @@ -13,12 +13,12 @@ namespace Robust.Shared.Upload; /// /// Manages sending runtime-loaded prototypes from game staff to clients. /// -public abstract class SharedPrototypeLoadManager : IGamePrototypeLoadManager +public abstract partial class SharedPrototypeLoadManager : IGamePrototypeLoadManager { - [Dependency] private readonly IReplayRecordingManager _replay = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly ILocalizationManager _localizationManager = default!; - [Dependency] protected readonly INetManager NetManager = default!; + [Dependency] private IReplayRecordingManager _replay = default!; + [Dependency] private IPrototypeManager _prototypeManager = default!; + [Dependency] private ILocalizationManager _localizationManager = default!; + [Dependency] protected INetManager NetManager = default!; [Access(typeof(SharedPrototypeLoadManager))] public readonly List LoadedPrototypes = new(); diff --git a/Robust.Shared/ViewVariables/Commands/ViewVariablesBaseCommand.cs b/Robust.Shared/ViewVariables/Commands/ViewVariablesBaseCommand.cs index 0483f515f8..5c2d689b74 100644 --- a/Robust.Shared/ViewVariables/Commands/ViewVariablesBaseCommand.cs +++ b/Robust.Shared/ViewVariables/Commands/ViewVariablesBaseCommand.cs @@ -7,10 +7,10 @@ using Robust.Shared.Network; namespace Robust.Shared.ViewVariables.Commands; -public abstract class ViewVariablesBaseCommand : LocalizedCommands +public abstract partial class ViewVariablesBaseCommand : LocalizedCommands { - [Dependency] protected readonly INetManager _netMan = default!; - [Dependency] protected readonly IViewVariablesManager _vvm = default!; + [Dependency] protected INetManager _netMan = default!; + [Dependency] protected IViewVariablesManager _vvm = default!; public override async ValueTask GetCompletionAsync(IConsoleShell shell, string[] args, string argStr, CancellationToken cancel) { diff --git a/Robust.Shared/ViewVariables/ViewVariablesManager.cs b/Robust.Shared/ViewVariables/ViewVariablesManager.cs index df1aa1574d..19862376dc 100644 --- a/Robust.Shared/ViewVariables/ViewVariablesManager.cs +++ b/Robust.Shared/ViewVariables/ViewVariablesManager.cs @@ -15,13 +15,13 @@ namespace Robust.Shared.ViewVariables; internal abstract partial class ViewVariablesManager : IViewVariablesManager, IPostInjectInit { - [Dependency] private readonly ISerializationManager _serMan = default!; - [Dependency] private readonly IEntityManager _entMan = default!; - [Dependency] private readonly IComponentFactory _compFact = default!; - [Dependency] private readonly IPrototypeManager _protoMan = default!; - [Dependency] private readonly IReflectionManager _reflectionMan = default!; - [Dependency] private readonly INetManager _netMan = default!; - [Dependency] private readonly ILogManager _logMan = default!; + [Dependency] private ISerializationManager _serMan = default!; + [Dependency] private IEntityManager _entMan = default!; + [Dependency] private IComponentFactory _compFact = default!; + [Dependency] private IPrototypeManager _protoMan = default!; + [Dependency] private IReflectionManager _reflectionMan = default!; + [Dependency] private INetManager _netMan = default!; + [Dependency] private ILogManager _logMan = default!; private readonly Dictionary> _cachedTraits = new(); diff --git a/Robust.UnitTesting/IntegrationMappedStringSerializer.cs b/Robust.UnitTesting/IntegrationMappedStringSerializer.cs index efcc5d817c..9cb1503dc5 100644 --- a/Robust.UnitTesting/IntegrationMappedStringSerializer.cs +++ b/Robust.UnitTesting/IntegrationMappedStringSerializer.cs @@ -12,9 +12,9 @@ using YamlDotNet.RepresentationModel; namespace Robust.UnitTesting { - internal sealed class IntegrationMappedStringSerializer : IRobustMappedStringSerializer + internal sealed partial class IntegrationMappedStringSerializer : IRobustMappedStringSerializer { - [Dependency] private readonly INetManager _net = default!; + [Dependency] private INetManager _net = default!; public bool Locked => false; diff --git a/Robust.UnitTesting/RobustIntegrationTest.NetManager.cs b/Robust.UnitTesting/RobustIntegrationTest.NetManager.cs index 4b4d41a67a..0e38e382e2 100644 --- a/Robust.UnitTesting/RobustIntegrationTest.NetManager.cs +++ b/Robust.UnitTesting/RobustIntegrationTest.NetManager.cs @@ -19,11 +19,11 @@ namespace Robust.UnitTesting { public partial class RobustIntegrationTest { - internal sealed class IntegrationNetManager : IClientNetManager, IServerNetManager + internal sealed partial class IntegrationNetManager : IClientNetManager, IServerNetManager { - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly ITaskManager _taskManager = default!; - [Dependency] private readonly IRobustSerializer _robustSerializer = default!; + [Dependency] private IGameTiming _gameTiming = default!; + [Dependency] private ITaskManager _taskManager = default!; + [Dependency] private IRobustSerializer _robustSerializer = default!; public bool IsServer { get; private set; } public bool IsClient => !IsServer;