diff --git a/Content.Benchmarks/ColorInterpolateBenchmark.cs b/Content.Benchmarks/ColorInterpolateBenchmark.cs index 7005970a00..c09b26ef54 100644 --- a/Content.Benchmarks/ColorInterpolateBenchmark.cs +++ b/Content.Benchmarks/ColorInterpolateBenchmark.cs @@ -105,7 +105,7 @@ namespace Content.Benchmarks [MethodImpl(AggressiveOpt)] public static Color InterpolateSimple(Color a, Color b, float lambda) { - return new Color( + return new( a.R + (b.R - a.R) * lambda, a.G + (b.G - a.G) * lambda, a.B + (b.G - a.B) * lambda, diff --git a/Content.Benchmarks/ComponentFetchBenchmark.cs b/Content.Benchmarks/ComponentFetchBenchmark.cs index a845670de1..2fad40ca67 100644 --- a/Content.Benchmarks/ComponentFetchBenchmark.cs +++ b/Content.Benchmarks/ComponentFetchBenchmark.cs @@ -11,14 +11,14 @@ namespace Content.Benchmarks [Params(5000)] public int NEnt { get; set; } private readonly Dictionary<(EntityUid, Type), BComponent> - _componentsFlat = new Dictionary<(EntityUid, Type), BComponent>(); + _componentsFlat = new(); private readonly Dictionary> _componentsPart = - new Dictionary>(); + new(); - private UniqueIndex _allComponents = new UniqueIndex(); + private UniqueIndex _allComponents = new(); - private readonly List _lookupEntities = new List(); + private readonly List _lookupEntities = new(); [GlobalSetup] public void Setup() diff --git a/Content.Benchmarks/ComponentManagerGetAllComponents.cs b/Content.Benchmarks/ComponentManagerGetAllComponents.cs index db49d0974e..46e6150f1e 100644 --- a/Content.Benchmarks/ComponentManagerGetAllComponents.cs +++ b/Content.Benchmarks/ComponentManagerGetAllComponents.cs @@ -13,7 +13,7 @@ namespace Content.Benchmarks { public class ComponentManagerGetAllComponents { - private readonly List _entities = new List(); + private readonly List _entities = new(); private IComponentManager _componentManager; diff --git a/Content.Benchmarks/DynamicTreeBenchmark.cs b/Content.Benchmarks/DynamicTreeBenchmark.cs index 948015eb7b..9b42061a1c 100644 --- a/Content.Benchmarks/DynamicTreeBenchmark.cs +++ b/Content.Benchmarks/DynamicTreeBenchmark.cs @@ -11,10 +11,10 @@ namespace Content.Benchmarks { ((Box2) default).Enlarged(1), //2x2 square ((Box2) default).Enlarged(2), //4x4 square - new Box2(-3, 3, -3, 3), // point off to the bottom left - new Box2(-3, -3, -3, -3), // point off to the top left - new Box2(3, 3, 3, 3), // point off to the bottom right - new Box2(3, -3, 3, -3), // point off to the top right + new(-3, 3, -3, 3), // point off to the bottom left + new(-3, -3, -3, -3), // point off to the top left + new(3, 3, 3, 3), // point off to the bottom right + new(3, -3, 3, -3), // point off to the top right ((Box2) default).Enlarged(1), //2x2 square ((Box2) default).Enlarged(2), //4x4 square ((Box2) default).Enlarged(1), //2x2 square @@ -24,10 +24,10 @@ namespace Content.Benchmarks ((Box2) default).Enlarged(1), //2x2 square ((Box2) default).Enlarged(2), //4x4 square ((Box2) default).Enlarged(3), //6x6 square - new Box2(-3, 3, -3, 3), // point off to the bottom left - new Box2(-3, -3, -3, -3), // point off to the top left - new Box2(3, 3, 3, 3), // point off to the bottom right - new Box2(3, -3, 3, -3), // point off to the top right + new(-3, 3, -3, 3), // point off to the bottom left + new(-3, -3, -3, -3), // point off to the top left + new(3, 3, 3, 3), // point off to the bottom right + new(3, -3, 3, -3), // point off to the top right }; private B2DynamicTree _b2Tree; diff --git a/Content.Benchmarks/EntityFetchBenchmark.cs b/Content.Benchmarks/EntityFetchBenchmark.cs index f6016f0525..3db0783502 100644 --- a/Content.Benchmarks/EntityFetchBenchmark.cs +++ b/Content.Benchmarks/EntityFetchBenchmark.cs @@ -12,8 +12,8 @@ namespace Content.Benchmarks public int M { get; set; } = 10; - private readonly DictEntityStorage _dictStorage = new DictEntityStorage(); - private readonly GenEntityStorage _genStorage = new GenEntityStorage(); + private readonly DictEntityStorage _dictStorage = new(); + private readonly GenEntityStorage _genStorage = new(); private IEntityStorage _dictStorageInterface; private IEntityStorage _genStorageInterface; @@ -146,7 +146,7 @@ namespace Content.Benchmarks { private int _nextValue; - private readonly Dictionary _dict = new Dictionary(); + private readonly Dictionary _dict = new(); public override bool TryGetEntity(DictEntityUid entityUid, out DictEntity entity) { @@ -198,7 +198,7 @@ namespace Content.Benchmarks private sealed class GenEntityStorage : EntityStorage { private (int generation, GenEntity entity)[] _entities = new (int, GenEntity)[1]; - private readonly List _availableSlots = new List {0}; + private readonly List _availableSlots = new() {0}; public override bool TryGetEntity(GenEntityUid entityUid, out GenEntity entity) { diff --git a/Content.Benchmarks/NetSerializerStringBenchmark.cs b/Content.Benchmarks/NetSerializerStringBenchmark.cs index ba42c3f694..1d8aad77b5 100644 --- a/Content.Benchmarks/NetSerializerStringBenchmark.cs +++ b/Content.Benchmarks/NetSerializerStringBenchmark.cs @@ -23,8 +23,8 @@ namespace Content.Benchmarks [Params(8, 64, 256, 1024)] public int StringLength { get; set; } - private readonly MemoryStream _outputStream = new MemoryStream(2048); - private readonly MemoryStream _inputStream = new MemoryStream(2048); + private readonly MemoryStream _outputStream = new(2048); + private readonly MemoryStream _inputStream = new(2048); [GlobalSetup] public void Setup() diff --git a/Content.Client/Administration/ClientAdminManager.cs b/Content.Client/Administration/ClientAdminManager.cs index 4301bfe8d0..851da395aa 100644 --- a/Content.Client/Administration/ClientAdminManager.cs +++ b/Content.Client/Administration/ClientAdminManager.cs @@ -17,7 +17,7 @@ namespace Content.Client.Administration [Dependency] private readonly IClientConGroupController _conGroup = default!; private AdminData? _adminData; - private readonly HashSet _availableCommands = new HashSet(); + private readonly HashSet _availableCommands = new(); public event Action? AdminStatusUpdated; diff --git a/Content.Client/Arcade/BlockGameMenu.cs b/Content.Client/Arcade/BlockGameMenu.cs index cada939096..dba8dff389 100644 --- a/Content.Client/Arcade/BlockGameMenu.cs +++ b/Content.Client/Arcade/BlockGameMenu.cs @@ -18,10 +18,10 @@ namespace Content.Client.Arcade { public class BlockGameMenu : SS14Window { - private static readonly Color OverlayBackgroundColor = new Color(74,74,81,180); - private static readonly Color OverlayShadowColor = new Color(0,0,0,83); + private static readonly Color OverlayBackgroundColor = new(74,74,81,180); + private static readonly Color OverlayShadowColor = new(0,0,0,83); - private static readonly Vector2 BlockSize = new Vector2(15,15); + private static readonly Vector2 BlockSize = new(15,15); private readonly BlockGameBoundUserInterface _owner; diff --git a/Content.Client/Chat/ChatManager.cs b/Content.Client/Chat/ChatManager.cs index 9384d65306..fbbc634249 100644 --- a/Content.Client/Chat/ChatManager.cs +++ b/Content.Client/Chat/ChatManager.cs @@ -61,7 +61,7 @@ namespace Content.Client.Chat private const char MeAlias = '@'; private const char AdminChatAlias = ']'; - private readonly List filteredHistory = new List(); + private readonly List filteredHistory = new(); // Filter Button States private bool _allState; @@ -88,13 +88,13 @@ namespace Content.Client.Chat /// We track them to push them up when new ones get added. /// private readonly Dictionary> _activeSpeechBubbles = - new Dictionary>(); + new(); /// /// Speech bubbles that are to-be-sent because of the "rate limit" they have. /// private readonly Dictionary _queuedSpeechBubbles - = new Dictionary(); + = new(); public void Initialize() { @@ -532,7 +532,7 @@ namespace Content.Client.Chat /// public float TimeLeft { get; set; } - public Queue MessageQueue { get; } = new Queue(); + public Queue MessageQueue { get; } = new(); } } } diff --git a/Content.Client/ClickMapManager.cs b/Content.Client/ClickMapManager.cs index b25e58e033..b6a25fe5ef 100644 --- a/Content.Client/ClickMapManager.cs +++ b/Content.Client/ClickMapManager.cs @@ -22,10 +22,10 @@ namespace Content.Client [Dependency] private readonly IResourceCache _resourceCache = default!; [ViewVariables] - private readonly Dictionary _textureMaps = new Dictionary(); + private readonly Dictionary _textureMaps = new(); [ViewVariables] private readonly Dictionary _rsiMaps = - new Dictionary(); + new(); public void PostInject() { diff --git a/Content.Client/ClientNotifyManager.cs b/Content.Client/ClientNotifyManager.cs index aabeadf003..cc7b31b747 100644 --- a/Content.Client/ClientNotifyManager.cs +++ b/Content.Client/ClientNotifyManager.cs @@ -29,7 +29,7 @@ namespace Content.Client [Dependency] private readonly IClientNetManager _netManager = default!; [Dependency] private readonly IEntityManager _entityManager = default!; - private readonly List _aliveLabels = new List(); + private readonly List _aliveLabels = new(); private bool _initialized; public void Initialize() diff --git a/Content.Client/Command/CommunicationsConsoleMenu.cs b/Content.Client/Command/CommunicationsConsoleMenu.cs index 3addc2c1ad..aede8c6e69 100644 --- a/Content.Client/Command/CommunicationsConsoleMenu.cs +++ b/Content.Client/Command/CommunicationsConsoleMenu.cs @@ -15,7 +15,7 @@ namespace Content.Client.Command protected override Vector2? CustomSize => new Vector2(600, 400); private CommunicationsConsoleBoundUserInterface Owner { get; set; } - private readonly CancellationTokenSource _timerCancelTokenSource = new CancellationTokenSource(); + private readonly CancellationTokenSource _timerCancelTokenSource = new(); private readonly Button _emergencyShuttleButton; private readonly RichTextLabel _countdownLabel; diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index 8b7481326e..88a799c4de 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -143,7 +143,7 @@ namespace Content.Client.Construction private static ItemList.Item GetItem(ConstructionPrototype recipe, ItemList itemList) { - return new ItemList.Item(itemList) + return new(itemList) { Metadata = recipe, Text = recipe.Name, diff --git a/Content.Client/Eui/EuiManager.cs b/Content.Client/Eui/EuiManager.cs index 3831f0b766..8dffbc9d16 100644 --- a/Content.Client/Eui/EuiManager.cs +++ b/Content.Client/Eui/EuiManager.cs @@ -15,7 +15,7 @@ namespace Content.Client.Eui [Dependency] private readonly IReflectionManager _refl = default!; [Dependency] private readonly IDynamicTypeFactory _dtf = default!; - private readonly Dictionary _openUis = new Dictionary(); + private readonly Dictionary _openUis = new(); public void Initialize() { diff --git a/Content.Client/GameObjects/Components/Access/IdCardConsoleWindow.cs b/Content.Client/GameObjects/Components/Access/IdCardConsoleWindow.cs index 2d8f5d5374..c4e8e0370f 100644 --- a/Content.Client/GameObjects/Components/Access/IdCardConsoleWindow.cs +++ b/Content.Client/GameObjects/Components/Access/IdCardConsoleWindow.cs @@ -29,7 +29,7 @@ namespace Content.Client.GameObjects.Components.Access private readonly IdCardConsoleBoundUserInterface _owner; - private readonly Dictionary _accessButtons = new Dictionary(); + private readonly Dictionary _accessButtons = new(); private string _lastFullName; private string _lastJobTitle; diff --git a/Content.Client/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs b/Content.Client/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs index a2feb6bb75..413a01f7e8 100644 --- a/Content.Client/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs +++ b/Content.Client/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs @@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Cargo [RegisterComponent] public class CargoOrderDatabaseComponent : SharedCargoOrderDatabaseComponent { - private readonly List _orders = new List(); + private readonly List _orders = new(); public IReadOnlyList Orders => _orders; /// diff --git a/Content.Client/GameObjects/Components/ClickableComponent.cs b/Content.Client/GameObjects/Components/ClickableComponent.cs index a92af22451..63d4622648 100644 --- a/Content.Client/GameObjects/Components/ClickableComponent.cs +++ b/Content.Client/GameObjects/Components/ClickableComponent.cs @@ -130,7 +130,7 @@ namespace Content.Client.GameObjects.Components [ViewVariables] public Box2 East; [ViewVariables] public Box2 West; - public static DirBoundData Default { get; } = new DirBoundData(); + public static DirBoundData Default { get; } = new(); public void ExposeData(ObjectSerializer serializer) { diff --git a/Content.Client/GameObjects/Components/CloningPod/CloningPodWindow.cs b/Content.Client/GameObjects/Components/CloningPod/CloningPodWindow.cs index 04e638ccc5..2cf858a5d0 100644 --- a/Content.Client/GameObjects/Components/CloningPod/CloningPodWindow.cs +++ b/Content.Client/GameObjects/Components/CloningPod/CloningPodWindow.cs @@ -33,7 +33,7 @@ namespace Content.Client.GameObjects.Components.CloningPod private CloningPodBoundUserInterfaceState _lastUpdate = null!; // List of scans that are visible based on current filter criteria. - private readonly Dictionary _filteredScans = new Dictionary(); + private readonly Dictionary _filteredScans = new(); // The indices of the visible scans last time UpdateVisibleScans was ran. // This is inclusive, so end is the index of the last scan, not right after it. diff --git a/Content.Client/GameObjects/Components/DoAfterComponent.cs b/Content.Client/GameObjects/Components/DoAfterComponent.cs index 7974b30514..bb02da949d 100644 --- a/Content.Client/GameObjects/Components/DoAfterComponent.cs +++ b/Content.Client/GameObjects/Components/DoAfterComponent.cs @@ -17,10 +17,9 @@ namespace Content.Client.GameObjects.Components public override string Name => "DoAfter"; public IReadOnlyDictionary DoAfters => _doAfters; - private readonly Dictionary _doAfters = new Dictionary(); - - public readonly List<(TimeSpan CancelTime, ClientDoAfter Message)> CancelledDoAfters = - new List<(TimeSpan CancelTime, ClientDoAfter Message)>(); + private readonly Dictionary _doAfters = new(); + + public readonly List<(TimeSpan CancelTime, ClientDoAfter Message)> CancelledDoAfters = new(); public DoAfterGui? Gui { get; set; } diff --git a/Content.Client/GameObjects/Components/FlashLightVisualizer.cs b/Content.Client/GameObjects/Components/FlashLightVisualizer.cs index a8851f2e1e..74d1dc3a41 100644 --- a/Content.Client/GameObjects/Components/FlashLightVisualizer.cs +++ b/Content.Client/GameObjects/Components/FlashLightVisualizer.cs @@ -12,7 +12,7 @@ namespace Content.Client.GameObjects.Components [UsedImplicitly] public class FlashLightVisualizer : AppearanceVisualizer { - private readonly Animation _radiatingLightAnimation = new Animation + private readonly Animation _radiatingLightAnimation = new() { Length = TimeSpan.FromSeconds(1), AnimationTracks = @@ -32,7 +32,7 @@ namespace Content.Client.GameObjects.Components } }; - private readonly Animation _blinkingLightAnimation = new Animation + private readonly Animation _blinkingLightAnimation = new() { Length = TimeSpan.FromSeconds(1), AnimationTracks = diff --git a/Content.Client/GameObjects/Components/Gravity/GravityGeneratorVisualizer.cs b/Content.Client/GameObjects/Components/Gravity/GravityGeneratorVisualizer.cs index 60eb02d45b..7373b2969b 100644 --- a/Content.Client/GameObjects/Components/Gravity/GravityGeneratorVisualizer.cs +++ b/Content.Client/GameObjects/Components/Gravity/GravityGeneratorVisualizer.cs @@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.Components.Gravity { public class GravityGeneratorVisualizer : AppearanceVisualizer { - private readonly Dictionary _spriteMap = new Dictionary(); + private readonly Dictionary _spriteMap = new(); public override void InitializeEntity(IEntity entity) { diff --git a/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs b/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs index c458407ca5..9fabec2678 100644 --- a/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs +++ b/Content.Client/GameObjects/Components/HUD/Inventory/ClientInventoryComponent.cs @@ -22,7 +22,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory [RegisterComponent] public class ClientInventoryComponent : SharedInventoryComponent { - private readonly Dictionary _slots = new Dictionary(); + private readonly Dictionary _slots = new(); [ViewVariables] public InventoryInterfaceController InterfaceController { get; private set; } = default!; diff --git a/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs b/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs index 322553b0b2..05b2a6a696 100644 --- a/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs +++ b/Content.Client/GameObjects/Components/HUD/Inventory/HumanInventoryInterfaceController.cs @@ -22,7 +22,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory [Dependency] private readonly IItemSlotManager _itemSlotManager = default!; private readonly Dictionary> _inventoryButtons - = new Dictionary>(); + = new(); private ItemSlotButton _hudButtonPocket1; private ItemSlotButton _hudButtonPocket2; diff --git a/Content.Client/GameObjects/Components/HandheldLightComponent.cs b/Content.Client/GameObjects/Components/HandheldLightComponent.cs index 586ffd959a..8f52d23fae 100644 --- a/Content.Client/GameObjects/Components/HandheldLightComponent.cs +++ b/Content.Client/GameObjects/Components/HandheldLightComponent.cs @@ -42,12 +42,12 @@ namespace Content.Client.GameObjects.Components private float _timer; - private static readonly StyleBoxFlat _styleBoxLit = new StyleBoxFlat + private static readonly StyleBoxFlat _styleBoxLit = new() { BackgroundColor = Color.Green }; - private static readonly StyleBoxFlat _styleBoxUnlit = new StyleBoxFlat + private static readonly StyleBoxFlat _styleBoxUnlit = new() { BackgroundColor = Color.Black }; diff --git a/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs b/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs index 85c98e9a27..e9d3fc6f88 100644 --- a/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs +++ b/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs @@ -50,7 +50,7 @@ namespace Content.Client.GameObjects.Components.Instruments /// A queue of MidiEvents to be sent to the server. /// [ViewVariables] - private readonly List _midiEventBuffer = new List(); + private readonly List _midiEventBuffer = new(); /// /// Whether a midi song will loop or not. diff --git a/Content.Client/GameObjects/Components/Items/HandsComponent.cs b/Content.Client/GameObjects/Components/Items/HandsComponent.cs index c967a7e4d7..2ccbc805d1 100644 --- a/Content.Client/GameObjects/Components/Items/HandsComponent.cs +++ b/Content.Client/GameObjects/Components/Items/HandsComponent.cs @@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.Components.Items private HandsGui? _gui; - private readonly List _hands = new List(); + private readonly List _hands = new(); [ViewVariables] public IReadOnlyList Hands => _hands; diff --git a/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs b/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs index 66e0636e38..3e262e8a52 100644 --- a/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs @@ -26,8 +26,8 @@ namespace Content.Client.GameObjects.Components.Kitchen private MicrowaveMenu _menu; - private readonly Dictionary _solids = new Dictionary(); - private readonly Dictionary _reagents =new Dictionary(); + private readonly Dictionary _solids = new(); + private readonly Dictionary _reagents =new(); public MicrowaveBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner,uiKey) { diff --git a/Content.Client/GameObjects/Components/LanternVisualizer.cs b/Content.Client/GameObjects/Components/LanternVisualizer.cs index 4e90760f01..7b0fde650f 100644 --- a/Content.Client/GameObjects/Components/LanternVisualizer.cs +++ b/Content.Client/GameObjects/Components/LanternVisualizer.cs @@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.Components [UsedImplicitly] public class LanternVisualizer : AppearanceVisualizer { - private readonly Animation _radiatingLightAnimation = new Animation + private readonly Animation _radiatingLightAnimation = new() { Length = TimeSpan.FromSeconds(5), AnimationTracks = diff --git a/Content.Client/GameObjects/Components/LightBehaviourComponent.cs b/Content.Client/GameObjects/Components/LightBehaviourComponent.cs index d15ecf5bc9..757c5ca8c8 100644 --- a/Content.Client/GameObjects/Components/LightBehaviourComponent.cs +++ b/Content.Client/GameObjects/Components/LightBehaviourComponent.cs @@ -361,7 +361,7 @@ namespace Content.Client.GameObjects.Components } [ViewVariables(VVAccess.ReadOnly)] - private readonly List _animations = new List(); + private readonly List _animations = new(); private float _originalRadius = default; private float _originalEnergy = default; diff --git a/Content.Client/GameObjects/Components/Mobs/ClientAlertsComponent.cs b/Content.Client/GameObjects/Components/Mobs/ClientAlertsComponent.cs index 1270cb79a3..4f2a1bbb6c 100644 --- a/Content.Client/GameObjects/Components/Mobs/ClientAlertsComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/ClientAlertsComponent.cs @@ -45,7 +45,7 @@ namespace Content.Client.GameObjects.Components.Mobs [ViewVariables] private readonly Dictionary _alertControls - = new Dictionary(); + = new(); /// /// Allows calculating if we need to act due to this component being controlled by the current mob diff --git a/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs b/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs index 34a3f25e1e..2a6c1e7358 100644 --- a/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/ClientOverlayEffectsComponent.cs @@ -31,7 +31,7 @@ namespace Content.Client.GameObjects.Components.Mobs /// /// A list of overlay containers representing the current overlays applied /// - private List _currentEffects = new List(); + private List _currentEffects = new(); [ViewVariables(VVAccess.ReadOnly)] public List ActiveOverlays diff --git a/Content.Client/GameObjects/Components/Mobs/DamageStateVisualizer.cs b/Content.Client/GameObjects/Components/Mobs/DamageStateVisualizer.cs index 725ba807bc..2a80904c5d 100644 --- a/Content.Client/GameObjects/Components/Mobs/DamageStateVisualizer.cs +++ b/Content.Client/GameObjects/Components/Mobs/DamageStateVisualizer.cs @@ -14,7 +14,7 @@ namespace Content.Client.GameObjects.Components.Mobs public sealed class DamageStateVisualizer : AppearanceVisualizer { private DamageState _data = DamageState.Alive; - private readonly Dictionary _stateMap = new Dictionary(); + private readonly Dictionary _stateMap = new(); private int? _originalDrawDepth; public override void LoadData(YamlMappingNode node) diff --git a/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs b/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs index 4ea8d1e661..f9ca367df3 100644 --- a/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs @@ -10,7 +10,7 @@ namespace Content.Client.GameObjects.Components.Mobs.State [ComponentReference(typeof(SharedMobStateManagerComponent))] public class MobStateManagerComponent : SharedMobStateManagerComponent { - private readonly Dictionary _behavior = new Dictionary + private readonly Dictionary _behavior = new() { {DamageState.Alive, new NormalState()}, {DamageState.Critical, new CriticalState()}, diff --git a/Content.Client/GameObjects/Components/Observer/GhostComponent.cs b/Content.Client/GameObjects/Components/Observer/GhostComponent.cs index 5c9d6c7ade..956dbe6e89 100644 --- a/Content.Client/GameObjects/Components/Observer/GhostComponent.cs +++ b/Content.Client/GameObjects/Components/Observer/GhostComponent.cs @@ -19,8 +19,8 @@ namespace Content.Client.GameObjects.Components.Observer [Dependency] private readonly IGameHud _gameHud = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IComponentManager _componentManager = default!; - public List WarpNames = new List(); - public Dictionary PlayerNames = new Dictionary(); + public List WarpNames = new(); + public Dictionary PlayerNames = new(); private GhostGui? _gui ; diff --git a/Content.Client/GameObjects/Components/ParticleAcceleratorPartVisualizer.cs b/Content.Client/GameObjects/Components/ParticleAcceleratorPartVisualizer.cs index e2e2dc8be2..de86d14e7b 100644 --- a/Content.Client/GameObjects/Components/ParticleAcceleratorPartVisualizer.cs +++ b/Content.Client/GameObjects/Components/ParticleAcceleratorPartVisualizer.cs @@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.Components { public class ParticleAcceleratorPartVisualizer : AppearanceVisualizer { - private readonly Dictionary _states = new Dictionary(); + private readonly Dictionary _states = new(); public override void LoadData(YamlMappingNode node) { diff --git a/Content.Client/GameObjects/Components/Power/SolarControlConsoleBoundUserInterface.cs b/Content.Client/GameObjects/Components/Power/SolarControlConsoleBoundUserInterface.cs index c892f1cd90..76b51c9bb2 100644 --- a/Content.Client/GameObjects/Components/Power/SolarControlConsoleBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Power/SolarControlConsoleBoundUserInterface.cs @@ -17,7 +17,7 @@ namespace Content.Client.GameObjects.Components.Power [Dependency] private readonly IGameTiming _gameTiming = default; private SolarControlWindow _window; - private SolarControlConsoleBoundInterfaceState _lastState = new SolarControlConsoleBoundInterfaceState(0, 0, 0, 0); + private SolarControlConsoleBoundInterfaceState _lastState = new(0, 0, 0, 0); protected override void Open() { @@ -161,7 +161,7 @@ namespace Content.Client.GameObjects.Components.Power // This makes the display feel a lot smoother. private IGameTiming _gameTiming; - private SolarControlConsoleBoundInterfaceState _lastState = new SolarControlConsoleBoundInterfaceState(0, 0, 0, 0); + private SolarControlConsoleBoundInterfaceState _lastState = new(0, 0, 0, 0); private TimeSpan _lastStateTime = TimeSpan.Zero; diff --git a/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs b/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs index 49f7169f67..da82ffeaec 100644 --- a/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Research/LatheBoundUserInterface.cs @@ -25,7 +25,7 @@ namespace Content.Client.GameObjects.Components.Research [ViewVariables] public Queue QueuedRecipes => _queuedRecipes; - private readonly Queue _queuedRecipes = new Queue(); + private readonly Queue _queuedRecipes = new(); public LatheBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) { diff --git a/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs b/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs index 742abc8fd4..7024ced072 100644 --- a/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs +++ b/Content.Client/GameObjects/Components/Research/MaterialStorageComponent.cs @@ -9,7 +9,7 @@ namespace Content.Client.GameObjects.Components.Research [ComponentReference(typeof(SharedMaterialStorageComponent))] public class MaterialStorageComponent : SharedMaterialStorageComponent { - protected override Dictionary Storage { get; set; } = new Dictionary(); + protected override Dictionary Storage { get; set; } = new(); public event Action OnMaterialStorageChanged; diff --git a/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs b/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs index b2dec0fcbc..7c8b76b343 100644 --- a/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs +++ b/Content.Client/GameObjects/Components/Sound/LoopingSoundComponent.cs @@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.Components.Sound { [Dependency] private readonly IRobustRandom _random = default!; - private readonly Dictionary _audioStreams = new Dictionary(); + private readonly Dictionary _audioStreams = new(); private AudioSystem _audioSystem; public override void StopAllSounds() diff --git a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs index c018e2448b..617f14df12 100644 --- a/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs +++ b/Content.Client/GameObjects/Components/Storage/ClientStorageComponent.cs @@ -25,7 +25,7 @@ namespace Content.Client.GameObjects.Components.Storage [RegisterComponent] public class ClientStorageComponent : SharedStorageComponent, IDraggable { - private List _storedEntities = new List(); + private List _storedEntities = new(); private int StorageSizeUsed; private int StorageCapacityMax; private StorageWindow Window; @@ -138,8 +138,8 @@ namespace Content.Client.GameObjects.Components.Storage private readonly Label _information; public ClientStorageComponent StorageEntity; - private readonly StyleBoxFlat _hoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.35f) }; - private readonly StyleBoxFlat _unHoveredBox = new StyleBoxFlat { BackgroundColor = Color.Black.WithAlpha(0.0f) }; + private readonly StyleBoxFlat _hoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.35f) }; + private readonly StyleBoxFlat _unHoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.0f) }; protected override Vector2? CustomSize => (180, 320); diff --git a/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs b/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs index 959ad934ad..503aceaf2d 100644 --- a/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs +++ b/Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs @@ -67,7 +67,7 @@ namespace Content.Client.GameObjects.Components.Suspicion } } - public HashSet Allies { get; } = new HashSet(); + public HashSet Allies { get; } = new(); private bool AddAlly(EntityUid ally) { diff --git a/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs b/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs index 1db501ba73..761d654b36 100644 --- a/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs +++ b/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs @@ -23,7 +23,7 @@ namespace Content.Client.GameObjects.Components.Suspicion private readonly Font _font; private readonly IEntity _user; - private readonly HashSet _allies = new HashSet(); + private readonly HashSet _allies = new(); private readonly string _traitorText = Loc.GetString("Traitor"); public TraitorOverlay( diff --git a/Content.Client/GameObjects/Components/VendingMachines/VendingMachineVisualizer.cs b/Content.Client/GameObjects/Components/VendingMachines/VendingMachineVisualizer.cs index 9b8f363df3..50de4b17e4 100644 --- a/Content.Client/GameObjects/Components/VendingMachines/VendingMachineVisualizer.cs +++ b/Content.Client/GameObjects/Components/VendingMachines/VendingMachineVisualizer.cs @@ -26,7 +26,7 @@ namespace Content.Client.GameObjects.Components.VendingMachines private Dictionary _baseStates; private static readonly Dictionary LayerMap = - new Dictionary + new() { {"off", VendingMachineVisualLayers.Unlit}, {"screen", VendingMachineVisualLayers.Screen}, @@ -39,7 +39,7 @@ namespace Content.Client.GameObjects.Components.VendingMachines {"broken", VendingMachineVisualLayers.Unlit}, }; - private readonly Dictionary _animations = new Dictionary(); + private readonly Dictionary _animations = new(); public override void LoadData(YamlMappingNode node) { diff --git a/Content.Client/GameObjects/Components/Weapons/Ranged/Barrels/ClientMagazineBarrelComponent.cs b/Content.Client/GameObjects/Components/Weapons/Ranged/Barrels/ClientMagazineBarrelComponent.cs index be869e8b49..69a3980dee 100644 --- a/Content.Client/GameObjects/Components/Weapons/Ranged/Barrels/ClientMagazineBarrelComponent.cs +++ b/Content.Client/GameObjects/Components/Weapons/Ranged/Barrels/ClientMagazineBarrelComponent.cs @@ -22,7 +22,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels [RegisterComponent] public class ClientMagazineBarrelComponent : Component, IItemStatus { - private static readonly Animation AlarmAnimationSmg = new Animation + private static readonly Animation AlarmAnimationSmg = new() { Length = TimeSpan.FromSeconds(1.4), AnimationTracks = @@ -45,7 +45,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels } }; - private static readonly Animation AlarmAnimationLmg = new Animation + private static readonly Animation AlarmAnimationLmg = new() { Length = TimeSpan.FromSeconds(0.75), AnimationTracks = diff --git a/Content.Client/GameObjects/Components/Wires/WiresMenu.cs b/Content.Client/GameObjects/Components/Wires/WiresMenu.cs index 9999f35bf2..a845ee3522 100644 --- a/Content.Client/GameObjects/Components/Wires/WiresMenu.cs +++ b/Content.Client/GameObjects/Components/Wires/WiresMenu.cs @@ -481,7 +481,7 @@ namespace Content.Client.GameObjects.Components.Wires private sealed class StatusLight : Control { - private static readonly Animation _blinkingFast = new Animation + private static readonly Animation _blinkingFast = new() { Length = TimeSpan.FromSeconds(0.2), AnimationTracks = @@ -500,7 +500,7 @@ namespace Content.Client.GameObjects.Components.Wires } }; - private static readonly Animation _blinkingSlow = new Animation + private static readonly Animation _blinkingSlow = new() { Length = TimeSpan.FromSeconds(0.8), AnimationTracks = diff --git a/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs b/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs index 943a057714..cf04926122 100644 --- a/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/AI/ClientAiDebugSystem.cs @@ -19,7 +19,7 @@ namespace Content.Client.GameObjects.EntitySystems.AI [Dependency] private readonly IEyeManager _eyeManager = default!; private AiDebugMode _tooltips = AiDebugMode.None; - private readonly Dictionary _aiBoxes = new Dictionary(); + private readonly Dictionary _aiBoxes = new(); public override void Update(float frameTime) { diff --git a/Content.Client/GameObjects/EntitySystems/AI/ClientPathfindingDebugSystem.cs b/Content.Client/GameObjects/EntitySystems/AI/ClientPathfindingDebugSystem.cs index 9b80244405..a5dc75b1d6 100644 --- a/Content.Client/GameObjects/EntitySystems/AI/ClientPathfindingDebugSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/AI/ClientPathfindingDebugSystem.cs @@ -179,27 +179,27 @@ namespace Content.Client.GameObjects.EntitySystems.AI public PathfindingDebugMode Modes { get; set; } = PathfindingDebugMode.None; // Graph debugging - public readonly Dictionary> Graph = new Dictionary>(); - private readonly Dictionary _graphColors = new Dictionary(); + public readonly Dictionary> Graph = new(); + private readonly Dictionary _graphColors = new(); // Cached regions public readonly Dictionary>> CachedRegions = - new Dictionary>>(); + new(); private readonly Dictionary> _cachedRegionColors = - new Dictionary>(); + new(); // Regions public readonly Dictionary>>> Regions = - new Dictionary>>>(); + new(); private readonly Dictionary>> _regionColors = - new Dictionary>>(); + new(); // Route debugging // As each pathfinder is very different you'll likely want to draw them completely different - public readonly List AStarRoutes = new List(); - public readonly List JpsRoutes = new List(); + public readonly List AStarRoutes = new(); + public readonly List JpsRoutes = new(); public DebugPathfindingOverlay() : base(nameof(DebugPathfindingOverlay)) { diff --git a/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs b/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs index 5ba8c401d5..411e63b285 100644 --- a/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs +++ b/Content.Client/GameObjects/EntitySystems/AtmosDebugOverlaySystem.cs @@ -18,7 +18,7 @@ namespace Content.Client.GameObjects.EntitySystems [Dependency] private readonly IMapManager _mapManager = default!; private readonly Dictionary _tileData = - new Dictionary(); + new(); public override void Initialize() { diff --git a/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs b/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs index aaa426bfb5..b92276b59b 100644 --- a/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/ConstructionSystem.cs @@ -29,7 +29,7 @@ namespace Content.Client.GameObjects.EntitySystems [Dependency] private readonly IPlayerManager _playerManager = default!; private int _nextId; - private readonly Dictionary _ghosts = new Dictionary(); + private readonly Dictionary _ghosts = new(); private ConstructionMenu _constructionMenu; /// diff --git a/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterGui.cs b/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterGui.cs index ec87507a76..23d865018e 100644 --- a/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterGui.cs +++ b/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterGui.cs @@ -21,11 +21,11 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter [Dependency] private readonly IEyeManager _eyeManager = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; - private readonly Dictionary _doAfterControls = new Dictionary(); - private readonly Dictionary _doAfterBars = new Dictionary(); + private readonly Dictionary _doAfterControls = new(); + private readonly Dictionary _doAfterBars = new(); // We'll store cancellations for a little bit just so we can flash the graphic to indicate it's cancelled - private readonly Dictionary _cancelledDoAfters = new Dictionary(); + private readonly Dictionary _cancelledDoAfters = new(); public IEntity? AttachedEntity { get; set; } private ScreenCoordinates _playerPosition; diff --git a/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterSystem.cs b/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterSystem.cs index 920cd8e71a..7f911cfcb4 100644 --- a/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/DoAfter/DoAfterSystem.cs @@ -35,7 +35,7 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter // Each component in range will have its own vBox which we need to keep track of so if they go out of range or // come into range it needs altering - private readonly HashSet _knownComponents = new HashSet(); + private readonly HashSet _knownComponents = new(); private IEntity? _attachedEntity; diff --git a/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs b/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs index 2288e33936..2103cb84d7 100644 --- a/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/DragDropSystem.cs @@ -51,7 +51,7 @@ namespace Content.Client.GameObjects.EntitySystems // entity performing the drag action private IEntity _dragger; private IEntity _draggedEntity; - private readonly List _draggables = new List(); + private readonly List _draggables = new(); private IEntity _dragShadow; private DragState _state; // time since mouse down over the dragged entity @@ -71,7 +71,7 @@ namespace Content.Client.GameObjects.EntitySystems private SharedInteractionSystem _interactionSystem; private InputSystem _inputSystem; - private readonly List _highlightedSprites = new List(); + private readonly List _highlightedSprites = new(); private enum DragState { diff --git a/Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs b/Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs index 1c9afa5b3e..f1e7f9f8b1 100644 --- a/Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs +++ b/Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs @@ -24,7 +24,7 @@ namespace Content.Client.GameObjects.EntitySystems [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; - private readonly Dictionary _fireCache = new Dictionary(); + private readonly Dictionary _fireCache = new(); // Gas overlays private readonly float[] _timer = new float[Atmospherics.TotalNumberOfGases]; @@ -42,7 +42,7 @@ namespace Content.Client.GameObjects.EntitySystems private readonly Texture[][] _fireFrames = new Texture[FireStates][]; private readonly Dictionary> _tileData = - new Dictionary>(); + new(); private AtmosphereSystem _atmosphereSystem = default!; diff --git a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs index 12018fa85e..3e40056e9d 100644 --- a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs @@ -21,7 +21,7 @@ namespace Content.Client.GameObjects.EntitySystems { [Dependency] private readonly IMapManager _mapManager = default!; - private readonly Queue _dirtyEntities = new Queue(); + private readonly Queue _dirtyEntities = new(); private int _generation; diff --git a/Content.Client/GameObjects/EntitySystems/WindowSystem.cs b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs index bf4a7c4819..4f2d79ec8c 100644 --- a/Content.Client/GameObjects/EntitySystems/WindowSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs @@ -10,7 +10,7 @@ namespace Content.Client.GameObjects.EntitySystems [UsedImplicitly] public sealed class WindowSystem : EntitySystem { - private readonly Queue _dirtyEntities = new Queue(); + private readonly Queue _dirtyEntities = new(); public override void Initialize() { diff --git a/Content.Client/GameTicking/ClientGameTicker.cs b/Content.Client/GameTicking/ClientGameTicker.cs index 17e46432f2..fb9a14ae76 100644 --- a/Content.Client/GameTicking/ClientGameTicker.cs +++ b/Content.Client/GameTicking/ClientGameTicker.cs @@ -22,7 +22,7 @@ namespace Content.Client.GameTicking [Dependency] private readonly IStateManager _stateManager = default!; [ViewVariables] private bool _initialized; - private readonly List _jobsAvailable = new List(); + private readonly List _jobsAvailable = new(); [ViewVariables] public bool AreWeReady { get; private set; } [ViewVariables] public bool IsGameStarted { get; private set; } diff --git a/Content.Client/Parallax/ParallaxGenerator.cs b/Content.Client/Parallax/ParallaxGenerator.cs index d905c19dd9..d1c182910b 100644 --- a/Content.Client/Parallax/ParallaxGenerator.cs +++ b/Content.Client/Parallax/ParallaxGenerator.cs @@ -16,7 +16,7 @@ namespace Content.Client.Parallax { public class ParallaxGenerator { - private readonly List Layers = new List(); + private readonly List Layers = new(); public static Image GenerateParallax(TomlTable config, Size size, ISawmill sawmill, List> debugLayerDump) { diff --git a/Content.Client/Parallax/ParallaxManager.cs b/Content.Client/Parallax/ParallaxManager.cs index a58c7710e9..154f2e117b 100644 --- a/Content.Client/Parallax/ParallaxManager.cs +++ b/Content.Client/Parallax/ParallaxManager.cs @@ -24,11 +24,11 @@ namespace Content.Client.Parallax [Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!; - private static readonly ResourcePath ParallaxConfigPath = new ResourcePath("/parallax_config.toml"); + private static readonly ResourcePath ParallaxConfigPath = new("/parallax_config.toml"); // Both of these below are in the user directory. - private static readonly ResourcePath ParallaxPath = new ResourcePath("/parallax_cache.png"); - private static readonly ResourcePath ParallaxConfigOld = new ResourcePath("/parallax_config_old"); + private static readonly ResourcePath ParallaxPath = new("/parallax_cache.png"); + private static readonly ResourcePath ParallaxConfigOld = new("/parallax_config_old"); public event Action OnTextureLoaded; public Texture ParallaxTexture { get; private set; } diff --git a/Content.Client/Research/LatheMenu.cs b/Content.Client/Research/LatheMenu.cs index bbb7407111..584e04562e 100644 --- a/Content.Client/Research/LatheMenu.cs +++ b/Content.Client/Research/LatheMenu.cs @@ -27,8 +27,8 @@ namespace Content.Client.Research public LatheBoundUserInterface Owner { get; set; } - private readonly List _recipes = new List(); - private readonly List _shownRecipes = new List(); + private readonly List _recipes = new(); + private readonly List _shownRecipes = new(); public LatheMenu(LatheBoundUserInterface owner = null) { diff --git a/Content.Client/Research/ResearchConsoleMenu.cs b/Content.Client/Research/ResearchConsoleMenu.cs index a17a20a2a8..e1b6da589a 100644 --- a/Content.Client/Research/ResearchConsoleMenu.cs +++ b/Content.Client/Research/ResearchConsoleMenu.cs @@ -18,9 +18,9 @@ namespace Content.Client.Research protected override Vector2? CustomSize => (800, 400); - private readonly List _unlockedTechnologyPrototypes = new List(); - private readonly List _unlockableTechnologyPrototypes = new List(); - private readonly List _futureTechnologyPrototypes = new List(); + private readonly List _unlockedTechnologyPrototypes = new(); + private readonly List _unlockableTechnologyPrototypes = new(); + private readonly List _futureTechnologyPrototypes = new(); private readonly Label _pointLabel; private readonly Label _pointsPerSecondLabel; diff --git a/Content.Client/ScreenshotHook.cs b/Content.Client/ScreenshotHook.cs index fb24833722..de977fe70a 100644 --- a/Content.Client/ScreenshotHook.cs +++ b/Content.Client/ScreenshotHook.cs @@ -15,7 +15,7 @@ namespace Content.Client { internal class ScreenshotHook : IScreenshotHook { - private static readonly ResourcePath BaseScreenshotPath = new ResourcePath("/Screenshots"); + private static readonly ResourcePath BaseScreenshotPath = new("/Screenshots"); [Dependency] private readonly IInputManager _inputManager = default; [Dependency] private readonly IClyde _clyde = default; diff --git a/Content.Client/State/MainMenu.cs b/Content.Client/State/MainMenu.cs index b5f7503f49..586ed284ec 100644 --- a/Content.Client/State/MainMenu.cs +++ b/Content.Client/State/MainMenu.cs @@ -40,7 +40,7 @@ namespace Content.Client.State private bool _isConnecting; // ReSharper disable once InconsistentNaming - private static readonly Regex IPv6Regex = new Regex(@"\[(.*:.*:.*)](?::(\d+))?"); + private static readonly Regex IPv6Regex = new(@"\[(.*:.*:.*)](?::(\d+))?"); /// public override void Startup() diff --git a/Content.Client/StationEvents/RadiationPulseOverlay.cs b/Content.Client/StationEvents/RadiationPulseOverlay.cs index 18db9fa121..d8094e3273 100644 --- a/Content.Client/StationEvents/RadiationPulseOverlay.cs +++ b/Content.Client/StationEvents/RadiationPulseOverlay.cs @@ -29,18 +29,18 @@ namespace Content.Client.StationEvents /// /// Current color of a pulse /// - private readonly Dictionary _colors = new Dictionary(); + private readonly Dictionary _colors = new(); /// /// Whether our alpha is increasing or decreasing and at what time does it flip (or stop) /// private readonly Dictionary _transitions = - new Dictionary(); + new(); /// /// How much the alpha changes per second for each pulse /// - private readonly Dictionary _alphaRateOfChange = new Dictionary(); + private readonly Dictionary _alphaRateOfChange = new(); private TimeSpan _lastTick; diff --git a/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs b/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs index 24b39739d6..5febcca1f2 100644 --- a/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs +++ b/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs @@ -33,30 +33,30 @@ namespace Content.Client.UserInterface.AdminMenu protected override Vector2? CustomSize => (500, 250); - private readonly List _adminButtons = new List + private readonly List _adminButtons = new() { new KickCommandButton(), new DirectCommandButton("Admin Ghost", "aghost"), new TeleportCommandButton(), }; - private readonly List _adminbusButtons = new List + private readonly List _adminbusButtons = new() { new SpawnEntitiesCommandButton(), new SpawnTilesCommandButton(), new StationEventsCommandButton(), }; - private readonly List _debugButtons = new List + private readonly List _debugButtons = new() { new AddAtmosCommandButton(), new FillGasCommandButton(), }; - private readonly List _roundButtons = new List + private readonly List _roundButtons = new() { new DirectCommandButton("Start Round", "startround"), new DirectCommandButton("End Round", "endround"), new DirectCommandButton("Restart Round", "restartround"), }; - private readonly List _serverButtons = new List + private readonly List _serverButtons = new() { new DirectCommandButton("Reboot", "restart"), new DirectCommandButton("Shutdown", "shutdown"), @@ -463,7 +463,7 @@ namespace Content.Client.UserInterface.AdminMenu public override string RequiredCommand => "events"; public override string? SubmitText => "Run"; - private readonly CommandUIDropDown _eventsDropDown = new CommandUIDropDown + private readonly CommandUIDropDown _eventsDropDown = new() { Name = "Event", GetData = () => @@ -478,7 +478,7 @@ namespace Content.Client.UserInterface.AdminMenu GetValueFromData = (obj) => ((string) obj).ToLower(), }; - public override List UI => new List + public override List UI => new() { _eventsDropDown, new CommandUIButton @@ -510,19 +510,19 @@ namespace Content.Client.UserInterface.AdminMenu public override string Name => "Kick"; public override string RequiredCommand => "kick"; - private readonly CommandUIDropDown _playerDropDown = new CommandUIDropDown + private readonly CommandUIDropDown _playerDropDown = new() { Name = "Player", GetData = () => IoCManager.Resolve().Sessions.ToList(), GetDisplayName = (obj) => $"{((IPlayerSession) obj).Name} ({((IPlayerSession) obj).AttachedEntity?.Name})", GetValueFromData = (obj) => ((IPlayerSession) obj).Name, }; - private readonly CommandUILineEdit _reason = new CommandUILineEdit + private readonly CommandUILineEdit _reason = new() { Name = "Reason" }; - public override List UI => new List + public override List UI => new() { _playerDropDown, _reason @@ -539,7 +539,7 @@ namespace Content.Client.UserInterface.AdminMenu public override string Name => "Teleport"; public override string RequiredCommand => "tpto"; - private readonly CommandUIDropDown _playerDropDown = new CommandUIDropDown + private readonly CommandUIDropDown _playerDropDown = new() { Name = "Player", GetData = () => IoCManager.Resolve().Sessions.ToList(), @@ -547,7 +547,7 @@ namespace Content.Client.UserInterface.AdminMenu GetValueFromData = (obj) => ((IPlayerSession) obj).Name, }; - public override List UI => new List + public override List UI => new() { _playerDropDown }; @@ -563,7 +563,7 @@ namespace Content.Client.UserInterface.AdminMenu public override string Name => "Add Atmos"; public override string RequiredCommand => "addatmos"; - private readonly CommandUIDropDown _grid = new CommandUIDropDown + private readonly CommandUIDropDown _grid = new() { Name = "Grid", GetData = () => IoCManager.Resolve().GetAllGrids().Where(g => (int) g.Index != 0).ToList(), @@ -571,7 +571,7 @@ namespace Content.Client.UserInterface.AdminMenu GetValueFromData = (obj) => ((IMapGrid) obj).Index.ToString(), }; - public override List UI => new List + public override List UI => new() { _grid, }; @@ -587,7 +587,7 @@ namespace Content.Client.UserInterface.AdminMenu public override string Name => "Fill Gas"; public override string RequiredCommand => "fillgas"; - private readonly CommandUIDropDown _grid = new CommandUIDropDown + private readonly CommandUIDropDown _grid = new() { Name = "Grid", GetData = () => IoCManager.Resolve().GetAllGrids().Where(g => (int) g.Index != 0).ToList(), @@ -595,7 +595,7 @@ namespace Content.Client.UserInterface.AdminMenu GetValueFromData = (obj) => ((IMapGrid) obj).Index.ToString(), }; - private readonly CommandUIDropDown _gas = new CommandUIDropDown + private readonly CommandUIDropDown _gas = new() { Name = "Gas", GetData = () => @@ -607,12 +607,12 @@ namespace Content.Client.UserInterface.AdminMenu GetValueFromData = (obj) => ((GasPrototype) obj).ID.ToString(), }; - private readonly CommandUISpinBox _amount = new CommandUISpinBox + private readonly CommandUISpinBox _amount = new() { Name = "Amount" }; - public override List UI => new List + public override List UI => new() { _grid, _gas, diff --git a/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs b/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs index e8f41156ea..b955ec5493 100644 --- a/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs +++ b/Content.Client/UserInterface/Cargo/CargoConsoleMenu.cs @@ -23,7 +23,7 @@ namespace Content.Client.UserInterface.Cargo public event Action OnOrderApproved; public event Action OnOrderCanceled; - private readonly List _categoryStrings = new List(); + private readonly List _categoryStrings = new(); private Label _accountNameLabel { get; set; } private Label _pointsLabel { get; set; } diff --git a/Content.Client/UserInterface/CreditsWindow.cs b/Content.Client/UserInterface/CreditsWindow.cs index c43271c270..215afc3938 100644 --- a/Content.Client/UserInterface/CreditsWindow.cs +++ b/Content.Client/UserInterface/CreditsWindow.cs @@ -20,7 +20,7 @@ namespace Content.Client.UserInterface { [Dependency] private readonly IResourceCache _resourceManager = default!; - private static readonly Dictionary PatronTierPriority = new Dictionary + private static readonly Dictionary PatronTierPriority = new() { ["Nuclear Operative"] = 1, ["Syndicate Agent"] = 2, diff --git a/Content.Client/UserInterface/GhostGui.cs b/Content.Client/UserInterface/GhostGui.cs index d2fbc68556..661e1c8313 100644 --- a/Content.Client/UserInterface/GhostGui.cs +++ b/Content.Client/UserInterface/GhostGui.cs @@ -10,8 +10,8 @@ namespace Content.Client.UserInterface { public class GhostGui : Control { - private readonly Button _returnToBody = new Button() {Text = Loc.GetString("Return to body")}; - private readonly Button _ghostWarp = new Button() {Text = Loc.GetString("Ghost Warp")}; + private readonly Button _returnToBody = new() {Text = Loc.GetString("Return to body")}; + private readonly Button _ghostWarp = new() {Text = Loc.GetString("Ghost Warp")}; private readonly GhostComponent _owner; public GhostGui(GhostComponent owner) diff --git a/Content.Client/UserInterface/HumanoidProfileEditor.cs b/Content.Client/UserInterface/HumanoidProfileEditor.cs index b6e36d23b7..c83c15fff6 100644 --- a/Content.Client/UserInterface/HumanoidProfileEditor.cs +++ b/Content.Client/UserInterface/HumanoidProfileEditor.cs @@ -25,7 +25,7 @@ namespace Content.Client.UserInterface { public partial class HumanoidProfileEditor : Control { - private static readonly StyleBoxFlat HighlightedStyle = new StyleBoxFlat + private static readonly StyleBoxFlat HighlightedStyle = new() { BackgroundColor = new Color(47, 47, 53), ContentMarginTopOverride = 10, diff --git a/Content.Client/UserInterface/ItemStatusPanel.cs b/Content.Client/UserInterface/ItemStatusPanel.cs index 67db77ae56..ca91e7ec0e 100644 --- a/Content.Client/UserInterface/ItemStatusPanel.cs +++ b/Content.Client/UserInterface/ItemStatusPanel.cs @@ -20,7 +20,7 @@ namespace Content.Client.UserInterface public class ItemStatusPanel : Control { [ViewVariables] - private readonly List<(IItemStatus, Control)> _activeStatusComponents = new List<(IItemStatus, Control)>(); + private readonly List<(IItemStatus, Control)> _activeStatusComponents = new(); [ViewVariables] private readonly Label _itemNameLabel; diff --git a/Content.Client/UserInterface/LateJoinGui.cs b/Content.Client/UserInterface/LateJoinGui.cs index 2f6e5b29c9..13eed2a6ab 100644 --- a/Content.Client/UserInterface/LateJoinGui.cs +++ b/Content.Client/UserInterface/LateJoinGui.cs @@ -26,7 +26,7 @@ namespace Content.Client.UserInterface public event Action SelectedId; - private readonly Dictionary _jobButtons = new Dictionary(); + private readonly Dictionary _jobButtons = new(); public LateJoinGui() { diff --git a/Content.Client/UserInterface/LobbyCharacterPreviewPanel.cs b/Content.Client/UserInterface/LobbyCharacterPreviewPanel.cs index 9aacc5e859..d3a94a1749 100644 --- a/Content.Client/UserInterface/LobbyCharacterPreviewPanel.cs +++ b/Content.Client/UserInterface/LobbyCharacterPreviewPanel.cs @@ -92,7 +92,7 @@ namespace Content.Client.UserInterface private static SpriteView MakeSpriteView(IEntity entity, Direction direction) { - return new SpriteView + return new() { Sprite = entity.GetComponent(), OverrideDirection = direction, diff --git a/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs b/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs index bf88e234be..ee4f6b1172 100644 --- a/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs +++ b/Content.Client/UserInterface/OptionsMenu.KeyRebind.cs @@ -20,7 +20,7 @@ namespace Content.Client.UserInterface private sealed class KeyRebindControl : Control { // List of key functions that must be registered as toggle instead. - private static readonly HashSet ToggleFunctions = new HashSet + private static readonly HashSet ToggleFunctions = new() { EngineKeyFunctions.ShowDebugMonitors, EngineKeyFunctions.HideUI, @@ -31,9 +31,9 @@ namespace Content.Client.UserInterface private BindButton? _currentlyRebinding; private readonly Dictionary _keyControls = - new Dictionary(); + new(); - private readonly List _deferCommands = new List(); + private readonly List _deferCommands = new(); public KeyRebindControl() { diff --git a/Content.Client/UserInterface/ParticleAccelerator/ParticleAcceleratorControlMenu.cs b/Content.Client/UserInterface/ParticleAccelerator/ParticleAcceleratorControlMenu.cs index 1e451e9bf9..bd3703dc19 100644 --- a/Content.Client/UserInterface/ParticleAccelerator/ParticleAcceleratorControlMenu.cs +++ b/Content.Client/UserInterface/ParticleAccelerator/ParticleAcceleratorControlMenu.cs @@ -355,7 +355,7 @@ namespace Content.Client.ParticleAccelerator PASegmentControl Segment(string name) { - return new PASegmentControl(this, resourceCache, name); + return new(this, resourceCache, name); } } diff --git a/Content.Client/UserInterface/Permissions/PermissionsEui.cs b/Content.Client/UserInterface/Permissions/PermissionsEui.cs index 6751962dc7..d6f8b7e190 100644 --- a/Content.Client/UserInterface/Permissions/PermissionsEui.cs +++ b/Content.Client/UserInterface/Permissions/PermissionsEui.cs @@ -27,10 +27,10 @@ namespace Content.Client.UserInterface.Permissions [Dependency] private readonly IClientAdminManager _adminManager = default!; private readonly Menu _menu; - private readonly List _subWindows = new List(); + private readonly List _subWindows = new(); private Dictionary _ranks = - new Dictionary(); + new(); public PermissionsEui() { @@ -348,7 +348,7 @@ namespace Content.Client.UserInterface.Permissions public readonly Button? RemoveButton; public readonly Dictionary FlagButtons - = new Dictionary(); + = new(); public EditAdminWindow(PermissionsEui ui, PermissionsEuiState.AdminData? data) { @@ -519,7 +519,7 @@ namespace Content.Client.UserInterface.Permissions public readonly LineEdit NameEdit; public readonly Button SaveButton; public readonly Button? RemoveButton; - public readonly Dictionary FlagCheckBoxes = new Dictionary(); + public readonly Dictionary FlagCheckBoxes = new(); public EditAdminRankWindow(PermissionsEui ui, KeyValuePair? data) { diff --git a/Content.IntegrationTests/DummyGameTicker.cs b/Content.IntegrationTests/DummyGameTicker.cs index c15a3482b4..55643ed677 100644 --- a/Content.IntegrationTests/DummyGameTicker.cs +++ b/Content.IntegrationTests/DummyGameTicker.cs @@ -75,7 +75,7 @@ namespace Content.IntegrationTests public T AddGameRule() where T : GameRule, new() { - return new T(); + return new(); } public bool HasGameRule(Type type) @@ -120,7 +120,7 @@ namespace Content.IntegrationTests public Dictionary GetAvailablePositions() { - return new Dictionary(); + return new(); } } } diff --git a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs index 063045ccc9..7393a3187f 100644 --- a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs +++ b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs @@ -433,7 +433,7 @@ namespace Content.IntegrationTests.Tests.Networking // Queue of all the events that come in so we can test that they come in perfectly as expected. public List<(GameTick tick, bool firstPredict, bool old, bool @new, bool value)> EventTriggerList { get; } = - new List<(GameTick, bool, bool, bool, bool)>(); + new(); [Dependency] private readonly IGameTiming _gameTiming = default!; diff --git a/Content.Server.Database/Model.cs b/Content.Server.Database/Model.cs index c52a41fc0c..39f80bec76 100644 --- a/Content.Server.Database/Model.cs +++ b/Content.Server.Database/Model.cs @@ -80,7 +80,7 @@ namespace Content.Server.Database [Column("preference_id")] public int Id { get; set; } [Column("user_id")] public Guid UserId { get; set; } [Column("selected_character_slot")] public int SelectedCharacterSlot { get; set; } - public List Profiles { get; } = new List(); + public List Profiles { get; } = new(); } [Table("profile")] @@ -97,8 +97,8 @@ namespace Content.Server.Database [Column("facial_hair_color")] public string FacialHairColor { get; set; } = null!; [Column("eye_color")] public string EyeColor { get; set; } = null!; [Column("skin_color")] public string SkinColor { get; set; } = null!; - public List Jobs { get; } = new List(); - public List Antags { get; } = new List(); + public List Jobs { get; } = new(); + public List Antags { get; } = new(); [Column("pref_unavailable")] public DbPreferenceUnavailableMode PreferenceUnavailable { get; set; } diff --git a/Content.Server/AI/Utility/AiLogic/UtilityAI.cs b/Content.Server/AI/Utility/AiLogic/UtilityAI.cs index f4b8107218..68343c4cc1 100644 --- a/Content.Server/AI/Utility/AiLogic/UtilityAI.cs +++ b/Content.Server/AI/Utility/AiLogic/UtilityAI.cs @@ -31,8 +31,8 @@ namespace Content.Server.AI.Utility.AiLogic /// /// The sum of all BehaviorSets gives us what actions the AI can take /// - public Dictionary BehaviorSets { get; } = new Dictionary(); - private readonly List _availableActions = new List(); + public Dictionary BehaviorSets { get; } = new(); + private readonly List _availableActions = new(); /// /// The currently running action; most importantly are the operators. diff --git a/Content.Server/AI/Utility/Considerations/ConsiderationsManager.cs b/Content.Server/AI/Utility/Considerations/ConsiderationsManager.cs index 9de6fc5af7..629da77df2 100644 --- a/Content.Server/AI/Utility/Considerations/ConsiderationsManager.cs +++ b/Content.Server/AI/Utility/Considerations/ConsiderationsManager.cs @@ -7,7 +7,7 @@ namespace Content.Server.AI.Utility.Considerations { public class ConsiderationsManager { - private readonly Dictionary _considerations = new Dictionary(); + private readonly Dictionary _considerations = new(); public void Initialize() { diff --git a/Content.Server/AI/WorldState/Blackboard.cs b/Content.Server/AI/WorldState/Blackboard.cs index 833e0a3bf5..0b7b2bd8f6 100644 --- a/Content.Server/AI/WorldState/Blackboard.cs +++ b/Content.Server/AI/WorldState/Blackboard.cs @@ -15,8 +15,8 @@ namespace Content.Server.AI.WorldState // This also stops you from re-writing the same boilerplate everywhere of stuff like "Do I have OuterClothing on?" - private readonly Dictionary _states = new Dictionary(); - private readonly List _planningStates = new List(); + private readonly Dictionary _states = new(); + private readonly List _planningStates = new(); public Blackboard(IEntity owner) { diff --git a/Content.Server/AI/WorldState/BlackboardManager.cs b/Content.Server/AI/WorldState/BlackboardManager.cs index a2cd836ff2..1e6d17a85d 100644 --- a/Content.Server/AI/WorldState/BlackboardManager.cs +++ b/Content.Server/AI/WorldState/BlackboardManager.cs @@ -14,7 +14,7 @@ namespace Content.Server.AI.WorldState { // Cache the known types public IReadOnlyCollection AiStates => _aiStates; - private readonly List _aiStates = new List(); + private readonly List _aiStates = new(); public void Initialize() { diff --git a/Content.Server/Administration/AdminManager.cs b/Content.Server/Administration/AdminManager.cs index 0ee2b7839d..11bdef4955 100644 --- a/Content.Server/Administration/AdminManager.cs +++ b/Content.Server/Administration/AdminManager.cs @@ -39,7 +39,7 @@ namespace Content.Server.Administration [Dependency] private readonly IConsoleShell _consoleShell = default!; [Dependency] private readonly IChatManager _chat = default!; - private readonly Dictionary _admins = new Dictionary(); + private readonly Dictionary _admins = new(); public event Action? OnPermsChanged; @@ -49,8 +49,8 @@ namespace Content.Server.Administration // If a command isn't in this list it's server-console only. // if a command is in but the flags value is null it's available to everybody. - private readonly HashSet _anyCommands = new HashSet(); - private readonly Dictionary _adminCommands = new Dictionary(); + private readonly HashSet _anyCommands = new(); + private readonly Dictionary _adminCommands = new(); public AdminData? GetAdminData(IPlayerSession session, bool includeDeAdmin = false) { diff --git a/Content.Server/Administration/PermissionsEui.cs b/Content.Server/Administration/PermissionsEui.cs index 2c5ba53b08..c59c35ebc0 100644 --- a/Content.Server/Administration/PermissionsEui.cs +++ b/Content.Server/Administration/PermissionsEui.cs @@ -26,7 +26,7 @@ namespace Content.Server.Administration private bool _isLoading; private readonly List<(Admin a, string? lastUserName)> _admins = new List<(Admin, string? lastUserName)>(); - private readonly List _adminRanks = new List(); + private readonly List _adminRanks = new(); public PermissionsEui() { diff --git a/Content.Server/Atmos/ExcitedGroup.cs b/Content.Server/Atmos/ExcitedGroup.cs index 8f110b7fbb..a8add3f1d0 100644 --- a/Content.Server/Atmos/ExcitedGroup.cs +++ b/Content.Server/Atmos/ExcitedGroup.cs @@ -12,7 +12,7 @@ namespace Content.Server.Atmos private bool _disposed = false; [ViewVariables] - private readonly HashSet _tiles = new HashSet(); + private readonly HashSet _tiles = new(); [ViewVariables] private GridAtmosphereComponent _gridAtmosphereComponent; diff --git a/Content.Server/Atmos/GasMixture.cs b/Content.Server/Atmos/GasMixture.cs index 8035e32a65..a22d22bfb0 100644 --- a/Content.Server/Atmos/GasMixture.cs +++ b/Content.Server/Atmos/GasMixture.cs @@ -23,7 +23,7 @@ namespace Content.Server.Atmos { private readonly AtmosphereSystem _atmosphereSystem; - public static GasMixture SpaceGas => new GasMixture() {Volume = 2500f, Immutable = true, Temperature = Atmospherics.TCMB}; + public static GasMixture SpaceGas => new() {Volume = 2500f, Immutable = true, Temperature = Atmospherics.TCMB}; // This must always have a length that is a multiple of 4 for SIMD acceleration. [ViewVariables] @@ -44,7 +44,7 @@ namespace Content.Server.Atmos public float LastShare { get; private set; } = 0; [ViewVariables] - public readonly Dictionary ReactionResults = new Dictionary() + public readonly Dictionary ReactionResults = new() { // We initialize the dictionary here. { GasReaction.Fire, 0f } diff --git a/Content.Server/Atmos/TileAtmosphere.cs b/Content.Server/Atmos/TileAtmosphere.cs index 2ecb268be0..c268521d8e 100644 --- a/Content.Server/Atmos/TileAtmosphere.cs +++ b/Content.Server/Atmos/TileAtmosphere.cs @@ -36,7 +36,7 @@ namespace Content.Server.Atmos private readonly GridTileLookupSystem _gridTileLookupSystem = default!; - private static readonly TileAtmosphereComparer Comparer = new TileAtmosphereComparer(); + private static readonly TileAtmosphereComparer Comparer = new(); [ViewVariables] private int _archivedCycle; [ViewVariables] private int _currentCycle; diff --git a/Content.Server/Cargo/CargoOrderDataManager.cs b/Content.Server/Cargo/CargoOrderDataManager.cs index fe169ab26d..8665b597ed 100644 --- a/Content.Server/Cargo/CargoOrderDataManager.cs +++ b/Content.Server/Cargo/CargoOrderDataManager.cs @@ -6,8 +6,8 @@ namespace Content.Server.Cargo { public class CargoOrderDataManager : ICargoOrderDataManager { - private readonly Dictionary _accounts = new Dictionary(); - private readonly List _components = new List(); + private readonly Dictionary _accounts = new(); + private readonly List _components = new(); public CargoOrderDataManager() { diff --git a/Content.Server/Cargo/CargoOrderDatabase.cs b/Content.Server/Cargo/CargoOrderDatabase.cs index 9c4f362273..6698b65203 100644 --- a/Content.Server/Cargo/CargoOrderDatabase.cs +++ b/Content.Server/Cargo/CargoOrderDatabase.cs @@ -7,7 +7,7 @@ namespace Content.Server.Cargo { public class CargoOrderDatabase { - private readonly Dictionary _orders = new Dictionary(); + private readonly Dictionary _orders = new(); private int _orderNumber = 0; public CargoOrderDatabase(int id) diff --git a/Content.Server/Database/ServerDbSqlite.cs b/Content.Server/Database/ServerDbSqlite.cs index 23433c9257..a51484a288 100644 --- a/Content.Server/Database/ServerDbSqlite.cs +++ b/Content.Server/Database/ServerDbSqlite.cs @@ -23,7 +23,7 @@ namespace Content.Server.Database // For SQLite we use a single DB context via SQLite. // This doesn't allow concurrent access so that's what the semaphore is for. // That said, this is bloody SQLite, I don't even think EFCore bothers to truly async it. - private readonly SemaphoreSlim _prefsSemaphore = new SemaphoreSlim(1, 1); + private readonly SemaphoreSlim _prefsSemaphore = new(1, 1); private readonly Task _dbReadyTask; private readonly SqliteServerDbContext _prefsCtx; diff --git a/Content.Server/DeviceNetwork/DeviceNetwork.cs b/Content.Server/DeviceNetwork/DeviceNetwork.cs index 06a9f4e054..d9d4688d38 100644 --- a/Content.Server/DeviceNetwork/DeviceNetwork.cs +++ b/Content.Server/DeviceNetwork/DeviceNetwork.cs @@ -14,8 +14,8 @@ namespace Content.Server.GameObjects.EntitySystems.DeviceNetwork [Dependency] private readonly IRobustRandom _random = default!; - private readonly Dictionary> _devices = new Dictionary>(); - private readonly Queue _packages = new Queue(); + private readonly Dictionary> _devices = new(); + private readonly Queue _packages = new(); /// public DeviceNetworkConnection Register(int netId, int frequency, OnReceiveNetMessage messageHandler, bool receiveAll = false) diff --git a/Content.Server/Eui/EuiManager.cs b/Content.Server/Eui/EuiManager.cs index b5a8ae2a87..b417e76f0c 100644 --- a/Content.Server/Eui/EuiManager.cs +++ b/Content.Server/Eui/EuiManager.cs @@ -19,7 +19,7 @@ namespace Content.Server.Eui [Dependency] private readonly IServerNetManager _net = default!; private readonly Dictionary _playerData = - new Dictionary(); + new(); private readonly Queue<(IPlayerSession player, uint id)> _stateUpdateQueue = new Queue<(IPlayerSession, uint id)>(); @@ -27,7 +27,7 @@ namespace Content.Server.Eui private sealed class PlayerEuiData { public uint NextId = 1; - public readonly Dictionary OpenUIs = new Dictionary(); + public readonly Dictionary OpenUIs = new(); } void IPostInjectInit.PostInject() diff --git a/Content.Server/GameObjects/Components/Access/AccessComponent.cs b/Content.Server/GameObjects/Components/Access/AccessComponent.cs index 101f215c15..ad3d1f21a1 100644 --- a/Content.Server/GameObjects/Components/Access/AccessComponent.cs +++ b/Content.Server/GameObjects/Components/Access/AccessComponent.cs @@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.Components.Access public override string Name => "Access"; [ViewVariables] - private readonly HashSet _tags = new HashSet(); + private readonly HashSet _tags = new(); public ISet Tags => _tags; public bool IsReadOnly => false; diff --git a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs index c861074d34..5b0046ff20 100644 --- a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs +++ b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs @@ -25,8 +25,8 @@ namespace Content.Server.GameObjects.Components.Access { public override string Name => "AccessReader"; - private readonly List> _accessLists = new List>(); - private readonly HashSet _denyTags = new HashSet(); + private readonly List> _accessLists = new(); + private readonly HashSet _denyTags = new(); /// /// List of access lists to check allowed against. For an access check to pass diff --git a/Content.Server/GameObjects/Components/Arcade/BlockGameArcadeComponent.cs b/Content.Server/GameObjects/Components/Arcade/BlockGameArcadeComponent.cs index 681187f7c0..707076ac21 100644 --- a/Content.Server/GameObjects/Components/Arcade/BlockGameArcadeComponent.cs +++ b/Content.Server/GameObjects/Components/Arcade/BlockGameArcadeComponent.cs @@ -39,7 +39,7 @@ namespace Content.Server.GameObjects.Components.Arcade private BlockGame? _game; private IPlayerSession? _player; - private readonly List _spectators = new List(); + private readonly List _spectators = new(); public void Activate(ActivateEventArgs eventArgs) { @@ -166,7 +166,7 @@ namespace Content.Server.GameObjects.Components.Arcade private readonly BlockGameArcadeComponent _component; - private readonly List _field = new List(); + private readonly List _field = new(); private BlockGamePiece _currentPiece; @@ -733,7 +733,7 @@ namespace Content.Server.GameObjects.Components.Arcade private readonly BlockGamePieceType[] _allBlockGamePieces; - private List _blockGamePiecesBuffer = new List(); + private List _blockGamePiecesBuffer = new(); private BlockGamePiece GetRandomBlockGamePiece(IRobustRandom random) { diff --git a/Content.Server/GameObjects/Components/Arcade/SpaceVillainArcadeComponent.cs b/Content.Server/GameObjects/Components/Arcade/SpaceVillainArcadeComponent.cs index ebaa59b164..285ad7c4c3 100644 --- a/Content.Server/GameObjects/Components/Arcade/SpaceVillainArcadeComponent.cs +++ b/Content.Server/GameObjects/Components/Arcade/SpaceVillainArcadeComponent.cs @@ -429,7 +429,7 @@ namespace Content.Server.GameObjects.Components.Arcade /// A Metadata-message. public SpaceVillainArcadeMetaDataUpdateMessage GenerateMetaDataMessage() { - return new SpaceVillainArcadeMetaDataUpdateMessage(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage, _latestEnemyActionMessage, Name, _enemyName, !_running); + return new(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage, _latestEnemyActionMessage, Name, _enemyName, !_running); } /// @@ -439,7 +439,7 @@ namespace Content.Server.GameObjects.Components.Arcade public SpaceVillainArcadeDataUpdateMessage GenerateUpdateMessage() { - return new SpaceVillainArcadeDataUpdateMessage(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage, + return new(_playerHp, _playerMp, _enemyHp, _enemyMp, _latestPlayerActionMessage, _latestEnemyActionMessage); } } diff --git a/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs b/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs index a687edc752..5eda5aa53d 100644 --- a/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs @@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Atmos public class FlammableComponent : SharedFlammableComponent, ICollideBehavior, IFireAct, IReagentReaction { private bool _resisting = false; - private readonly List _collided = new List(); + private readonly List _collided = new(); [ViewVariables(VVAccess.ReadWrite)] public bool OnFire { get; private set; } diff --git a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs index e07f6b6b08..b18fb84f90 100644 --- a/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/GridAtmosphereComponent.cs @@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Atmos private bool _paused = false; private float _timer = 0f; - private Stopwatch _stopwatch = new Stopwatch(); + private Stopwatch _stopwatch = new(); private GridId _gridId; [ComponentDependency] private IMapGridComponent? _mapGridComponent = default!; @@ -75,7 +75,7 @@ namespace Content.Server.GameObjects.Components.Atmos private double _tileEqualizeLastProcess; [ViewVariables] - private readonly HashSet _excitedGroups = new HashSet(1000); + private readonly HashSet _excitedGroups = new(1000); [ViewVariables] private int ExcitedGroupCount => _excitedGroups.Count; @@ -84,10 +84,10 @@ namespace Content.Server.GameObjects.Components.Atmos private double _excitedGroupLastProcess; [ViewVariables] - protected readonly Dictionary Tiles = new Dictionary(1000); + protected readonly Dictionary Tiles = new(1000); [ViewVariables] - private readonly HashSet _activeTiles = new HashSet(1000); + private readonly HashSet _activeTiles = new(1000); [ViewVariables] private int ActiveTilesCount => _activeTiles.Count; @@ -96,7 +96,7 @@ namespace Content.Server.GameObjects.Components.Atmos private double _activeTilesLastProcess; [ViewVariables] - private readonly HashSet _hotspotTiles = new HashSet(1000); + private readonly HashSet _hotspotTiles = new(1000); [ViewVariables] private int HotspotTilesCount => _hotspotTiles.Count; @@ -105,7 +105,7 @@ namespace Content.Server.GameObjects.Components.Atmos private double _hotspotsLastProcess; [ViewVariables] - private readonly HashSet _superconductivityTiles = new HashSet(1000); + private readonly HashSet _superconductivityTiles = new(1000); [ViewVariables] private int SuperconductivityTilesCount => _superconductivityTiles.Count; @@ -114,13 +114,13 @@ namespace Content.Server.GameObjects.Components.Atmos private double _superconductivityLastProcess; [ViewVariables] - private readonly HashSet _invalidatedCoords = new HashSet(1000); + private readonly HashSet _invalidatedCoords = new(1000); [ViewVariables] private int InvalidatedCoordsCount => _invalidatedCoords.Count; [ViewVariables] - private HashSet _highPressureDelta = new HashSet(1000); + private HashSet _highPressureDelta = new(1000); [ViewVariables] private int HighPressureDeltaCount => _highPressureDelta.Count; @@ -129,28 +129,28 @@ namespace Content.Server.GameObjects.Components.Atmos private double _highPressureDeltaLastProcess; [ViewVariables] - private readonly HashSet _pipeNets = new HashSet(); + private readonly HashSet _pipeNets = new(); [ViewVariables] private double _pipeNetLastProcess; [ViewVariables] - private readonly HashSet _pipeNetDevices = new HashSet(); + private readonly HashSet _pipeNetDevices = new(); [ViewVariables] private double _pipeNetDevicesLastProcess; [ViewVariables] - private Queue _currentRunTiles = new Queue(); + private Queue _currentRunTiles = new(); [ViewVariables] - private Queue _currentRunExcitedGroups = new Queue(); + private Queue _currentRunExcitedGroups = new(); [ViewVariables] - private Queue _currentRunPipeNet = new Queue(); + private Queue _currentRunPipeNet = new(); [ViewVariables] - private Queue _currentRunPipeNetDevice = new Queue(); + private Queue _currentRunPipeNetDevice = new(); [ViewVariables] private ProcessState _state = ProcessState.TileEqualize; diff --git a/Content.Server/GameObjects/Components/Atmos/SpaceGridAtmosphereComponent.cs b/Content.Server/GameObjects/Components/Atmos/SpaceGridAtmosphereComponent.cs index 5ccea7ba4e..8d67afc946 100644 --- a/Content.Server/GameObjects/Components/Atmos/SpaceGridAtmosphereComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/SpaceGridAtmosphereComponent.cs @@ -20,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Atmos public override TileAtmosphere? GetTile(Vector2i indices, bool createSpace = true) { - return new TileAtmosphere(this, GridId.Invalid, indices, new GasMixture(2500, AtmosphereSystem), true); + return new(this, GridId.Invalid, indices, new GasMixture(2500, AtmosphereSystem), true); } protected override IEnumerable GetObstructingComponents(Vector2i indices) diff --git a/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs b/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs index 6bb18a8a89..54082b4599 100644 --- a/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs +++ b/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs @@ -103,7 +103,7 @@ namespace Content.Server.GameObjects.Components.Body.Behavior /// Used to track how long each reagent has been in the stomach /// [ViewVariables] - private readonly List _reagentDeltas = new List(); + private readonly List _reagentDeltas = new(); public override void ExposeData(ObjectSerializer serializer) { diff --git a/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs b/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs index a21d842ac6..6eb4b53203 100644 --- a/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs +++ b/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs @@ -62,7 +62,7 @@ namespace Content.Server.GameObjects.Components.Body /// private BodyScannerUIState InterfaceState(IBody body) { - return new BodyScannerUIState(body.Owner.Uid); + return new(body.Owner.Uid); } } } diff --git a/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs b/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs index daa7a9c1bc..13fec9b2ad 100644 --- a/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs +++ b/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs @@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.Components.Body.Part [ComponentReference(typeof(IBodyPart))] public class BodyPartComponent : SharedBodyPartComponent, IAfterInteract { - private readonly Dictionary _optionsCache = new Dictionary(); + private readonly Dictionary _optionsCache = new(); private IBody? _owningBodyCache; private int _idHash; private IEntity? _surgeonCache; diff --git a/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs b/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs index 17f812e673..afa088a27c 100644 --- a/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs +++ b/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs @@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Body public override string Name => "SurgeryTool"; public override uint? NetID => ContentNetIDs.SURGERY; - private readonly Dictionary _optionsCache = new Dictionary(); + private readonly Dictionary _optionsCache = new(); private float _baseOperateTime; diff --git a/Content.Server/GameObjects/Components/Chemistry/ChemMasterComponent.cs b/Content.Server/GameObjects/Components/Chemistry/ChemMasterComponent.cs index 0a01675db9..8a80d98b7a 100644 --- a/Content.Server/GameObjects/Components/Chemistry/ChemMasterComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/ChemMasterComponent.cs @@ -48,7 +48,7 @@ namespace Content.Server.GameObjects.Components.Chemistry [ViewVariables] private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered; - [ViewVariables] private readonly SolutionContainerComponent BufferSolution = new SolutionContainerComponent(); + [ViewVariables] private readonly SolutionContainerComponent BufferSolution = new(); [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(ChemMasterUiKey.Key); diff --git a/Content.Server/GameObjects/Components/ConfigurationComponent.cs b/Content.Server/GameObjects/Components/ConfigurationComponent.cs index 7966c30815..a7e7e4f6b4 100644 --- a/Content.Server/GameObjects/Components/ConfigurationComponent.cs +++ b/Content.Server/GameObjects/Components/ConfigurationComponent.cs @@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components [ViewVariables] private BoundUserInterface UserInterface => Owner.GetUIOrNull(ConfigurationUiKey.Key); [ViewVariables] - private readonly Dictionary _config = new Dictionary(); + private readonly Dictionary _config = new(); private Regex _validation; diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index 0e88104614..9a1d9b3120 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -41,7 +41,7 @@ namespace Content.Server.GameObjects.Components.Construction private string _startingNodeIdentifier = string.Empty; [ViewVariables] - private HashSet _containers = new HashSet(); + private HashSet _containers = new(); [ViewVariables] private List>? _edgeNestedStepProgress = null; diff --git a/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs b/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs index 07ee5cc17f..85588e3981 100644 --- a/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs @@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Damage private ActSystem _actSystem; public override List SupportedDamageStates => - new List {DamageState.Alive, DamageState.Dead}; + new() {DamageState.Alive, DamageState.Dead}; void IExAct.OnExplosion(ExplosionEventArgs eventArgs) { diff --git a/Content.Server/GameObjects/Components/Damage/DamageOnToolInteractComponent.cs b/Content.Server/GameObjects/Components/Damage/DamageOnToolInteractComponent.cs index 6a8c680fd6..1781dcf8d9 100644 --- a/Content.Server/GameObjects/Components/Damage/DamageOnToolInteractComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DamageOnToolInteractComponent.cs @@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.Components.Damage /* Set in YAML */ protected int Damage; - private List _tools = new List(); + private List _tools = new(); public override void ExposeData(ObjectSerializer serializer) { diff --git a/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs b/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs index bcdf22f8d0..8cd2ad426a 100644 --- a/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs @@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.Components.Damage protected string DestroySoundCollection { get; private set; } public override List SupportedDamageStates => - new List {DamageState.Alive, DamageState.Dead}; + new() {DamageState.Alive, DamageState.Dead}; public override void ExposeData(ObjectSerializer serializer) { diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalHolderComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalHolderComponent.cs index c29c9088f9..18525da18b 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalHolderComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalHolderComponent.cs @@ -47,7 +47,7 @@ namespace Content.Server.GameObjects.Components.Disposal /// A list of tags attached to the content, used for sorting /// [ViewVariables] - public HashSet Tags { get; set; } = new HashSet(); + public HashSet Tags { get; set; } = new(); private bool CanInsert(IEntity entity) { diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs index ecf61a7655..0ff6193b43 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalMailingUnitComponent.cs @@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Disposal [ViewVariables] private TimeSpan _lastExitAttempt; - public static readonly Regex TagRegex = new Regex("^[a-zA-Z0-9, ]*$", RegexOptions.Compiled); + public static readonly Regex TagRegex = new("^[a-zA-Z0-9, ]*$", RegexOptions.Compiled); /// /// The current pressure of this disposal unit. @@ -101,7 +101,7 @@ namespace Content.Server.GameObjects.Components.Disposal [ViewVariables] public IReadOnlyList ContainedEntities => _container.ContainedEntities; [ViewVariables] - private readonly List _targetList = new List(); + private readonly List _targetList = new(); [ViewVariables] private string _target = ""; diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalRouterComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalRouterComponent.cs index 6416eab035..6e62479d38 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalRouterComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalRouterComponent.cs @@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Disposal public override string Name => "DisposalRouter"; [ViewVariables] - private readonly HashSet _tags = new HashSet(); + private readonly HashSet _tags = new(); [ViewVariables] public bool Anchored => diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalTaggerComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalTaggerComponent.cs index 63d91085e1..e3bc82e674 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalTaggerComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalTaggerComponent.cs @@ -107,7 +107,7 @@ namespace Content.Server.GameObjects.Components.Disposal /// Returns a private DisposalTaggerUserInterfaceState GetUserInterfaceState() { - return new DisposalTaggerUserInterfaceState(_tag); + return new(_tag); } private void UpdateUserInterface() diff --git a/Content.Server/GameObjects/Components/DoAfterComponent.cs b/Content.Server/GameObjects/Components/DoAfterComponent.cs index 1fe5f2712e..da6f45f539 100644 --- a/Content.Server/GameObjects/Components/DoAfterComponent.cs +++ b/Content.Server/GameObjects/Components/DoAfterComponent.cs @@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.Components public sealed class DoAfterComponent : SharedDoAfterComponent { public IReadOnlyCollection DoAfters => _doAfters.Keys; - private readonly Dictionary _doAfters = new Dictionary(); + private readonly Dictionary _doAfters = new(); // So the client knows which one to update (and so we don't send all of the do_afters every time 1 updates) // we'll just send them the index. Doesn't matter if it wraps around. diff --git a/Content.Server/GameObjects/Components/Doors/AirlockComponent.cs b/Content.Server/GameObjects/Components/Doors/AirlockComponent.cs index 6f0f536e2f..6f77b8bee5 100644 --- a/Content.Server/GameObjects/Components/Doors/AirlockComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/AirlockComponent.cs @@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Doors /// private static readonly TimeSpan PowerWiresTimeout = TimeSpan.FromSeconds(5.0); - private CancellationTokenSource _powerWiresPulsedTimerCancel = new CancellationTokenSource(); + private CancellationTokenSource _powerWiresPulsedTimerCancel = new(); private bool _powerWiresPulsed; diff --git a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs index f472399261..641eb2a253 100644 --- a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs @@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Doors [ViewVariables(VVAccess.ReadWrite)] protected float CloseSpeed = AutoCloseDelay; - private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); + private readonly CancellationTokenSource _cancellationTokenSource = new(); protected virtual TimeSpan CloseTimeOne => TimeSpan.FromSeconds(0.3f); protected virtual TimeSpan CloseTimeTwo => TimeSpan.FromSeconds(0.9f); diff --git a/Content.Server/GameObjects/Components/GUI/HandsComponent.cs b/Content.Server/GameObjects/Components/GUI/HandsComponent.cs index f80898d3b7..7be23be0e4 100644 --- a/Content.Server/GameObjects/Components/GUI/HandsComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/HandsComponent.cs @@ -55,7 +55,7 @@ namespace Content.Server.GameObjects.Components.GUI } } - [ViewVariables] private readonly List _hands = new List(); + [ViewVariables] private readonly List _hands = new(); public IEnumerable Hands => _hands.Select(h => h.Name); @@ -744,7 +744,7 @@ namespace Content.Server.GameObjects.Components.GUI public SharedHand ToShared(int index, HandLocation location) { - return new SharedHand(index, Name, Entity?.Uid, location, Enabled); + return new(index, Name, Entity?.Uid, location, Enabled); } } diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index 6931a74617..3de18229ef 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.Components.GUI [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; [ViewVariables] - private readonly Dictionary _slotContainers = new Dictionary(); + private readonly Dictionary _slotContainers = new(); private KeyValuePair? _hoverEntity; diff --git a/Content.Server/GameObjects/Components/Headset/HeadsetComponent.cs b/Content.Server/GameObjects/Components/Headset/HeadsetComponent.cs index 5be87b0047..c31a79bd07 100644 --- a/Content.Server/GameObjects/Components/Headset/HeadsetComponent.cs +++ b/Content.Server/GameObjects/Components/Headset/HeadsetComponent.cs @@ -28,7 +28,7 @@ namespace Content.Server.GameObjects.Components.Headset private RadioSystem _radioSystem = default!; - private List _channels = new List(); + private List _channels = new(); [ViewVariables(VVAccess.ReadWrite)] private int BroadcastFrequency { get; set; } diff --git a/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs b/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs index 6fa92fa82e..2958f649ff 100644 --- a/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs @@ -22,7 +22,7 @@ namespace Content.Server.GameObjects.Components.Interactable [RegisterComponent] public class ExpendableLightComponent : SharedExpendableLightComponent, IUse { - private static readonly AudioParams LoopedSoundParams = new AudioParams(0, 1, "Master", 62.5f, 1, AudioMixTarget.Stereo, true, 0.3f); + private static readonly AudioParams LoopedSoundParams = new(0, 1, "Master", 62.5f, 1, AudioMixTarget.Stereo, true, 0.3f); /// /// Status of light, whether or not it is emitting light. diff --git a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs index 5c303b6e7b..c3aa94e270 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs @@ -44,7 +44,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage private bool _storageInitialCalculated; private int _storageUsed; private int _storageCapacityMax; - public readonly HashSet SubscribedSessions = new HashSet(); + public readonly HashSet SubscribedSessions = new(); [ViewVariables] public override IReadOnlyList? StoredEntities => _storage?.ContainedEntities; diff --git a/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs b/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs index 052976632c..07f7f29a39 100644 --- a/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/ConditionalSpawnerComponent.cs @@ -24,10 +24,10 @@ namespace Content.Server.GameObjects.Components.Markers public override string Name => "ConditionalSpawner"; [ViewVariables(VVAccess.ReadWrite)] - public List Prototypes { get; set; } = new List(); + public List Prototypes { get; set; } = new(); [ViewVariables(VVAccess.ReadWrite)] - private readonly List _gameRules = new List(); + private readonly List _gameRules = new(); [ViewVariables(VVAccess.ReadWrite)] public float Chance { get; set; } = 1.0f; diff --git a/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs b/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs index 7d96681a10..46d50ca25f 100644 --- a/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/TimedSpawnerComponent.cs @@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Markers public override string Name => "TimedSpawner"; [ViewVariables(VVAccess.ReadWrite)] - public List Prototypes { get; set; } = new List(); + public List Prototypes { get; set; } = new(); [ViewVariables(VVAccess.ReadWrite)] public float Chance { get; set; } = 1.0f; diff --git a/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs b/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs index d56a712e80..8392dfa84f 100644 --- a/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs +++ b/Content.Server/GameObjects/Components/Markers/TrashSpawnerComponent.cs @@ -19,10 +19,10 @@ namespace Content.Server.GameObjects.Components.Markers public override string Name => "TrashSpawner"; [ViewVariables(VVAccess.ReadWrite)] - public List RarePrototypes { get; set; } = new List(); + public List RarePrototypes { get; set; } = new(); [ViewVariables(VVAccess.ReadWrite)] - private List _gameRules = new List(); + private List _gameRules = new(); [ViewVariables(VVAccess.ReadWrite)] public float RareChance { get; set; } = 0.05f; diff --git a/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs b/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs index ce53a5f9f2..a7381ef05e 100644 --- a/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs +++ b/Content.Server/GameObjects/Components/Medical/MedicalScannerComponent.cs @@ -42,7 +42,7 @@ namespace Content.Server.GameObjects.Components.Medical private TimeSpan _lastInternalOpenAttempt; private ContainerSlot _bodyContainer = default!; - private readonly Vector2 _ejectOffset = new Vector2(0f, 0f); + private readonly Vector2 _ejectOffset = new(0f, 0f); [ViewVariables] private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered; @@ -95,7 +95,7 @@ namespace Content.Server.GameObjects.Components.Medical } private static readonly MedicalScannerBoundUserInterfaceState EmptyUIState = - new MedicalScannerBoundUserInterfaceState( + new( null, new Dictionary(), new Dictionary(), diff --git a/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs b/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs index 2c6a52d00f..348f53dbc8 100644 --- a/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs +++ b/Content.Server/GameObjects/Components/Metabolism/MetabolismComponent.cs @@ -43,11 +43,11 @@ namespace Content.Server.GameObjects.Components.Metabolism [ViewVariables(VVAccess.ReadWrite)] private int _suffocationDamage; - [ViewVariables] public Dictionary NeedsGases { get; set; } = new Dictionary(); + [ViewVariables] public Dictionary NeedsGases { get; set; } = new(); - [ViewVariables] public Dictionary ProducesGases { get; set; } = new Dictionary(); + [ViewVariables] public Dictionary ProducesGases { get; set; } = new(); - [ViewVariables] public Dictionary DeficitGases { get; set; } = new Dictionary(); + [ViewVariables] public Dictionary DeficitGases { get; set; } = new(); /// /// Heat generated due to metabolism. It's generated via metabolism diff --git a/Content.Server/GameObjects/Components/Mobs/ServerOverlayEffectsComponent.cs b/Content.Server/GameObjects/Components/Mobs/ServerOverlayEffectsComponent.cs index 20a284d90b..6b0c7214f4 100644 --- a/Content.Server/GameObjects/Components/Mobs/ServerOverlayEffectsComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/ServerOverlayEffectsComponent.cs @@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Mobs } [ViewVariables(VVAccess.ReadWrite)] - public List ActiveOverlays { get; } = new List(); + public List ActiveOverlays { get; } = new(); public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel, ICommonSession session = null) { diff --git a/Content.Server/GameObjects/Components/Mobs/Speech/AccentManager.cs b/Content.Server/GameObjects/Components/Mobs/Speech/AccentManager.cs index 845f6cfe92..804aee06e1 100644 --- a/Content.Server/GameObjects/Components/Mobs/Speech/AccentManager.cs +++ b/Content.Server/GameObjects/Components/Mobs/Speech/AccentManager.cs @@ -15,7 +15,7 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech [Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly IComponentManager _componentManager = default!; - public static readonly Regex SentenceRegex = new Regex(@"(?<=[\.!\?])"); + public static readonly Regex SentenceRegex = new(@"(?<=[\.!\?])"); public void Initialize() { diff --git a/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs b/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs index 7f9a1be823..af6e60c33c 100644 --- a/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/Speech/OwOAccentComponent.cs @@ -18,7 +18,7 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech }.AsReadOnly(); private string RandomFace => _random.Pick(Faces); - private static readonly Dictionary SpecialWords = new Dictionary + private static readonly Dictionary SpecialWords = new() { { "you", "wu" }, }; diff --git a/Content.Server/GameObjects/Components/Mobs/State/MobStateManager.cs b/Content.Server/GameObjects/Components/Mobs/State/MobStateManager.cs index d315ed1b0e..0c8eaa8b3e 100644 --- a/Content.Server/GameObjects/Components/Mobs/State/MobStateManager.cs +++ b/Content.Server/GameObjects/Components/Mobs/State/MobStateManager.cs @@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.Components.Mobs.State [ComponentReference(typeof(SharedMobStateManagerComponent))] public class MobStateManagerComponent : SharedMobStateManagerComponent { - private readonly Dictionary _behavior = new Dictionary + private readonly Dictionary _behavior = new() { {DamageState.Alive, new NormalState()}, {DamageState.Critical, new CriticalState()}, diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeContainerComponent.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeContainerComponent.cs index 23a2d1be45..73d75455f6 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeContainerComponent.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeContainerComponent.cs @@ -16,7 +16,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer [ViewVariables] public IReadOnlyList Nodes => _nodes; - private List _nodes = new List(); + private List _nodes = new(); public override void ExposeData(ObjectSerializer serializer) { diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/AMENodeGroup.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/AMENodeGroup.cs index 2574a294bd..f65c689253 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/AMENodeGroup.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/AMENodeGroup.cs @@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups public AMEControllerComponent MasterController => _masterController; - private readonly List _cores = new List(); + private readonly List _cores = new(); public int CoreCount => _cores.Count; diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/ApcNetNodeGroup.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/ApcNetNodeGroup.cs index b08f621bae..93da4c630c 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/ApcNetNodeGroup.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/ApcNetNodeGroup.cs @@ -26,10 +26,10 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups public class ApcNetNodeGroup : BaseNetConnectorNodeGroup, IApcNet { [ViewVariables] - private readonly Dictionary _apcBatteries = new Dictionary(); + private readonly Dictionary _apcBatteries = new(); [ViewVariables] - private readonly Dictionary> _providerReceivers = new Dictionary>(); + private readonly Dictionary> _providerReceivers = new(); //Debug property [ViewVariables] diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/BaseNetConnectorNodeGroup.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/BaseNetConnectorNodeGroup.cs index 58a07022e7..c4b2bea708 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/BaseNetConnectorNodeGroup.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/BaseNetConnectorNodeGroup.cs @@ -7,7 +7,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups { public abstract class BaseNetConnectorNodeGroup : BaseNodeGroup where TNetConnector : BaseNetConnectorComponent { - private readonly Dictionary> _netConnectorComponents = new Dictionary>(); + private readonly Dictionary> _netConnectorComponents = new(); protected override void OnAddNode(Node node) { diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroup.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroup.cs index c193922a7b..6f6f18b381 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroup.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroup.cs @@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups { [ViewVariables] public IReadOnlyList Nodes => _nodes; - private readonly List _nodes = new List(); + private readonly List _nodes = new(); [ViewVariables] public int NodeCount => Nodes.Count; @@ -104,7 +104,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups private class NullNodeGroup : INodeGroup { public IReadOnlyList Nodes => _nodes; - private readonly List _nodes = new List(); + private readonly List _nodes = new(); public void Initialize(Node sourceNode) { } public void AddNode(Node node) { } public void CombineGroup(INodeGroup newGroup) { } diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroupManager.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroupManager.cs index 762752fb78..203d65e98f 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroupManager.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/INodeGroupManager.cs @@ -18,7 +18,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups public class NodeGroupManager : INodeGroupManager { - private readonly HashSet _dirtyNodeGroups = new HashSet(); + private readonly HashSet _dirtyNodeGroups = new(); public void AddDirtyNodeGroup(INodeGroup nodeGroup) { diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/IPipeNet.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/IPipeNet.cs index e9fc5c16f2..e5e4a97066 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/IPipeNet.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/IPipeNet.cs @@ -20,12 +20,12 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups public class PipeNet : BaseNodeGroup, IPipeNet { [ViewVariables] - public GasMixture Air { get; set; } = new GasMixture(); + public GasMixture Air { get; set; } = new(); public static readonly IPipeNet NullNet = new NullPipeNet(); [ViewVariables] - private readonly List _pipes = new List(); + private readonly List _pipes = new(); [ViewVariables] private AtmosphereSystem _atmosphereSystem; @@ -94,7 +94,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups private class NullPipeNet : IPipeNet { - GasMixture IGasMixtureHolder.Air { get; set; } = new GasMixture(); + GasMixture IGasMixtureHolder.Air { get; set; } = new(); public void Update() { } } } diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs index 26559fbd23..8f1aba5b74 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/NodeGroupFactory.cs @@ -26,7 +26,7 @@ [Dependency] private readonly IReflectionManager _reflectionManager = default!; [Dependency] private readonly IDynamicTypeFactory _typeFactory = default!; - private readonly Dictionary _groupTypes = new Dictionary(); + private readonly Dictionary _groupTypes = new(); public void Initialize() { diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs index 64557b3c34..6e6486b79e 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs @@ -32,16 +32,16 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups [Dependency] private readonly IPowerNetManager _powerNetManager = default!; [ViewVariables] - private readonly List _suppliers = new List(); + private readonly List _suppliers = new(); [ViewVariables] private int _totalSupply = 0; [ViewVariables] - private readonly Dictionary> _consumersByPriority = new Dictionary>(); + private readonly Dictionary> _consumersByPriority = new(); [ViewVariables] - private readonly Dictionary _drawByPriority = new Dictionary(); + private readonly Dictionary _drawByPriority = new(); public static readonly IPowerNet NullNet = new NullPowerNet(); diff --git a/Content.Server/GameObjects/Components/Nutrition/HungerComponent.cs b/Content.Server/GameObjects/Components/Nutrition/HungerComponent.cs index d4b1daf95e..cc7d79a072 100644 --- a/Content.Server/GameObjects/Components/Nutrition/HungerComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/HungerComponent.cs @@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.Components.Nutrition [ViewVariables(VVAccess.ReadOnly)] public Dictionary HungerThresholds => _hungerThresholds; - private readonly Dictionary _hungerThresholds = new Dictionary + private readonly Dictionary _hungerThresholds = new() { {HungerThreshold.Overfed, 600.0f}, {HungerThreshold.Okay, 450.0f}, @@ -70,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Nutrition } - public static readonly Dictionary HungerThresholdAlertTypes = new Dictionary + public static readonly Dictionary HungerThresholdAlertTypes = new() { { HungerThreshold.Overfed, AlertType.Overfed }, { HungerThreshold.Peckish, AlertType.Peckish }, diff --git a/Content.Server/GameObjects/Components/Nutrition/ThirstComponent.cs b/Content.Server/GameObjects/Components/Nutrition/ThirstComponent.cs index 6462141610..c3b376b4c0 100644 --- a/Content.Server/GameObjects/Components/Nutrition/ThirstComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/ThirstComponent.cs @@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.Components.Nutrition private float _currentThirst; [ViewVariables(VVAccess.ReadOnly)] - public Dictionary ThirstThresholds { get; } = new Dictionary + public Dictionary ThirstThresholds { get; } = new() { {ThirstThreshold.OverHydrated, 600.0f}, {ThirstThreshold.Okay, 450.0f}, @@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Nutrition {ThirstThreshold.Dead, 0.0f}, }; - public static readonly Dictionary ThirstThresholdAlertTypes = new Dictionary + public static readonly Dictionary ThirstThresholdAlertTypes = new() { {ThirstThreshold.OverHydrated, AlertType.Overhydrated}, {ThirstThreshold.Thirsty, AlertType.Thirsty}, diff --git a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs index bfec94de05..406188572e 100644 --- a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs +++ b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs @@ -441,7 +441,7 @@ namespace Content.Server.GameObjects.Components.PDA private sealed class PdaAccessSet : ISet { private readonly PDAComponent _pdaComponent; - private static readonly HashSet EmptySet = new HashSet(); + private static readonly HashSet EmptySet = new(); public PdaAccessSet(PDAComponent pdaComponent) { diff --git a/Content.Server/GameObjects/Components/Portal/PortalComponent.cs b/Content.Server/GameObjects/Components/Portal/PortalComponent.cs index 8f352f83a4..604208a91a 100644 --- a/Content.Server/GameObjects/Components/Portal/PortalComponent.cs +++ b/Content.Server/GameObjects/Components/Portal/PortalComponent.cs @@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Portal [ViewVariables] private bool _onCooldown; [ViewVariables] private string _departureSound = ""; [ViewVariables] private string _arrivalSound = ""; - public readonly List ImmuneEntities = new List(); // K + public readonly List ImmuneEntities = new(); // K [ViewVariables(VVAccess.ReadWrite)] private float _aliveTime; public override void ExposeData(ObjectSerializer serializer) diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs index f462b3f3a0..3e3549fd10 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerProviderComponent.cs @@ -37,7 +37,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents [ViewVariables] public IReadOnlyList LinkedReceivers => _linkedReceivers; - private List _linkedReceivers = new List(); + private List _linkedReceivers = new(); /// /// If s should consider connecting to this. diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs index 97f7f51ace..0bc9c83bba 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs @@ -174,7 +174,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece On } - public Dictionary BatteryStateText = new Dictionary + public Dictionary BatteryStateText = new() { { EmergencyLightState.Full, "[color=darkgreen]Full[/color]"}, { EmergencyLightState.Empty, "[color=darkred]Empty[/color]"}, diff --git a/Content.Server/GameObjects/Components/Power/PowerNetComponents/IPowerNetManager.cs b/Content.Server/GameObjects/Components/Power/PowerNetComponents/IPowerNetManager.cs index 18ad79003a..808f3f564b 100644 --- a/Content.Server/GameObjects/Components/Power/PowerNetComponents/IPowerNetManager.cs +++ b/Content.Server/GameObjects/Components/Power/PowerNetComponents/IPowerNetManager.cs @@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents public class PowerNetManager : IPowerNetManager { - private readonly HashSet _dirtyPowerNets = new HashSet(); + private readonly HashSet _dirtyPowerNets = new(); public void AddDirtyPowerNet(IPowerNet powerNet) { diff --git a/Content.Server/GameObjects/Components/Radio/HandheldRadioComponent.cs b/Content.Server/GameObjects/Components/Radio/HandheldRadioComponent.cs index 6a10aea330..05e879dbbb 100644 --- a/Content.Server/GameObjects/Components/Radio/HandheldRadioComponent.cs +++ b/Content.Server/GameObjects/Components/Radio/HandheldRadioComponent.cs @@ -27,7 +27,7 @@ namespace Content.Server.GameObjects.Components.Radio private RadioSystem _radioSystem = default!; private bool _radioOn; - private List _channels = new List(); + private List _channels = new(); [ViewVariables(VVAccess.ReadWrite)] private int BroadcastFrequency { get; set; } diff --git a/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs b/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs index 5236a99aac..909b9239b8 100644 --- a/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs +++ b/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs @@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.Components.Recycling { public override string Name => "Recycler"; - private readonly List _intersecting = new List(); + private readonly List _intersecting = new(); /// /// Whether or not sentient beings will be recycled diff --git a/Content.Server/GameObjects/Components/Research/LatheComponent.cs b/Content.Server/GameObjects/Components/Research/LatheComponent.cs index 4021d45c03..7e87b0d4e5 100644 --- a/Content.Server/GameObjects/Components/Research/LatheComponent.cs +++ b/Content.Server/GameObjects/Components/Research/LatheComponent.cs @@ -29,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Research public const int VolumePerSheet = 3750; [ViewVariables] - public Queue Queue { get; } = new Queue(); + public Queue Queue { get; } = new(); [ViewVariables] public bool Producing { get; private set; } diff --git a/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs b/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs index b863574720..5a59e55c62 100644 --- a/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Research/MaterialStorageComponent.cs @@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.Components.Research public class MaterialStorageComponent : SharedMaterialStorageComponent { [ViewVariables] - protected override Dictionary Storage { get; set; } = new Dictionary(); + protected override Dictionary Storage { get; set; } = new(); /// /// How much material the storage can store in total. diff --git a/Content.Server/GameObjects/Components/Research/ResearchServerComponent.cs b/Content.Server/GameObjects/Components/Research/ResearchServerComponent.cs index 4b117a7f7f..269cffc827 100644 --- a/Content.Server/GameObjects/Components/Research/ResearchServerComponent.cs +++ b/Content.Server/GameObjects/Components/Research/ResearchServerComponent.cs @@ -31,10 +31,10 @@ namespace Content.Server.GameObjects.Components.Research public IReadOnlyList UnlockedTechnologies => Database.Technologies; [ViewVariables(VVAccess.ReadOnly)] - public List PointSources { get; } = new List(); + public List PointSources { get; } = new(); [ViewVariables(VVAccess.ReadOnly)] - public List Clients { get; } = new List(); + public List Clients { get; } = new(); public int Point => _points; diff --git a/Content.Server/GameObjects/Components/Singularity/ContainmentFieldConnection.cs b/Content.Server/GameObjects/Components/Singularity/ContainmentFieldConnection.cs index e1d0a63f18..26bb2d1e4e 100644 --- a/Content.Server/GameObjects/Components/Singularity/ContainmentFieldConnection.cs +++ b/Content.Server/GameObjects/Components/Singularity/ContainmentFieldConnection.cs @@ -15,9 +15,9 @@ namespace Content.Server.GameObjects.Components.Singularity { public readonly ContainmentFieldGeneratorComponent Generator1; public readonly ContainmentFieldGeneratorComponent Generator2; - private readonly List _fields = new List(); + private readonly List _fields = new(); private int _sharedEnergyPool; - private readonly CancellationTokenSource _powerDecreaseCancellationTokenSource = new CancellationTokenSource(); + private readonly CancellationTokenSource _powerDecreaseCancellationTokenSource = new(); public int SharedEnergyPool { get => _sharedEnergyPool; diff --git a/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs b/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs index e7dfb89c05..a84fad68ac 100644 --- a/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs +++ b/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs @@ -158,7 +158,7 @@ namespace Content.Server.GameObjects.Components.Singularity _singularityController?.Push(pushVector.Normalized, 2); } - private readonly List _previousPulledEntities = new List(); + private readonly List _previousPulledEntities = new(); public void PullUpdate() { foreach (var previousPulledEntity in _previousPulledEntities) diff --git a/Content.Server/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs b/Content.Server/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs index ece86456be..3ec6e6d70c 100644 --- a/Content.Server/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs +++ b/Content.Server/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs @@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Suspicion public class SuspicionRoleComponent : SharedSuspicionRoleComponent, IExamine { private Role? _role; - private readonly HashSet _allies = new HashSet(); + private readonly HashSet _allies = new(); [ViewVariables] public Role? Role diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs index 7a12ce427b..123182560a 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs @@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition { public override string Name => "RangedMagazine"; - private readonly Stack _spawnedAmmo = new Stack(); + private readonly Stack _spawnedAmmo = new(); private Container _ammoContainer; public int ShotsLeft => _spawnedAmmo.Count + _unspawnedCount; diff --git a/Content.Server/GameObjects/Components/WiresComponent.cs b/Content.Server/GameObjects/Components/WiresComponent.cs index cb2f201faa..7038c7dcb4 100644 --- a/Content.Server/GameObjects/Components/WiresComponent.cs +++ b/Content.Server/GameObjects/Components/WiresComponent.cs @@ -118,22 +118,22 @@ namespace Content.Server.GameObjects.Components /// Contains all registered wires. /// [ViewVariables] - public readonly List WiresList = new List(); + public readonly List WiresList = new(); /// /// Status messages are displayed at the bottom of the UI. /// [ViewVariables] - private readonly Dictionary _statuses = new Dictionary(); + private readonly Dictionary _statuses = new(); /// /// and . /// private readonly List _availableColors = - new List((WireColor[]) Enum.GetValues(typeof(WireColor))); + new((WireColor[]) Enum.GetValues(typeof(WireColor))); private readonly List _availableLetters = - new List((WireLetter[]) Enum.GetValues(typeof(WireLetter))); + new((WireLetter[]) Enum.GetValues(typeof(WireLetter))); private string _boardName = default!; diff --git a/Content.Server/GameObjects/EntitySystems/AI/AiFactionTagSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/AiFactionTagSystem.cs index 5801a15c46..b9edd66f64 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/AiFactionTagSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/AiFactionTagSystem.cs @@ -24,7 +24,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI public Faction GetHostileFactions(Faction faction) => _hostileFactions.TryGetValue(faction, out var hostiles) ? hostiles : Faction.None; - private readonly Dictionary _hostileFactions = new Dictionary + private readonly Dictionary _hostileFactions = new() { {Faction.NanoTransen, Faction.SimpleHostile | Faction.Syndicate | Faction.Xeno}, diff --git a/Content.Server/GameObjects/EntitySystems/AI/AiSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/AiSystem.cs index 1e4c995799..7ab3bef2b7 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/AiSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/AiSystem.cs @@ -28,15 +28,15 @@ namespace Content.Server.GameObjects.EntitySystems.AI [Dependency] private readonly IDynamicTypeFactory _typeFactory = default!; [Dependency] private readonly IReflectionManager _reflectionManager = default!; - private readonly Dictionary _processorTypes = new Dictionary(); + private readonly Dictionary _processorTypes = new(); /// /// To avoid iterating over dead AI continuously they can wake and sleep themselves when necessary. /// - private readonly HashSet _awakeAi = new HashSet(); + private readonly HashSet _awakeAi = new(); // To avoid modifying awakeAi while iterating over it. - private readonly List _queuedSleepMessages = new List(); + private readonly List _queuedSleepMessages = new(); public bool IsAwake(AiLogicProcessor processor) => _awakeAi.Contains(processor); diff --git a/Content.Server/GameObjects/EntitySystems/AI/LoadBalancer/AiActionSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/LoadBalancer/AiActionSystem.cs index 55fb3af735..f49260384c 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/LoadBalancer/AiActionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/LoadBalancer/AiActionSystem.cs @@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.LoadBalancer /// public class AiActionSystem : EntitySystem { - private readonly AiActionJobQueue _aiRequestQueue = new AiActionJobQueue(); + private readonly AiActionJobQueue _aiRequestQueue = new(); public AiActionRequestJob RequestAction(AiActionRequest request, CancellationTokenSource cancellationToken) { diff --git a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs index af610df01d..d61fdc6761 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/AiReachableSystem.cs @@ -45,7 +45,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible /// /// Queued region updates /// - private readonly HashSet _queuedUpdates = new HashSet(); + private readonly HashSet _queuedUpdates = new(); // Oh god the nesting. Shouldn't need to go beyond this /// @@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible /// i.e. same collision, not-space, same access, etc. /// private readonly Dictionary>> _regions = - new Dictionary>>(); + new(); /// /// Minimum time for the cached reachable regions to be stored @@ -71,9 +71,9 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible // Also, didn't use a dictionary because there didn't seem to be a clean way to do the lookup // Plus this way we can check if everything is equal except for vision so an entity with a lower vision radius can use an entity with a higher vision radius' cached result private readonly Dictionary Regions)>> _cachedAccessible = - new Dictionary)>>(); + new(); - private readonly List _queuedCacheDeletions = new List(); + private readonly List _queuedCacheDeletions = new(); #if DEBUG private int _runningCacheIdx = 0; diff --git a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/PathfindingRegion.cs b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/PathfindingRegion.cs index d3e7fba401..9b8e5cbee8 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/PathfindingRegion.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/Accessible/PathfindingRegion.cs @@ -27,7 +27,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible public int Width { get; private set; } = 1; public PathfindingChunk ParentChunk => OriginNode.ParentChunk; - public HashSet Neighbors { get; } = new HashSet(); + public HashSet Neighbors { get; } = new(); public bool IsDoor { get; } public HashSet Nodes => _nodes; diff --git a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingNode.cs b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingNode.cs index 4411a8a890..06beb0224d 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingNode.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingNode.cs @@ -22,17 +22,17 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding /// Whenever there's a change in the collision layers we update the mask as the graph has more reads than writes /// public int BlockedCollisionMask { get; private set; } - private readonly Dictionary _blockedCollidables = new Dictionary(0); + private readonly Dictionary _blockedCollidables = new(0); public IReadOnlyDictionary PhysicsLayers => _physicsLayers; - private readonly Dictionary _physicsLayers = new Dictionary(0); + private readonly Dictionary _physicsLayers = new(0); /// /// The entities on this tile that require access to traverse /// /// We don't store the ICollection, at least for now, as we'd need to replicate the access code here public IReadOnlyCollection AccessReaders => _accessReaders.Values; - private readonly Dictionary _accessReaders = new Dictionary(0); + private readonly Dictionary _accessReaders = new(0); public PathfindingNode(PathfindingChunk parent, TileRef tileRef) { diff --git a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingSystem.cs index c62b983a41..0c86d38db0 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingSystem.cs @@ -35,18 +35,18 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding [Dependency] private readonly IEntityManager _entityManager = default!; public IReadOnlyDictionary> Graph => _graph; - private readonly Dictionary> _graph = new Dictionary>(); + private readonly Dictionary> _graph = new(); - private readonly PathfindingJobQueue _pathfindingQueue = new PathfindingJobQueue(); + private readonly PathfindingJobQueue _pathfindingQueue = new(); // Queued pathfinding graph updates - private readonly Queue _collidableUpdateQueue = new Queue(); - private readonly Queue _moveUpdateQueue = new Queue(); - private readonly Queue _accessReaderUpdateQueue = new Queue(); - private readonly Queue _tileUpdateQueue = new Queue(); + private readonly Queue _collidableUpdateQueue = new(); + private readonly Queue _moveUpdateQueue = new(); + private readonly Queue _accessReaderUpdateQueue = new(); + private readonly Queue _tileUpdateQueue = new(); // Need to store previously known entity positions for collidables for when they move - private readonly Dictionary _lastKnownPositions = new Dictionary(); + private readonly Dictionary _lastKnownPositions = new(); public const int TrackedCollisionLayers = (int) (CollisionGroup.Impassable | diff --git a/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs b/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs index 8cd45f6ba3..4287f5d23f 100644 --- a/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/AI/Steering/AiSteeringSystem.cs @@ -52,37 +52,37 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Steering // agent's steering. Should help a lot given this is the most expensive operator by far. // The AI will keep moving, it's just it'll keep moving in its existing direction. // If we change to 20/30 TPS you might want to change this but for now it's fine - private readonly List> _agentLists = new List>(AgentListCount); + private readonly List> _agentLists = new(AgentListCount); private const int AgentListCount = 2; private int _listIndex; // Cache nextGrid - private readonly Dictionary _nextGrid = new Dictionary(); + private readonly Dictionary _nextGrid = new(); /// /// Current live paths for AI /// - private readonly Dictionary> _paths = new Dictionary>(); + private readonly Dictionary> _paths = new(); /// /// Pathfinding request jobs we're waiting on /// private readonly Dictionary> Job)> _pathfindingRequests = - new Dictionary>)>(); + new(); /// /// Keep track of how long we've been in 1 position and re-path if it's been too long /// - private readonly Dictionary _stuckCounter = new Dictionary(); + private readonly Dictionary _stuckCounter = new(); /// /// Get a fixed position for the target entity; if they move then re-path /// - private readonly Dictionary _entityTargetPosition = new Dictionary(); + private readonly Dictionary _entityTargetPosition = new(); // Anti-Stuck // Given the collision avoidance can lead to twitching need to store a reference position and check if we've been near this too long - private readonly Dictionary _stuckPositions = new Dictionary(); + private readonly Dictionary _stuckPositions = new(); public override void Initialize() { diff --git a/Content.Server/GameObjects/EntitySystems/Atmos/AtmosDebugOverlaySystem.cs b/Content.Server/GameObjects/EntitySystems/Atmos/AtmosDebugOverlaySystem.cs index eaf42d4122..04e782b05d 100644 --- a/Content.Server/GameObjects/EntitySystems/Atmos/AtmosDebugOverlaySystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Atmos/AtmosDebugOverlaySystem.cs @@ -30,7 +30,7 @@ namespace Content.Server.GameObjects.EntitySystems.Atmos /// To modify it see and /// . /// - private readonly HashSet _playerObservers = new HashSet(); + private readonly HashSet _playerObservers = new(); /// /// Overlay update ticks per second. diff --git a/Content.Server/GameObjects/EntitySystems/Atmos/GasTileOverlaySystem.cs b/Content.Server/GameObjects/EntitySystems/Atmos/GasTileOverlaySystem.cs index 3ebcd1356a..b0fda14f08 100644 --- a/Content.Server/GameObjects/EntitySystems/Atmos/GasTileOverlaySystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Atmos/GasTileOverlaySystem.cs @@ -37,16 +37,16 @@ namespace Content.Server.GameObjects.EntitySystems.Atmos /// /// The tiles that have had their atmos data updated since last tick /// - private readonly Dictionary> _invalidTiles = new Dictionary>(); + private readonly Dictionary> _invalidTiles = new(); private readonly Dictionary _knownPlayerChunks = - new Dictionary(); + new(); /// /// Gas data stored in chunks to make PVS / bubbling easier. /// private readonly Dictionary> _overlay = - new Dictionary>(); + new(); /// /// How far away do we update gas overlays (minimum; due to chunking further away tiles may also be updated). @@ -378,14 +378,14 @@ namespace Content.Server.GameObjects.EntitySystems.Atmos private sealed class PlayerGasOverlay { private readonly Dictionary> _data = - new Dictionary>(); + new(); private readonly Dictionary _lastSent = - new Dictionary(); + new(); public GasOverlayMessage UpdateClient(GridId grid, List<(Vector2i, GasOverlayData)> data) { - return new GasOverlayMessage(grid, data); + return new(grid, data); } public void Reset() diff --git a/Content.Server/GameObjects/EntitySystems/BlockGameSystem.cs b/Content.Server/GameObjects/EntitySystems/BlockGameSystem.cs index 34d2a79906..37a881d1bf 100644 --- a/Content.Server/GameObjects/EntitySystems/BlockGameSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/BlockGameSystem.cs @@ -12,8 +12,8 @@ namespace Content.Server.GameObjects.EntitySystems // ReSharper disable once ClassNeverInstantiated.Global public class BlockGameSystem : EntitySystem { - private readonly List _roundHighscores = new List(); - private readonly List _globalHighscores = new List(); + private readonly List _roundHighscores = new(); + private readonly List _globalHighscores = new(); public HighScorePlacement RegisterHighScore(string name, int score) { diff --git a/Content.Server/GameObjects/EntitySystems/CargoConsoleSystem.cs b/Content.Server/GameObjects/EntitySystems/CargoConsoleSystem.cs index 49350c41df..a12412a57d 100644 --- a/Content.Server/GameObjects/EntitySystems/CargoConsoleSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/CargoConsoleSystem.cs @@ -22,7 +22,7 @@ namespace Content.Server.GameObjects.EntitySystems /// /// Stores all bank accounts. /// - private readonly Dictionary _accountsDict = new Dictionary(); + private readonly Dictionary _accountsDict = new(); /// /// Used to assign IDs to bank accounts. Incremental counter. /// diff --git a/Content.Server/GameObjects/EntitySystems/CloningSystem.cs b/Content.Server/GameObjects/EntitySystems/CloningSystem.cs index 8be1900553..f759a5d139 100644 --- a/Content.Server/GameObjects/EntitySystems/CloningSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/CloningSystem.cs @@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.EntitySystems } } - public readonly Dictionary Minds = new Dictionary(); + public readonly Dictionary Minds = new(); public void AddToDnaScans(Mind mind) { diff --git a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs index 7bcfccf960..973c249a07 100644 --- a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs @@ -38,7 +38,7 @@ namespace Content.Server.GameObjects.EntitySystems [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!; - private readonly Dictionary> _beingBuilt = new Dictionary>(); + private readonly Dictionary> _beingBuilt = new(); public override void Initialize() { diff --git a/Content.Server/GameObjects/EntitySystems/DoorSystem.cs b/Content.Server/GameObjects/EntitySystems/DoorSystem.cs index 26e44f87e2..3f39c302a5 100644 --- a/Content.Server/GameObjects/EntitySystems/DoorSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/DoorSystem.cs @@ -35,7 +35,7 @@ namespace Content.Server.GameObjects.EntitySystems AllowAll } - private readonly List _activeDoors = new List(); + private readonly List _activeDoors = new(); public override void Initialize() { diff --git a/Content.Server/GameObjects/EntitySystems/EmergencyLightSystem.cs b/Content.Server/GameObjects/EntitySystems/EmergencyLightSystem.cs index ce0c0e0d3c..df30d568ed 100644 --- a/Content.Server/GameObjects/EntitySystems/EmergencyLightSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/EmergencyLightSystem.cs @@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems [UsedImplicitly] internal sealed class EmergencyLightSystem : EntitySystem { - private readonly List _activeLights = new List(); + private readonly List _activeLights = new(); public override void Initialize() { diff --git a/Content.Server/GameObjects/EntitySystems/GodmodeSystem.cs b/Content.Server/GameObjects/EntitySystems/GodmodeSystem.cs index b2495f7627..2bb274a75e 100644 --- a/Content.Server/GameObjects/EntitySystems/GodmodeSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/GodmodeSystem.cs @@ -12,7 +12,7 @@ namespace Content.Server.GameObjects.EntitySystems [UsedImplicitly] public class GodmodeSystem : EntitySystem, IResettingEntitySystem { - private readonly Dictionary _entities = new Dictionary(); + private readonly Dictionary _entities = new(); public void Reset() { diff --git a/Content.Server/GameObjects/EntitySystems/GravitySystem.cs b/Content.Server/GameObjects/EntitySystems/GravitySystem.cs index 501b0809fa..24f6057ba9 100644 --- a/Content.Server/GameObjects/EntitySystems/GravitySystem.cs +++ b/Content.Server/GameObjects/EntitySystems/GravitySystem.cs @@ -28,7 +28,7 @@ namespace Content.Server.GameObjects.EntitySystems private const uint ShakeTimes = 10; - private Dictionary _gridsToShake = new Dictionary(); + private Dictionary _gridsToShake = new(); private float _internalTimer = 0.0f; diff --git a/Content.Server/GameObjects/EntitySystems/JobQueues/Queues/JobQueue.cs b/Content.Server/GameObjects/EntitySystems/JobQueues/Queues/JobQueue.cs index 63330c4dbb..3ed10fc590 100644 --- a/Content.Server/GameObjects/EntitySystems/JobQueues/Queues/JobQueue.cs +++ b/Content.Server/GameObjects/EntitySystems/JobQueues/Queues/JobQueue.cs @@ -21,8 +21,8 @@ namespace Content.Server.GameObjects.EntitySystems.JobQueues.Queues /// public virtual double MaxTime => 0.002; - private readonly Queue _pendingQueue = new Queue(); - private readonly List _waitingJobs = new List(); + private readonly Queue _pendingQueue = new(); + private readonly List _waitingJobs = new(); public void EnqueueJob(IJob job) { diff --git a/Content.Server/GameObjects/EntitySystems/PlantSystem.cs b/Content.Server/GameObjects/EntitySystems/PlantSystem.cs index 65f058c934..d2e776d6f4 100644 --- a/Content.Server/GameObjects/EntitySystems/PlantSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/PlantSystem.cs @@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.EntitySystems [Dependency] private readonly IPrototypeManager _prototypeManager = default!; private int _nextUid = 0; - private readonly Dictionary _seeds = new Dictionary(); + private readonly Dictionary _seeds = new(); private float _timer = 0f; diff --git a/Content.Server/GameObjects/EntitySystems/PointingSystem.cs b/Content.Server/GameObjects/EntitySystems/PointingSystem.cs index b7d1e8e8cf..84862a76db 100644 --- a/Content.Server/GameObjects/EntitySystems/PointingSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/PointingSystem.cs @@ -40,7 +40,7 @@ namespace Content.Server.GameObjects.EntitySystems /// A dictionary of players to the last time that they /// pointed at something. /// - private readonly Dictionary _pointers = new Dictionary(); + private readonly Dictionary _pointers = new(); private const float PointingRange = 15f; diff --git a/Content.Server/GameObjects/EntitySystems/ResearchSystem.cs b/Content.Server/GameObjects/EntitySystems/ResearchSystem.cs index 6e4734139b..61f0c3bef5 100644 --- a/Content.Server/GameObjects/EntitySystems/ResearchSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/ResearchSystem.cs @@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems public const float ResearchConsoleUIUpdateTime = 30f; private float _timer = ResearchConsoleUIUpdateTime; - private readonly List _servers = new List(); + private readonly List _servers = new(); private readonly IEntityQuery ConsoleQuery; public IReadOnlyList Servers => _servers; diff --git a/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs b/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs index 3c9ee5800d..df1c5520db 100644 --- a/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/RoundEndSystem.cs @@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.EntitySystems public const float RestartRoundTime = 20f; - private CancellationTokenSource _roundEndCancellationTokenSource = new CancellationTokenSource(); + private CancellationTokenSource _roundEndCancellationTokenSource = new(); public bool IsRoundEndCountdownStarted { get; private set; } public TimeSpan RoundEndCountdownTime { get; set; } = TimeSpan.FromMinutes(4); public TimeSpan? ExpectedCountdownEnd = null; diff --git a/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs b/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs index 3cf87305c4..cf7c9fb63e 100644 --- a/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs @@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents public StationEvent CurrentEvent { get; private set; } public IReadOnlyCollection StationEvents => _stationEvents; - private readonly List _stationEvents = new List(); + private readonly List _stationEvents = new(); private const float MinimumTimeUntilFirstEvent = 300; diff --git a/Content.Server/GameObjects/EntitySystems/StorageSystem.cs b/Content.Server/GameObjects/EntitySystems/StorageSystem.cs index b3f49605cb..4753b332e6 100644 --- a/Content.Server/GameObjects/EntitySystems/StorageSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/StorageSystem.cs @@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems [UsedImplicitly] internal sealed class StorageSystem : EntitySystem { - private readonly List _sessionCache = new List(); + private readonly List _sessionCache = new(); /// public override void Initialize() diff --git a/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs b/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs index 936fe24185..fb7fef8e65 100644 --- a/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs @@ -8,7 +8,7 @@ namespace Content.Server.GameObjects.EntitySystems [UsedImplicitly] public class SuspicionRoleSystem : EntitySystem { - private readonly HashSet _traitors = new HashSet(); + private readonly HashSet _traitors = new(); public IReadOnlyCollection Traitors => _traitors; diff --git a/Content.Server/GameObjects/EntitySystems/VerbSystem.cs b/Content.Server/GameObjects/EntitySystems/VerbSystem.cs index 4b3185f080..cfd3809972 100644 --- a/Content.Server/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/VerbSystem.cs @@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.EntitySystems { [Dependency] private readonly IPlayerManager _playerManager = default!; - private readonly HashSet _seesThroughContainers = new HashSet(); + private readonly HashSet _seesThroughContainers = new(); public override void Initialize() { diff --git a/Content.Server/GameObjects/EntitySystems/WeightlessSystem.cs b/Content.Server/GameObjects/EntitySystems/WeightlessSystem.cs index c18fb5c8a6..794b6df840 100644 --- a/Content.Server/GameObjects/EntitySystems/WeightlessSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/WeightlessSystem.cs @@ -20,7 +20,7 @@ namespace Content.Server.GameObjects.EntitySystems { [Dependency] private readonly IMapManager _mapManager = default!; - private readonly Dictionary> _alerts = new Dictionary>(); + private readonly Dictionary> _alerts = new(); public override void Initialize() { diff --git a/Content.Server/GameObjects/EntitySystems/WelderSystem.cs b/Content.Server/GameObjects/EntitySystems/WelderSystem.cs index 411e3546fc..5d86e0c9cb 100644 --- a/Content.Server/GameObjects/EntitySystems/WelderSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/WelderSystem.cs @@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems /// public class WelderSystem : EntitySystem { - private readonly HashSet _activeWelders = new HashSet(); + private readonly HashSet _activeWelders = new(); public bool Subscribe(WelderComponent welder) { diff --git a/Content.Server/GameObjects/EntitySystems/WireHackingSystem.cs b/Content.Server/GameObjects/EntitySystems/WireHackingSystem.cs index c57c7a6d10..03c5235c20 100644 --- a/Content.Server/GameObjects/EntitySystems/WireHackingSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/WireHackingSystem.cs @@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems public class WireHackingSystem : EntitySystem, IResettingEntitySystem { [ViewVariables] private readonly Dictionary _layouts = - new Dictionary(); + new(); public bool TryGetLayout(string id, out WireLayout layout) { diff --git a/Content.Server/GameTicking/GameRules/RuleSuspicion.cs b/Content.Server/GameTicking/GameRules/RuleSuspicion.cs index 8f77126c78..20b28c1066 100644 --- a/Content.Server/GameTicking/GameRules/RuleSuspicion.cs +++ b/Content.Server/GameTicking/GameRules/RuleSuspicion.cs @@ -33,7 +33,7 @@ namespace Content.Server.GameTicking.GameRules [Dependency] private readonly IGameTicker _gameTicker = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; - private readonly CancellationTokenSource _checkTimerCancel = new CancellationTokenSource(); + private readonly CancellationTokenSource _checkTimerCancel = new(); public override void Added() { diff --git a/Content.Server/GameTicking/GameTicker.JobController.cs b/Content.Server/GameTicking/GameTicker.JobController.cs index cd097b7ebe..32fb69e2e8 100644 --- a/Content.Server/GameTicking/GameTicker.JobController.cs +++ b/Content.Server/GameTicking/GameTicker.JobController.cs @@ -17,7 +17,7 @@ namespace Content.Server.GameTicking public partial class GameTicker { [ViewVariables] - private readonly Dictionary _spawnedPositions = new Dictionary(); + private readonly Dictionary _spawnedPositions = new(); private Dictionary AssignJobs(List available, Dictionary profiles) diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 0b04576b86..b942e572be 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -70,11 +70,11 @@ namespace Content.Server.GameTicking private const string ObserverPrototypeName = "MobObserver"; private static TimeSpan _roundStartTimeSpan; - [ViewVariables] private readonly List _gameRules = new List(); - [ViewVariables] private readonly List _manifest = new List(); + [ViewVariables] private readonly List _gameRules = new(); + [ViewVariables] private readonly List _manifest = new(); [ViewVariables] - private readonly Dictionary _playersInLobby = new Dictionary(); + private readonly Dictionary _playersInLobby = new(); [ViewVariables] private bool _initialized; diff --git a/Content.Server/MoMMILink.cs b/Content.Server/MoMMILink.cs index bc7b4aaf01..1455598c47 100644 --- a/Content.Server/MoMMILink.cs +++ b/Content.Server/MoMMILink.cs @@ -23,7 +23,7 @@ namespace Content.Server [Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly ITaskManager _taskManager = default!; - private readonly HttpClient _httpClient = new HttpClient(); + private readonly HttpClient _httpClient = new(); void IPostInjectInit.PostInject() { diff --git a/Content.Server/Mobs/Mind.cs b/Content.Server/Mobs/Mind.cs index 77d5c23394..badf46ae02 100644 --- a/Content.Server/Mobs/Mind.cs +++ b/Content.Server/Mobs/Mind.cs @@ -28,7 +28,7 @@ namespace Content.Server.Mobs { private readonly ISet _roles = new HashSet(); - private readonly List _objectives = new List(); + private readonly List _objectives = new(); /// /// Creates the new mind attached to a specific player session. diff --git a/Content.Server/Objectives/ObjectivePrototype.cs b/Content.Server/Objectives/ObjectivePrototype.cs index 78965c79f6..4022d5a3d0 100644 --- a/Content.Server/Objectives/ObjectivePrototype.cs +++ b/Content.Server/Objectives/ObjectivePrototype.cs @@ -29,8 +29,8 @@ namespace Content.Server.Objectives [ViewVariables] public float Difficulty => _difficultyOverride ?? _conditions.Sum(c => c.GetDifficulty()); - private List _conditions = new List(); - private List _requirements = new List(); + private List _conditions = new(); + private List _requirements = new(); [ViewVariables(VVAccess.ReadWrite)] private float? _difficultyOverride = null; diff --git a/Content.Server/Preferences/ServerPreferencesManager.cs b/Content.Server/Preferences/ServerPreferencesManager.cs index 6c60455cd6..a17bdbbb45 100644 --- a/Content.Server/Preferences/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/ServerPreferencesManager.cs @@ -32,7 +32,7 @@ namespace Content.Server.Preferences // Cache player prefs on the server so we don't need as much async hell related to them. private readonly Dictionary _cachedPlayerPrefs = - new Dictionary(); + new(); private int MaxCharacterSlots => _cfg.GetCVar(CCVars.GameMaxCharacterSlots); diff --git a/Content.Server/StationEvents/PowerGridCheck.cs b/Content.Server/StationEvents/PowerGridCheck.cs index ab7e778f5c..eb422b0d5a 100644 --- a/Content.Server/StationEvents/PowerGridCheck.cs +++ b/Content.Server/StationEvents/PowerGridCheck.cs @@ -37,7 +37,7 @@ namespace Content.Server.StationEvents private CancellationTokenSource _announceCancelToken; - private readonly List _powered = new List(); + private readonly List _powered = new(); public override void Startup() { diff --git a/Content.Shared/Administration/AdminFlagsHelper.cs b/Content.Shared/Administration/AdminFlagsHelper.cs index 9d5bba3baa..5a72d5f65e 100644 --- a/Content.Shared/Administration/AdminFlagsHelper.cs +++ b/Content.Shared/Administration/AdminFlagsHelper.cs @@ -13,7 +13,7 @@ namespace Content.Shared.Administration // As you can tell from the boatload of bitwise ops, // writing this class was genuinely fun. - private static readonly Dictionary NameFlagsMap = new Dictionary(); + private static readonly Dictionary NameFlagsMap = new(); private static readonly string[] FlagsNameMap = new string[32]; /// diff --git a/Content.Shared/Alert/AlertOrderPrototype.cs b/Content.Shared/Alert/AlertOrderPrototype.cs index 6bd84ed4ca..18cf2eb617 100644 --- a/Content.Shared/Alert/AlertOrderPrototype.cs +++ b/Content.Shared/Alert/AlertOrderPrototype.cs @@ -12,8 +12,8 @@ namespace Content.Shared.Alert [Prototype("alertOrder")] public class AlertOrderPrototype : IPrototype, IComparer { - private readonly Dictionary _typeToIdx = new Dictionary(); - private readonly Dictionary _categoryToIdx = new Dictionary(); + private readonly Dictionary _typeToIdx = new(); + private readonly Dictionary _categoryToIdx = new(); public void LoadFrom(YamlMappingNode mapping) { diff --git a/Content.Shared/Alert/AlertPrototype.cs b/Content.Shared/Alert/AlertPrototype.cs index 431e0b6f3d..c9e7427ae1 100644 --- a/Content.Shared/Alert/AlertPrototype.cs +++ b/Content.Shared/Alert/AlertPrototype.cs @@ -183,7 +183,7 @@ namespace Content.Shared.Alert /// An alert key for the provided alert category public static AlertKey ForCategory(AlertCategory category) { - return new AlertKey(null, category); + return new(null, category); } } } diff --git a/Content.Shared/Arcade/BlockGameBlock.cs b/Content.Shared/Arcade/BlockGameBlock.cs index e1fc1cd385..1f32db1b33 100644 --- a/Content.Shared/Arcade/BlockGameBlock.cs +++ b/Content.Shared/Arcade/BlockGameBlock.cs @@ -32,21 +32,21 @@ namespace Content.Shared.Arcade public static class BlockGameVector2Extensions{ public static BlockGameBlock ToBlockGameBlock(this Vector2i vector2, BlockGameBlock.BlockGameBlockColor gameBlockColor) { - return new BlockGameBlock(vector2, gameBlockColor); + return new(vector2, gameBlockColor); } public static Vector2i AddToX(this Vector2i vector2, int amount) { - return new Vector2i(vector2.X + amount, vector2.Y); + return new(vector2.X + amount, vector2.Y); } public static Vector2i AddToY(this Vector2i vector2, int amount) { - return new Vector2i(vector2.X, vector2.Y + amount); + return new(vector2.X, vector2.Y + amount); } public static Vector2i Rotate90DegreesAsOffset(this Vector2i vector) { - return new Vector2i(-vector.Y, vector.X); + return new(-vector.Y, vector.X); } } diff --git a/Content.Shared/Chemistry/ReagentUnit.cs b/Content.Shared/Chemistry/ReagentUnit.cs index bf1d86e437..0697d4c421 100644 --- a/Content.Shared/Chemistry/ReagentUnit.cs +++ b/Content.Shared/Chemistry/ReagentUnit.cs @@ -11,9 +11,9 @@ namespace Content.Shared.Chemistry private int _value; private static readonly int Shift = 2; - public static ReagentUnit MaxValue { get; } = new ReagentUnit(int.MaxValue); - public static ReagentUnit Epsilon { get; } = new ReagentUnit(1); - public static ReagentUnit Zero { get; } = new ReagentUnit(0); + public static ReagentUnit MaxValue { get; } = new(int.MaxValue); + public static ReagentUnit Epsilon { get; } = new(1); + public static ReagentUnit Zero { get; } = new(0); private double ShiftDown() { @@ -27,12 +27,12 @@ namespace Content.Shared.Chemistry public static ReagentUnit New(int value) { - return new ReagentUnit(value * (int) Math.Pow(10, Shift)); + return new(value * (int) Math.Pow(10, Shift)); } public static ReagentUnit New(float value) { - return new ReagentUnit(FromFloat(value)); + return new(FromFloat(value)); } private static int FromFloat(float value) @@ -42,7 +42,7 @@ namespace Content.Shared.Chemistry public static ReagentUnit New(double value) { - return new ReagentUnit((int) Math.Round(value * Math.Pow(10, Shift), MidpointRounding.AwayFromZero)); + return new((int) Math.Round(value * Math.Pow(10, Shift), MidpointRounding.AwayFromZero)); } public static ReagentUnit New(string value) @@ -57,10 +57,10 @@ namespace Content.Shared.Chemistry public static ReagentUnit operator +(ReagentUnit a) => a; - public static ReagentUnit operator -(ReagentUnit a) => new ReagentUnit(-a._value); + public static ReagentUnit operator -(ReagentUnit a) => new(-a._value); public static ReagentUnit operator +(ReagentUnit a, ReagentUnit b) - => new ReagentUnit(a._value + b._value); + => new(a._value + b._value); public static ReagentUnit operator -(ReagentUnit a, ReagentUnit b) => a + -b; @@ -86,7 +86,7 @@ namespace Content.Shared.Chemistry public static ReagentUnit operator *(ReagentUnit a, int b) { - return new ReagentUnit(a._value * b); + return new(a._value * b); } public static ReagentUnit operator /(ReagentUnit a, ReagentUnit b) diff --git a/Content.Shared/Chemistry/Solution.cs b/Content.Shared/Chemistry/Solution.cs index 13a425a61b..f515721e0f 100644 --- a/Content.Shared/Chemistry/Solution.cs +++ b/Content.Shared/Chemistry/Solution.cs @@ -17,7 +17,7 @@ namespace Content.Shared.Chemistry { // Most objects on the station hold only 1 or 2 reagents [ViewVariables] - private List _contents = new List(2); + private List _contents = new(2); public IReadOnlyList Contents => _contents; diff --git a/Content.Shared/Construction/ConstructionGraphEdge.cs b/Content.Shared/Construction/ConstructionGraphEdge.cs index 376504a65d..87badee2f4 100644 --- a/Content.Shared/Construction/ConstructionGraphEdge.cs +++ b/Content.Shared/Construction/ConstructionGraphEdge.cs @@ -15,7 +15,7 @@ namespace Content.Shared.Construction [Serializable] public class ConstructionGraphEdge : IExposeData { - private List _steps = new List(); + private List _steps = new(); private List _conditions; private List _completed; diff --git a/Content.Shared/Construction/ConstructionGraphNode.cs b/Content.Shared/Construction/ConstructionGraphNode.cs index 199695299b..8c0437a37f 100644 --- a/Content.Shared/Construction/ConstructionGraphNode.cs +++ b/Content.Shared/Construction/ConstructionGraphNode.cs @@ -13,8 +13,8 @@ namespace Content.Shared.Construction [Serializable] public class ConstructionGraphNode { - private List _actions = new List(); - private List _edges = new List(); + private List _actions = new(); + private List _edges = new(); [ViewVariables] public string Name { get; private set; } diff --git a/Content.Shared/Construction/ConstructionGraphPrototype.cs b/Content.Shared/Construction/ConstructionGraphPrototype.cs index 5d557effd9..0be6723f4b 100644 --- a/Content.Shared/Construction/ConstructionGraphPrototype.cs +++ b/Content.Shared/Construction/ConstructionGraphPrototype.cs @@ -12,9 +12,9 @@ namespace Content.Shared.Construction [Prototype("constructionGraph")] public class ConstructionGraphPrototype : IPrototype, IIndexedPrototype { - private readonly Dictionary _nodes = new Dictionary(); - private readonly Dictionary, ConstructionGraphNode[]> _paths = new Dictionary, ConstructionGraphNode[]>(); - private Dictionary _pathfinding = new Dictionary(); + private readonly Dictionary _nodes = new(); + private readonly Dictionary, ConstructionGraphNode[]> _paths = new(); + private Dictionary _pathfinding = new(); [ViewVariables] public string ID { get; private set; } diff --git a/Content.Shared/Construction/NestedConstructionGraphStep.cs b/Content.Shared/Construction/NestedConstructionGraphStep.cs index b8f671bc60..1ea8b6e45f 100644 --- a/Content.Shared/Construction/NestedConstructionGraphStep.cs +++ b/Content.Shared/Construction/NestedConstructionGraphStep.cs @@ -8,7 +8,7 @@ namespace Content.Shared.Construction { public class NestedConstructionGraphStep : ConstructionGraphStep { - public List> Steps { get; private set; } = new List>(); + public List> Steps { get; private set; } = new(); public void LoadFrom(YamlMappingNode mapping) { diff --git a/Content.Shared/Damage/ResistanceSet/ResistanceSet.cs b/Content.Shared/Damage/ResistanceSet/ResistanceSet.cs index b076df8fcb..2c0a4eadac 100644 --- a/Content.Shared/Damage/ResistanceSet/ResistanceSet.cs +++ b/Content.Shared/Damage/ResistanceSet/ResistanceSet.cs @@ -14,7 +14,7 @@ namespace Content.Shared.Damage.ResistanceSet { [ViewVariables] private Dictionary _resistances = - new Dictionary(); + new(); public ResistanceSet() { diff --git a/Content.Shared/GameObjects/Components/Body/Mechanism/SharedMechanismComponent.cs b/Content.Shared/GameObjects/Components/Body/Mechanism/SharedMechanismComponent.cs index a53fc0cc73..f72b2b039f 100644 --- a/Content.Shared/GameObjects/Components/Body/Mechanism/SharedMechanismComponent.cs +++ b/Content.Shared/GameObjects/Components/Body/Mechanism/SharedMechanismComponent.cs @@ -18,12 +18,12 @@ namespace Content.Shared.GameObjects.Components.Body.Mechanism { public override string Name => "Mechanism"; - protected readonly Dictionary OptionsCache = new Dictionary(); + protected readonly Dictionary OptionsCache = new(); protected IBody? BodyCache; protected int IdHash; protected IEntity? PerformerCache; private IBodyPart? _part; - private readonly Dictionary _behaviors = new Dictionary(); + private readonly Dictionary _behaviors = new(); public IBody? Body => Part?.Body; diff --git a/Content.Shared/GameObjects/Components/Body/Part/SharedBodyPartComponent.cs b/Content.Shared/GameObjects/Components/Body/Part/SharedBodyPartComponent.cs index 648fa16afe..6f1f9547fe 100644 --- a/Content.Shared/GameObjects/Components/Body/Part/SharedBodyPartComponent.cs +++ b/Content.Shared/GameObjects/Components/Body/Part/SharedBodyPartComponent.cs @@ -23,11 +23,11 @@ namespace Content.Shared.GameObjects.Components.Body.Part private IBody? _body; // TODO BODY Remove - private List _mechanismIds = new List(); + private List _mechanismIds = new(); public IReadOnlyList MechanismIds => _mechanismIds; [ViewVariables] - private readonly HashSet _mechanisms = new HashSet(); + private readonly HashSet _mechanisms = new(); [ViewVariables] public IBody? Body diff --git a/Content.Shared/GameObjects/Components/Body/Preset/BodyPresetPrototype.cs b/Content.Shared/GameObjects/Components/Body/Preset/BodyPresetPrototype.cs index 7078551466..6c7a0e1126 100644 --- a/Content.Shared/GameObjects/Components/Body/Preset/BodyPresetPrototype.cs +++ b/Content.Shared/GameObjects/Components/Body/Preset/BodyPresetPrototype.cs @@ -23,7 +23,7 @@ namespace Content.Shared.GameObjects.Components.Body.Preset [ViewVariables] public string Name => _name; - [ViewVariables] public Dictionary PartIDs => new Dictionary(_partIDs); + [ViewVariables] public Dictionary PartIDs => new(_partIDs); public virtual void LoadFrom(YamlMappingNode mapping) { diff --git a/Content.Shared/GameObjects/Components/Body/SharedBodyComponent.cs b/Content.Shared/GameObjects/Components/Body/SharedBodyComponent.cs index b7e6dff3fa..dcb2e26ad8 100644 --- a/Content.Shared/GameObjects/Components/Body/SharedBodyComponent.cs +++ b/Content.Shared/GameObjects/Components/Body/SharedBodyComponent.cs @@ -32,19 +32,19 @@ namespace Content.Shared.GameObjects.Components.Body private string? _centerSlot; - private Dictionary _partIds = new Dictionary(); + private Dictionary _partIds = new(); - private readonly Dictionary _parts = new Dictionary(); + private readonly Dictionary _parts = new(); [ViewVariables] public string? TemplateName { get; private set; } [ViewVariables] public string? PresetName { get; private set; } [ViewVariables] - public Dictionary Slots { get; private set; } = new Dictionary(); + public Dictionary Slots { get; private set; } = new(); [ViewVariables] - public Dictionary> Connections { get; private set; } = new Dictionary>(); + public Dictionary> Connections { get; private set; } = new(); /// /// Maps slots to the part filling each one. diff --git a/Content.Shared/GameObjects/Components/Body/Surgery/BiologicalSurgeryDataComponent.cs b/Content.Shared/GameObjects/Components/Body/Surgery/BiologicalSurgeryDataComponent.cs index 31c3b3e045..1fd276f781 100644 --- a/Content.Shared/GameObjects/Components/Body/Surgery/BiologicalSurgeryDataComponent.cs +++ b/Content.Shared/GameObjects/Components/Body/Surgery/BiologicalSurgeryDataComponent.cs @@ -19,7 +19,7 @@ namespace Content.Shared.GameObjects.Components.Body.Surgery { public override string Name => "BiologicalSurgeryData"; - private readonly List _disconnectedOrgans = new List(); + private readonly List _disconnectedOrgans = new(); private bool _skinOpened; private bool _skinRetracted; diff --git a/Content.Shared/GameObjects/Components/Body/Template/BodyTemplatePrototype.cs b/Content.Shared/GameObjects/Components/Body/Template/BodyTemplatePrototype.cs index b9fa0457d6..d1da8c8766 100644 --- a/Content.Shared/GameObjects/Components/Body/Template/BodyTemplatePrototype.cs +++ b/Content.Shared/GameObjects/Components/Body/Template/BodyTemplatePrototype.cs @@ -30,15 +30,15 @@ namespace Content.Shared.GameObjects.Components.Body.Template [ViewVariables] public string CenterSlot => _centerSlot; - [ViewVariables] public Dictionary Slots => new Dictionary(_slots); + [ViewVariables] public Dictionary Slots => new(_slots); [ViewVariables] public Dictionary> Connections => _connections.ToDictionary(x => x.Key, x => x.Value.ToList()); - [ViewVariables] public Dictionary Layers => new Dictionary(_layers); + [ViewVariables] public Dictionary Layers => new(_layers); - [ViewVariables] public Dictionary MechanismLayers => new Dictionary(_mechanismLayers); + [ViewVariables] public Dictionary MechanismLayers => new(_mechanismLayers); public virtual void LoadFrom(YamlMappingNode mapping) { diff --git a/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs b/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs index 7636ee47ad..45ac21b01b 100644 --- a/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs +++ b/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs @@ -14,7 +14,7 @@ namespace Content.Shared.GameObjects.Components.Cargo public sealed override string Name => "GalacticMarket"; public sealed override uint? NetID => ContentNetIDs.GALACTIC_MARKET; - protected List _products = new List(); + protected List _products = new(); /// /// A read-only list of products. diff --git a/Content.Shared/GameObjects/Components/Chemistry/ReagentDispenser/SharedReagentDispenserComponent.cs b/Content.Shared/GameObjects/Components/Chemistry/ReagentDispenser/SharedReagentDispenserComponent.cs index d7ff2d7521..b0d17284ec 100644 --- a/Content.Shared/GameObjects/Components/Chemistry/ReagentDispenser/SharedReagentDispenserComponent.cs +++ b/Content.Shared/GameObjects/Components/Chemistry/ReagentDispenser/SharedReagentDispenserComponent.cs @@ -20,7 +20,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry.ReagentDispenser /// /// A list of reagents which this may dispense. Defined in yaml prototype, see . /// - protected readonly List Inventory = new List(); + protected readonly List Inventory = new(); [Serializable, NetSerializable] public class ReagentDispenserBoundUserInterfaceState : BoundUserInterfaceState diff --git a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs index 7fc4eb4885..e65a975be4 100644 --- a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs +++ b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs @@ -15,7 +15,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry /// public sealed override uint? NetID => ContentNetIDs.SOLUTION; - private Solution _solution = new Solution(); + private Solution _solution = new(); private ReagentUnit _maxVolume; private Color _substanceColor; diff --git a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs index 118fcd2d29..288f5fdaa5 100644 --- a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs +++ b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs @@ -40,7 +40,7 @@ namespace Content.Shared.GameObjects.Components.Damage [ViewVariables] private DamageContainer Damage { get; set; } = default!; - public Dictionary Thresholds { get; set; } = new Dictionary(); + public Dictionary Thresholds { get; set; } = new(); public virtual List SupportedDamageStates { diff --git a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalRouterComponent.cs b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalRouterComponent.cs index d03330d41b..273a71ae5a 100644 --- a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalRouterComponent.cs +++ b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalRouterComponent.cs @@ -10,7 +10,7 @@ namespace Content.Shared.GameObjects.Components.Disposal { public override string Name => "DisposalRouter"; - public static readonly Regex TagRegex = new Regex("^[a-zA-Z0-9, ]*$", RegexOptions.Compiled); + public static readonly Regex TagRegex = new("^[a-zA-Z0-9, ]*$", RegexOptions.Compiled); [Serializable, NetSerializable] public class DisposalRouterUserInterfaceState : BoundUserInterfaceState diff --git a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalTaggerComponent.cs b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalTaggerComponent.cs index 76b1b353c2..48b035c1f7 100644 --- a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalTaggerComponent.cs +++ b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalTaggerComponent.cs @@ -11,7 +11,7 @@ namespace Content.Shared.GameObjects.Components.Disposal { public override string Name => "DisposalTagger"; - public static readonly Regex TagRegex = new Regex("^[a-zA-Z0-9 ]*$", RegexOptions.Compiled); + public static readonly Regex TagRegex = new("^[a-zA-Z0-9 ]*$", RegexOptions.Compiled); [Serializable, NetSerializable] public class DisposalTaggerUserInterfaceState : BoundUserInterfaceState diff --git a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs index f66cafaf14..d777c2d786 100644 --- a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs +++ b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs @@ -16,7 +16,7 @@ namespace Content.Shared.GameObjects.Components.Disposal { public override string Name => "DisposalUnit"; - private readonly List _intersecting = new List(); + private readonly List _intersecting = new(); [ViewVariables] public bool Anchored => diff --git a/Content.Shared/GameObjects/Components/Inventory/InventoryTemplates.cs b/Content.Shared/GameObjects/Components/Inventory/InventoryTemplates.cs index 457c0c19ef..1d5e8a753e 100644 --- a/Content.Shared/GameObjects/Components/Inventory/InventoryTemplates.cs +++ b/Content.Shared/GameObjects/Components/Inventory/InventoryTemplates.cs @@ -26,7 +26,7 @@ namespace Content.Shared.GameObjects.Components.Inventory { public override string InterfaceControllerTypeName => "HumanInventoryInterfaceController"; - private static readonly Dictionary _slotDrawingOrder = new Dictionary + private static readonly Dictionary _slotDrawingOrder = new() { {Slots.POCKET1, 13}, {Slots.POCKET2, 12}, diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedAlertsComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedAlertsComponent.cs index dff93e22b7..162dacd1c5 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedAlertsComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedAlertsComponent.cs @@ -27,7 +27,7 @@ namespace Content.Shared.GameObjects.Components.Mobs public override uint? NetID => ContentNetIDs.ALERTS; [ViewVariables] - private Dictionary _alerts = new Dictionary(); + private Dictionary _alerts = new(); /// true iff an alert of the indicated alert category is currently showing public bool IsShowingAlertCategory(AlertCategory alertCategory) diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs index 3ee301ab96..77c65c53c8 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs @@ -27,7 +27,7 @@ namespace Content.Shared.GameObjects.Components.Mobs public string ID { get; } [ViewVariables(VVAccess.ReadWrite)] - public List Parameters { get; } = new List(); + public List Parameters { get; } = new(); public OverlayContainer([NotNull] string id) { diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs index c168a9056e..9620d186ae 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedStunnableComponent.cs @@ -44,7 +44,7 @@ namespace Content.Shared.GameObjects.Components.Mobs private string _stunAlertId; - protected CancellationTokenSource StatusRemoveCancellation = new CancellationTokenSource(); + protected CancellationTokenSource StatusRemoveCancellation = new(); [ViewVariables] protected float WalkModifierOverride = 0f; [ViewVariables] protected float RunModifierOverride = 0f; diff --git a/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs b/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs index 0276a9040b..6e79a32faa 100644 --- a/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs +++ b/Content.Shared/GameObjects/Components/Movement/SharedSlipperyComponent.cs @@ -23,7 +23,7 @@ namespace Content.Shared.GameObjects.Components.Movement /// The list of entities that have been slipped by this component, /// and which have not stopped colliding with its owner yet. /// - protected readonly List _slipped = new List(); + protected readonly List _slipped = new(); /// /// How many seconds the mob will be paralyzed for. diff --git a/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs index 14fd21a913..f77fe025e6 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs @@ -14,7 +14,7 @@ namespace Content.Shared.GameObjects.Components.Research public override string Name => "LatheDatabase"; public override uint? NetID => ContentNetIDs.LATHE_DATABASE; - private readonly List _recipes = new List(); + private readonly List _recipes = new(); /// /// Removes all recipes from the database if it's not static. diff --git a/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs index ceffd45057..b30e5ed759 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs @@ -15,7 +15,7 @@ namespace Content.Shared.GameObjects.Components.Research public override string Name => "ProtolatheDatabase"; public sealed override uint? NetID => ContentNetIDs.PROTOLATHE_DATABASE; - private readonly List _protolatheRecipes = new List(); + private readonly List _protolatheRecipes = new(); /// /// A full list of recipes this protolathe can print. diff --git a/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs index 4a573270b0..b4ebcd6f79 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs @@ -14,7 +14,7 @@ namespace Content.Shared.GameObjects.Components.Research public override string Name => "TechnologyDatabase"; public override uint? NetID => ContentNetIDs.TECHNOLOGY_DATABASE; - protected List _technologies = new List(); + protected List _technologies = new(); /// /// A read-only list of unlocked technologies. diff --git a/Content.Shared/GameObjects/Components/VendingMachines/SharedVendingMachineComponent.cs b/Content.Shared/GameObjects/Components/VendingMachines/SharedVendingMachineComponent.cs index 76a689abd7..e80da037cf 100644 --- a/Content.Shared/GameObjects/Components/VendingMachines/SharedVendingMachineComponent.cs +++ b/Content.Shared/GameObjects/Components/VendingMachines/SharedVendingMachineComponent.cs @@ -13,7 +13,7 @@ namespace Content.Shared.GameObjects.Components.VendingMachines public override uint? NetID => ContentNetIDs.VENDING_MACHINE; [ViewVariables] - public List Inventory = new List(); + public List Inventory = new(); [Serializable, NetSerializable] public enum VendingMachineVisuals diff --git a/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs b/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs index 2e3af0e47b..577ce979e5 100644 --- a/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/Atmos/SharedGasTileOverlaySystem.cs @@ -16,7 +16,7 @@ namespace Content.Shared.GameObjects.EntitySystems.Atmos public static Vector2i GetGasChunkIndices(Vector2i indices) { - return new Vector2i((int) Math.Floor((float) indices.X / ChunkSize) * ChunkSize, (int) MathF.Floor((float) indices.Y / ChunkSize) * ChunkSize); + return new((int) Math.Floor((float) indices.X / ChunkSize) * ChunkSize, (int) MathF.Floor((float) indices.Y / ChunkSize) * ChunkSize); } [Serializable, NetSerializable] diff --git a/Content.Shared/GameObjects/EntitySystems/SharedPullingSystem.cs b/Content.Shared/GameObjects/EntitySystems/SharedPullingSystem.cs index bc4d2e1f55..edc0c29262 100644 --- a/Content.Shared/GameObjects/EntitySystems/SharedPullingSystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/SharedPullingSystem.cs @@ -23,7 +23,7 @@ namespace Content.Shared.GameObjects.EntitySystems /// A mapping of pullers to the entity that they are pulling. /// private readonly Dictionary _pullers = - new Dictionary(); + new(); public override void Initialize() { diff --git a/Content.Shared/GameObjects/Verbs/VerbCategoryData.cs b/Content.Shared/GameObjects/Verbs/VerbCategoryData.cs index ad555cd447..4bf8fc22e6 100644 --- a/Content.Shared/GameObjects/Verbs/VerbCategoryData.cs +++ b/Content.Shared/GameObjects/Verbs/VerbCategoryData.cs @@ -18,7 +18,7 @@ namespace Content.Shared.GameObjects.Verbs public static implicit operator VerbCategoryData((string name, string icon) tuple) { - return new VerbCategoryData(tuple.name, tuple.icon == null ? null : new SpriteSpecifier.Texture(new ResourcePath(tuple.icon))); + return new(tuple.name, tuple.icon == null ? null : new SpriteSpecifier.Texture(new ResourcePath(tuple.icon))); } } } diff --git a/Content.Shared/Preferences/Appearance/HairStyles.cs b/Content.Shared/Preferences/Appearance/HairStyles.cs index a0461a4cdd..2ff05166fc 100644 --- a/Content.Shared/Preferences/Appearance/HairStyles.cs +++ b/Content.Shared/Preferences/Appearance/HairStyles.cs @@ -11,7 +11,7 @@ namespace Content.Shared.Preferences.Appearance public const string DefaultHairStyle = "Bald"; public const string DefaultFacialHairStyle = "Shaved"; - public static readonly Dictionary HairStylesMap = new Dictionary + public static readonly Dictionary HairStylesMap = new() { {"Afro", "afro"}, {"Afro 2", "afro2"}, @@ -190,7 +190,7 @@ namespace Content.Shared.Preferences.Appearance {"Wisp", "wisp"}, }; - public static readonly Dictionary FacialHairStylesMap = new Dictionary() + public static readonly Dictionary FacialHairStylesMap = new() { {"Beard (Abraham Lincoln)", "abe"}, {"Beard (Broken Man)", "brokenman"}, diff --git a/Content.Shared/Preferences/HumanoidCharacterAppearance.cs b/Content.Shared/Preferences/HumanoidCharacterAppearance.cs index f28814c0fd..0c06fd1570 100644 --- a/Content.Shared/Preferences/HumanoidCharacterAppearance.cs +++ b/Content.Shared/Preferences/HumanoidCharacterAppearance.cs @@ -36,38 +36,37 @@ namespace Content.Shared.Preferences public HumanoidCharacterAppearance WithHairStyleName(string newName) { - return new HumanoidCharacterAppearance(newName, HairColor, FacialHairStyleName, FacialHairColor, EyeColor, SkinColor); + return new(newName, HairColor, FacialHairStyleName, FacialHairColor, EyeColor, SkinColor); } public HumanoidCharacterAppearance WithHairColor(Color newColor) { - return new HumanoidCharacterAppearance(HairStyleName, newColor, FacialHairStyleName, FacialHairColor, EyeColor, SkinColor); + return new(HairStyleName, newColor, FacialHairStyleName, FacialHairColor, EyeColor, SkinColor); } public HumanoidCharacterAppearance WithFacialHairStyleName(string newName) { - return new HumanoidCharacterAppearance(HairStyleName, HairColor, newName, FacialHairColor, EyeColor, SkinColor); + return new(HairStyleName, HairColor, newName, FacialHairColor, EyeColor, SkinColor); } public HumanoidCharacterAppearance WithFacialHairColor(Color newColor) { - return new HumanoidCharacterAppearance(HairStyleName, HairColor, FacialHairStyleName, newColor, EyeColor, SkinColor); + return new(HairStyleName, HairColor, FacialHairStyleName, newColor, EyeColor, SkinColor); } public HumanoidCharacterAppearance WithEyeColor(Color newColor) { - return new HumanoidCharacterAppearance(HairStyleName, HairColor, FacialHairStyleName, FacialHairColor, newColor, SkinColor); + return new(HairStyleName, HairColor, FacialHairStyleName, FacialHairColor, newColor, SkinColor); } public HumanoidCharacterAppearance WithSkinColor(Color newColor) { - return new HumanoidCharacterAppearance(HairStyleName, HairColor, FacialHairStyleName, FacialHairColor, EyeColor, newColor); + return new(HairStyleName, HairColor, FacialHairStyleName, FacialHairColor, EyeColor, newColor); } public static HumanoidCharacterAppearance Default() { - return new HumanoidCharacterAppearance - ( + return new( "Bald", Color.Black, "Shaved", @@ -104,7 +103,7 @@ namespace Content.Shared.Preferences public static Color ClampColor(Color color) { - return new Color(color.RByte, color.GByte, color.BByte); + return new(color.RByte, color.GByte, color.BByte); } public static HumanoidCharacterAppearance EnsureValid(HumanoidCharacterAppearance appearance) diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index c1591f590b..76aac3dd49 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -88,27 +88,27 @@ namespace Content.Shared.Preferences public HumanoidCharacterProfile WithName(string name) { - return new HumanoidCharacterProfile(name, Age, Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); + return new(name, Age, Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); } public HumanoidCharacterProfile WithAge(int age) { - return new HumanoidCharacterProfile(Name, Math.Clamp(age, MinimumAge, MaximumAge), Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); + return new(Name, Math.Clamp(age, MinimumAge, MaximumAge), Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); } public HumanoidCharacterProfile WithSex(Sex sex) { - return new HumanoidCharacterProfile(Name, Age, sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); + return new(Name, Age, sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); } public HumanoidCharacterProfile WithCharacterAppearance(HumanoidCharacterAppearance appearance) { - return new HumanoidCharacterProfile(Name, Age, Sex, appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); + return new(Name, Age, Sex, appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); } public HumanoidCharacterProfile WithJobPriorities(IReadOnlyDictionary jobPriorities) { - return new HumanoidCharacterProfile( + return new( Name, Age, Sex, @@ -135,12 +135,12 @@ namespace Content.Shared.Preferences public HumanoidCharacterProfile WithPreferenceUnavailable(PreferenceUnavailableMode mode) { - return new HumanoidCharacterProfile(Name, Age, Sex, Appearance, _jobPriorities, mode, _antagPreferences); + return new(Name, Age, Sex, Appearance, _jobPriorities, mode, _antagPreferences); } public HumanoidCharacterProfile WithAntagPreferences(IReadOnlyList antagPreferences) { - return new HumanoidCharacterProfile( + return new( Name, Age, Sex, diff --git a/Content.Shared/Utility/EntityCoordinatesExtensions.cs b/Content.Shared/Utility/EntityCoordinatesExtensions.cs index 1e36f4f7b1..173ba12c86 100644 --- a/Content.Shared/Utility/EntityCoordinatesExtensions.cs +++ b/Content.Shared/Utility/EntityCoordinatesExtensions.cs @@ -10,12 +10,12 @@ namespace Content.Shared.Utility { public static EntityCoordinates ToCoordinates(this EntityUid id, Vector2 offset) { - return new EntityCoordinates(id, offset); + return new(id, offset); } public static EntityCoordinates ToCoordinates(this EntityUid id, float x, float y) { - return new EntityCoordinates(id, x, y); + return new(id, x, y); } public static EntityCoordinates ToCoordinates(this EntityUid id) @@ -30,7 +30,7 @@ namespace Content.Shared.Utility public static EntityCoordinates ToCoordinates(this IEntity entity, float x, float y) { - return new EntityCoordinates(entity.Uid, x, y); + return new(entity.Uid, x, y); } public static EntityCoordinates ToCoordinates(this IEntity entity) diff --git a/Content.Tests/Client/ClickMapTest.cs b/Content.Tests/Client/ClickMapTest.cs index ff3b26a016..f3c6286c37 100644 --- a/Content.Tests/Client/ClickMapTest.cs +++ b/Content.Tests/Client/ClickMapTest.cs @@ -13,10 +13,10 @@ namespace Content.Tests.Client { var img = new Image(2, 2) { - [0, 0] = new Rgba32(0, 0, 0, 0f), - [1, 0] = new Rgba32(0, 0, 0, 1f), - [0, 1] = new Rgba32(0, 0, 0, 1f), - [1, 1] = new Rgba32(0, 0, 0, 0f) + [0, 0] = new(0, 0, 0, 0f), + [1, 0] = new(0, 0, 0, 1f), + [0, 1] = new(0, 0, 0, 1f), + [1, 1] = new(0, 0, 0, 0f) }; var clickMap = ClickMapManager.ClickMap.FromImage(img, 0.5f); @@ -32,10 +32,10 @@ namespace Content.Tests.Client { var img = new Image(2, 2) { - [0, 0] = new Rgba32(0, 0, 0, 0f), - [1, 0] = new Rgba32(0, 0, 0, 0.25f), - [0, 1] = new Rgba32(0, 0, 0, 0.75f), - [1, 1] = new Rgba32(0, 0, 0, 1f) + [0, 0] = new(0, 0, 0, 0f), + [1, 0] = new(0, 0, 0, 0.25f), + [0, 1] = new(0, 0, 0, 0.75f), + [1, 1] = new(0, 0, 0, 1f) }; var clickMap = ClickMapManager.ClickMap.FromImage(img, 0.5f); diff --git a/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs b/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs index 6aaf131c0c..0fe04590dd 100644 --- a/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs +++ b/Content.Tests/Server/Preferences/ServerDbSqliteTests.cs @@ -22,7 +22,7 @@ namespace Content.Tests.Server.Preferences private static HumanoidCharacterProfile CharlieCharlieson() { - return new HumanoidCharacterProfile( + return new( "Charlie Charlieson", 21, Sex.Male, @@ -87,7 +87,7 @@ namespace Content.Tests.Server.Preferences private static NetUserId NewUserId() { - return new NetUserId(Guid.NewGuid()); + return new(Guid.NewGuid()); } } }