diff --git a/Content.Client/Arcade/UI/BlockGameBoundUserInterface.cs b/Content.Client/Arcade/UI/BlockGameBoundUserInterface.cs index ca5b24b518..568784fd69 100644 --- a/Content.Client/Arcade/UI/BlockGameBoundUserInterface.cs +++ b/Content.Client/Arcade/UI/BlockGameBoundUserInterface.cs @@ -46,7 +46,7 @@ namespace Content.Client.Arcade.UI _menu?.SetUsability(userMessage.IsPlayer); break; case BlockGameMessages.BlockGameSetScreenMessage statusMessage: - if (statusMessage.isStarted) _menu?.SetStarted(); + if (statusMessage.IsStarted) _menu?.SetStarted(); _menu?.SetScreen(statusMessage.Screen); if (statusMessage is BlockGameMessages.BlockGameGameOverScreenMessage gameOverScreenMessage) _menu?.SetGameoverInfo(gameOverScreenMessage.FinalScore, gameOverScreenMessage.LocalPlacement, gameOverScreenMessage.GlobalPlacement); diff --git a/Content.Client/Computer/ComputerBoundUserInterface.cs b/Content.Client/Computer/ComputerBoundUserInterface.cs index ddf73fc4a6..c402942d0a 100644 --- a/Content.Client/Computer/ComputerBoundUserInterface.cs +++ b/Content.Client/Computer/ComputerBoundUserInterface.cs @@ -9,16 +9,16 @@ namespace Content.Client.Computer /// ComputerBoundUserInterface shunts all sorts of responsibilities that are in the BoundUserInterface for architectural reasons into the Window. /// NOTE: Despite the name, ComputerBoundUserInterface does not and will not care about things like power. /// - public class ComputerBoundUserInterface : ComputerBoundUserInterfaceBase where W : BaseWindow, IComputerWindow, new() where S : BoundUserInterfaceState + public class ComputerBoundUserInterface : ComputerBoundUserInterfaceBase where TWindow : BaseWindow, IComputerWindow, new() where TState : BoundUserInterfaceState { [Dependency] private readonly IDynamicTypeFactory _dynamicTypeFactory = default!; - private W? _window; + private TWindow? _window; protected override void Open() { base.Open(); - _window = (W) _dynamicTypeFactory.CreateInstance(typeof(W)); + _window = (TWindow) _dynamicTypeFactory.CreateInstance(typeof(TWindow)); _window.SetupComputerWindow(this); _window.OnClose += Close; _window.OpenCentered(); @@ -36,7 +36,7 @@ namespace Content.Client.Computer return; } - _window.UpdateState((S) state); + _window.UpdateState((TState) state); } protected override void Dispose(bool disposing) @@ -64,10 +64,10 @@ namespace Content.Client.Computer } } - public interface IComputerWindow + public interface IComputerWindow { void SetupComputerWindow(ComputerBoundUserInterfaceBase cb) {} - void UpdateState(S state) {} + void UpdateState(TState state) {} } } diff --git a/Content.Client/Decals/DecalOverlay.cs b/Content.Client/Decals/DecalOverlay.cs index 5a8169b957..bbd20d1612 100644 --- a/Content.Client/Decals/DecalOverlay.cs +++ b/Content.Client/Decals/DecalOverlay.cs @@ -4,10 +4,8 @@ using Robust.Client.Graphics; using Robust.Client.Utility; using Robust.Shared.Enums; using Robust.Shared.Map; -using Robust.Shared.Maths; using Robust.Shared.Prototypes; using Robust.Shared.Utility; -using Robust.Shared.Maths; namespace Content.Client.Decals { diff --git a/Content.Client/Inventory/StrippableBoundUserInterface.cs b/Content.Client/Inventory/StrippableBoundUserInterface.cs index b690abbc76..2dd2b13579 100644 --- a/Content.Client/Inventory/StrippableBoundUserInterface.cs +++ b/Content.Client/Inventory/StrippableBoundUserInterface.cs @@ -28,7 +28,7 @@ namespace Content.Client.Inventory { base.Open(); - _strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", Name: IoCManager.Resolve().GetComponent(Owner.Owner).EntityName))}"); + _strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", IoCManager.Resolve().GetComponent(Owner.Owner).EntityName))}"); _strippingMenu.OnClose += Close; _strippingMenu.OpenCentered(); diff --git a/Content.Client/Lathe/Components/LatheDatabaseComponent.cs b/Content.Client/Lathe/Components/LatheDatabaseComponent.cs index c2f38f909f..f82d987ec1 100644 --- a/Content.Client/Lathe/Components/LatheDatabaseComponent.cs +++ b/Content.Client/Lathe/Components/LatheDatabaseComponent.cs @@ -20,9 +20,9 @@ namespace Content.Client.Lathe.Components Clear(); - foreach (var ID in state.Recipes) + foreach (var id in state.Recipes) { - if (!_prototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe)) continue; + if (!_prototypeManager.TryIndex(id, out LatheRecipePrototype? recipe)) continue; AddRecipe(recipe); } } diff --git a/Content.Client/Lathe/Components/ProtolatheDatabaseComponent.cs b/Content.Client/Lathe/Components/ProtolatheDatabaseComponent.cs index d37ee37c2e..f7d8799a3c 100644 --- a/Content.Client/Lathe/Components/ProtolatheDatabaseComponent.cs +++ b/Content.Client/Lathe/Components/ProtolatheDatabaseComponent.cs @@ -26,9 +26,9 @@ namespace Content.Client.Lathe.Components Clear(); - foreach (var ID in state.Recipes) + foreach (var id in state.Recipes) { - if(!_prototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe)) continue; + if(!_prototypeManager.TryIndex(id, out LatheRecipePrototype? recipe)) continue; AddRecipe(recipe); } diff --git a/Content.Client/MedicalScanner/UI/MedicalScannerWindow.xaml.cs b/Content.Client/MedicalScanner/UI/MedicalScannerWindow.xaml.cs index 485e9b9070..fb7c928529 100644 --- a/Content.Client/MedicalScanner/UI/MedicalScannerWindow.xaml.cs +++ b/Content.Client/MedicalScanner/UI/MedicalScannerWindow.xaml.cs @@ -36,7 +36,7 @@ namespace Content.Client.MedicalScanner.UI } else { - text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", Name: entities.GetComponent(state.Entity.Value).EntityName))}\n"); + text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", entities.GetComponent(state.Entity.Value).EntityName))}\n"); var totalDamage = state.DamagePerType.Values.Sum(); diff --git a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs index 1e91abd42f..fda5cd263d 100644 --- a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs +++ b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs @@ -1,4 +1,4 @@ -using Content.Client.VendingMachines.UI; +using Content.Client.VendingMachines.UI; using Content.Shared.VendingMachines; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; @@ -38,9 +38,9 @@ namespace Content.Client.VendingMachines _menu.OpenCentered(); } - public void Eject(string ID) + public void Eject(string id) { - SendMessage(new VendingMachineEjectMessage(ID)); + SendMessage(new VendingMachineEjectMessage(id)); } protected override void ReceiveMessage(BoundUserInterfaceMessage message) diff --git a/Content.IntegrationTests/Tests/HumanInventoryUniformSlotsTest.cs b/Content.IntegrationTests/Tests/HumanInventoryUniformSlotsTest.cs index 06d5ced0de..973d8e4a07 100644 --- a/Content.IntegrationTests/Tests/HumanInventoryUniformSlotsTest.cs +++ b/Content.IntegrationTests/Tests/HumanInventoryUniformSlotsTest.cs @@ -64,7 +64,6 @@ namespace Content.IntegrationTests.Tests EntityUid uniform = default; EntityUid idCard = default; EntityUid pocketItem = default; - InventoryComponent inventory = null; InventorySystem invSystem = default!; diff --git a/Content.Server.Database/NpgsqlTypeMapping.cs b/Content.Server.Database/NpgsqlTypeMapping.cs index 5552ae1a6a..204cdc294c 100644 --- a/Content.Server.Database/NpgsqlTypeMapping.cs +++ b/Content.Server.Database/NpgsqlTypeMapping.cs @@ -1,4 +1,4 @@ -using System.Linq.Expressions; +using System.Linq.Expressions; using System.Net; using System.Reflection; using Microsoft.EntityFrameworkCore.Storage; @@ -42,26 +42,27 @@ namespace Content.Server.Database } protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters) - => new NpgsqlInetWithMaskTypeMapping(parameters); + { + return new NpgsqlInetWithMaskTypeMapping(parameters); + } protected override string GenerateNonNullSqlLiteral(object value) { - var cidr = ((IPAddress Address, int Subnet)) value; - return $"INET '{cidr.Address}/{cidr.Subnet}'"; + var (address, subnet) = ((IPAddress, int)) value; + return $"INET '{address}/{subnet}'"; } public override Expression GenerateCodeLiteral(object value) { - var cidr = ((IPAddress Address, int Subnet)) value; + var (address, subnet) = ((IPAddress, int)) value; return Expression.New( Constructor, - Expression.Call(ParseMethod, Expression.Constant(cidr.Address.ToString())), - Expression.Constant(cidr.Subnet)); + Expression.Call(ParseMethod, Expression.Constant(address.ToString())), + Expression.Constant(subnet)); } - static readonly MethodInfo ParseMethod = typeof(IPAddress).GetMethod("Parse", new[] {typeof(string)})!; - - static readonly ConstructorInfo Constructor = + private static readonly MethodInfo ParseMethod = typeof(IPAddress).GetMethod("Parse", new[] {typeof(string)})!; + private static readonly ConstructorInfo Constructor = typeof((IPAddress, int)).GetConstructor(new[] {typeof(IPAddress), typeof(int)})!; } } diff --git a/Content.Server.Database/SnakeCaseNaming.cs b/Content.Server.Database/SnakeCaseNaming.cs index 959adb850d..f28c6f4632 100644 --- a/Content.Server.Database/SnakeCaseNaming.cs +++ b/Content.Server.Database/SnakeCaseNaming.cs @@ -21,7 +21,9 @@ namespace Content.Server.Database } public void ApplyServices(IServiceCollection services) - => services.AddSnakeCase(); + { + services.AddSnakeCase(); + } public void Validate(IDbContextOptions options) {} @@ -33,7 +35,10 @@ namespace Content.Server.Database public override string LogFragment => "Snake Case Extension"; - public override int GetServiceProviderHashCode() => 0; + public override int GetServiceProviderHashCode() + { + return 0; + } public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other) { @@ -154,7 +159,9 @@ namespace Content.Server.Database public virtual void ProcessPropertyAdded( IConventionPropertyBuilder propertyBuilder, IConventionContext context) - => RewriteColumnName(propertyBuilder); + { + RewriteColumnName(propertyBuilder); + } public void ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder relationshipBuilder, IConventionContext context) { @@ -237,7 +244,9 @@ namespace Content.Server.Database public void ProcessForeignKeyAdded( IConventionForeignKeyBuilder relationshipBuilder, IConventionContext context) - => relationshipBuilder.HasConstraintName(RewriteName(relationshipBuilder.Metadata.GetDefaultName())); + { + relationshipBuilder.HasConstraintName(RewriteName(relationshipBuilder.Metadata.GetDefaultName())); + } public void ProcessKeyAdded(IConventionKeyBuilder keyBuilder, IConventionContext context) { @@ -289,7 +298,7 @@ namespace Content.Server.Database } } - private void RewriteColumnName(IConventionPropertyBuilder propertyBuilder) + private static void RewriteColumnName(IConventionPropertyBuilder propertyBuilder) { var property = propertyBuilder.Metadata; var entityType = property.DeclaringEntityType; diff --git a/Content.Server/AI/Pathfinding/PathfindingChunk.cs b/Content.Server/AI/Pathfinding/PathfindingChunk.cs index 3a71ec13af..2e39e000cb 100644 --- a/Content.Server/AI/Pathfinding/PathfindingChunk.cs +++ b/Content.Server/AI/Pathfinding/PathfindingChunk.cs @@ -81,10 +81,10 @@ namespace Content.Server.AI.Pathfinding } } - public bool InBounds(Vector2i Vector2i) + public bool InBounds(Vector2i vector) { - if (Vector2i.X < _indices.X || Vector2i.Y < _indices.Y) return false; - if (Vector2i.X >= _indices.X + ChunkSize || Vector2i.Y >= _indices.Y + ChunkSize) return false; + if (vector.X < _indices.X || vector.Y < _indices.Y) return false; + if (vector.X >= _indices.X + ChunkSize || vector.Y >= _indices.Y + ChunkSize) return false; return true; } diff --git a/Content.Server/Actions/Actions/DisarmAction.cs b/Content.Server/Actions/Actions/DisarmAction.cs index 0fb7209a16..7e9ac324a6 100644 --- a/Content.Server/Actions/Actions/DisarmAction.cs +++ b/Content.Server/Actions/Actions/DisarmAction.cs @@ -83,10 +83,10 @@ namespace Content.Server.Actions.Actions SoundSystem.Play(Filter.Pvs(args.Performer), PunchMissSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f)); args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients", - ("performerName", Name: entMan.GetComponent(args.Performer).EntityName), - ("targetName", Name: entMan.GetComponent(args.Target).EntityName))); + ("performerName", entMan.GetComponent(args.Performer).EntityName), + ("targetName", entMan.GetComponent(args.Target).EntityName))); args.Performer.PopupMessageCursor(Loc.GetString("disarm-action-popup-message-cursor", - ("targetName", Name: entMan.GetComponent(args.Target).EntityName))); + ("targetName", entMan.GetComponent(args.Target).EntityName))); system.SendLunge(angle, args.Performer); return; } diff --git a/Content.Server/Administration/BwoinkSystem.cs b/Content.Server/Administration/BwoinkSystem.cs index b89729dc01..bacefd0098 100644 --- a/Content.Server/Administration/BwoinkSystem.cs +++ b/Content.Server/Administration/BwoinkSystem.cs @@ -1,4 +1,3 @@ -#nullable enable using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -22,6 +21,7 @@ using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Network; using Robust.Shared.Utility; +using System.Text.Json.Serialization; namespace Content.Server.Administration { @@ -94,8 +94,8 @@ namespace Content.Server.Administration var payload = new WebhookPayload() { - username = oldMessage.username, - content = oldMessage.content + Username = oldMessage.username, + Content = oldMessage.content }; if (oldMessage.id == string.Empty) @@ -242,14 +242,14 @@ namespace Content.Server.Administration private struct WebhookPayload { - // ReSharper disable once InconsistentNaming - public string username { get; set; } = ""; + [JsonPropertyName("username")] + public string Username { get; set; } = ""; - // ReSharper disable once InconsistentNaming - public string content { get; set; } = ""; + [JsonPropertyName("content")] + public string Content { get; set; } = ""; - // ReSharper disable once InconsistentNaming - public Dictionary allowed_mentions { get; set; } = + [JsonPropertyName("allowed_mentions")] + public Dictionary AllowedMentions { get; set; } = new() { { "parse", Array.Empty() } diff --git a/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs b/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs index a0841e0b3d..9873c54e80 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Content.Server.Atmos.Components; using Content.Shared.Atmos; using Content.Shared.Atmos.EntitySystems; @@ -155,8 +155,8 @@ namespace Content.Server.Atmos.EntitySystems { for (var x = 0; x < LocalViewRange; x++) { - var Vector2i = new Vector2i(baseTile.X + x, baseTile.Y + y); - debugOverlayContent[index++] = ConvertTileToData(_atmosphereSystem.GetTileAtmosphereOrCreateSpace(grid, gam, Vector2i)); + var vector = new Vector2i(baseTile.X + x, baseTile.Y + y); + debugOverlayContent[index++] = ConvertTileToData(_atmosphereSystem.GetTileAtmosphereOrCreateSpace(grid, gam, vector)); } } diff --git a/Content.Server/Botany/Components/PlantHolderComponent.cs b/Content.Server/Botany/Components/PlantHolderComponent.cs index b0c2e0c0c8..99ef0236d2 100644 --- a/Content.Server/Botany/Components/PlantHolderComponent.cs +++ b/Content.Server/Botany/Components/PlantHolderComponent.cs @@ -685,7 +685,7 @@ namespace Content.Server.Botany.Components } user.PopupMessageCursor(Loc.GetString("plant-holder-component-already-seeded-message", - ("name", Name: _entMan.GetComponent(Owner).EntityName))); + ("name", _entMan.GetComponent(Owner).EntityName))); return false; } @@ -694,9 +694,9 @@ namespace Content.Server.Botany.Components if (WeedLevel > 0) { user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-weeds-message", - ("name", Name: _entMan.GetComponent(Owner).EntityName))); + ("name", _entMan.GetComponent(Owner).EntityName))); user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-weeds-others-message", - ("otherName", Name: _entMan.GetComponent(user).EntityName))); + ("otherName", _entMan.GetComponent(user).EntityName))); WeedLevel = 0; UpdateSprite(); } @@ -713,9 +713,9 @@ namespace Content.Server.Botany.Components if (Seed != null) { user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-plant-message", - ("name", Name: _entMan.GetComponent(Owner).EntityName))); + ("name", _entMan.GetComponent(Owner).EntityName))); user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-plant-others-message", - ("name", Name: _entMan.GetComponent(user).EntityName))); + ("name", _entMan.GetComponent(user).EntityName))); RemovePlant(); } else diff --git a/Content.Server/Botany/Components/SeedExtractorComponent.cs b/Content.Server/Botany/Components/SeedExtractorComponent.cs index c2a95b37ce..82b1d1825d 100644 --- a/Content.Server/Botany/Components/SeedExtractorComponent.cs +++ b/Content.Server/Botany/Components/SeedExtractorComponent.cs @@ -30,7 +30,7 @@ namespace Content.Server.Botany.Components if (_entMan.TryGetComponent(eventArgs.Using, out ProduceComponent? produce) && produce.Seed != null) { - eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", Name: _entMan.GetComponent(eventArgs.Using).EntityName))); + eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", _entMan.GetComponent(eventArgs.Using).EntityName))); _entMan.QueueDeleteEntity(eventArgs.Using); diff --git a/Content.Server/Chat/Managers/ChatManager.cs b/Content.Server/Chat/Managers/ChatManager.cs index d167487f97..cb1576e6e9 100644 --- a/Content.Server/Chat/Managers/ChatManager.cs +++ b/Content.Server/Chat/Managers/ChatManager.cs @@ -196,7 +196,7 @@ namespace Content.Server.Chat.Managers var msg = _netManager.CreateNetMessage(); msg.Channel = ChatChannel.Local; msg.Message = message; - msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", Name: _entManager.GetComponent(source).EntityName)); + msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", _entManager.GetComponent(source).EntityName)); msg.SenderEntity = source; msg.HideChat = hideChat; _netManager.ServerSendToMany(msg, clients); @@ -233,7 +233,7 @@ namespace Content.Server.Chat.Managers var msg = _netManager.CreateNetMessage(); msg.Channel = ChatChannel.Emotes; msg.Message = action; - msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName",Name: _entManager.GetComponent(source).EntityName)); + msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName", _entManager.GetComponent(source).EntityName)); msg.SenderEntity = source; _netManager.ServerSendToMany(msg, clients); } diff --git a/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs b/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs index 21adbd0c67..a959d262c3 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs @@ -11,16 +11,16 @@ namespace Content.Server.Chemistry.EntitySystems { public class ChemicalReactionSystem : SharedChemicalReactionSystem { - protected override void OnReaction(Solution solution, ReactionPrototype reaction, ReagentPrototype randomReagent, EntityUid Owner, FixedPoint2 unitReactions) + protected override void OnReaction(Solution solution, ReactionPrototype reaction, ReagentPrototype randomReagent, EntityUid owner, FixedPoint2 unitReactions) { - base.OnReaction(solution, reaction, randomReagent, Owner, unitReactions); + base.OnReaction(solution, reaction, randomReagent, owner, unitReactions); - var coordinates = Transform(Owner).Coordinates; + var coordinates = Transform(owner).Coordinates; _logSystem.Add(LogType.ChemicalReaction, reaction.Impact, - $"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(Owner):metabolizer} at {coordinates}"); + $"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(owner):metabolizer} at {coordinates}"); - SoundSystem.Play(Filter.Pvs(Owner, entityManager:EntityManager), reaction.Sound.GetSound(), Owner); + SoundSystem.Play(Filter.Pvs(owner, entityManager:EntityManager), reaction.Sound.GetSound(), owner); } } } diff --git a/Content.Server/Climbing/Components/ClimbableComponent.cs b/Content.Server/Climbing/Components/ClimbableComponent.cs index 84db4dba7c..91bd34290d 100644 --- a/Content.Server/Climbing/Components/ClimbableComponent.cs +++ b/Content.Server/Climbing/Components/ClimbableComponent.cs @@ -13,6 +13,7 @@ using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Log; using Robust.Shared.Maths; +using Robust.Shared.Physics; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -160,7 +161,7 @@ namespace Content.Server.Climbing.Components var result = await EntitySystem.Get().WaitDoAfter(doAfterEventArgs); - if (result != DoAfterStatus.Cancelled && _entities.TryGetComponent(entityToMove, out PhysicsComponent? body) && body.Fixtures.Count >= 1) + if (result != DoAfterStatus.Cancelled && _entities.TryGetComponent(entityToMove, out FixturesComponent? body) && body.FixtureCount >= 1) { var entityPos = _entities.GetComponent(entityToMove).WorldPosition; diff --git a/Content.Server/Construction/Conditions/AirlockBolted.cs b/Content.Server/Construction/Conditions/AirlockBolted.cs index db5c289747..8b83ff9b51 100644 --- a/Content.Server/Construction/Conditions/AirlockBolted.cs +++ b/Content.Server/Construction/Conditions/AirlockBolted.cs @@ -38,9 +38,9 @@ namespace Content.Server.Construction.Conditions if (airlock.BoltsDown != Value) { if (Value == true) - args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", Name: entMan.GetComponent(entity).EntityName)) + "\n"); + args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", entMan.GetComponent(entity).EntityName)) + "\n"); else - args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", Name: entMan.GetComponent(entity).EntityName)) + "\n"); + args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", entMan.GetComponent(entity).EntityName)) + "\n"); return true; } diff --git a/Content.Server/Construction/Conditions/DoorWelded.cs b/Content.Server/Construction/Conditions/DoorWelded.cs index 2ba8f99c92..817cecb599 100644 --- a/Content.Server/Construction/Conditions/DoorWelded.cs +++ b/Content.Server/Construction/Conditions/DoorWelded.cs @@ -36,9 +36,9 @@ namespace Content.Server.Construction.Conditions if (door.IsWeldedShut != Welded) { if (Welded == true) - args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", Name: entMan.GetComponent(entity).EntityName)) + "\n"); + args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", entMan.GetComponent(entity).EntityName)) + "\n"); else - args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", Name: entMan.GetComponent(entity).EntityName)) + "\n"); + args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", entMan.GetComponent(entity).EntityName)) + "\n"); return true; } diff --git a/Content.Server/Ghost/Components/GhostRadioComponent.cs b/Content.Server/Ghost/Components/GhostRadioComponent.cs index 382424b138..e612f8069a 100644 --- a/Content.Server/Ghost/Components/GhostRadioComponent.cs +++ b/Content.Server/Ghost/Components/GhostRadioComponent.cs @@ -36,7 +36,7 @@ namespace Content.Server.Ghost.Components msg.Channel = ChatChannel.Radio; msg.Message = message; //Square brackets are added here to avoid issues with escaping - msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: _entMan.GetComponent(speaker).EntityName)); + msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", _entMan.GetComponent(speaker).EntityName)); _netManager.ServerSendMessage(msg, playerChannel); } diff --git a/Content.Server/Hands/Components/HandsComponent.cs b/Content.Server/Hands/Components/HandsComponent.cs index 82e44dcf1f..bce0b1f01a 100644 --- a/Content.Server/Hands/Components/HandsComponent.cs +++ b/Content.Server/Hands/Components/HandsComponent.cs @@ -74,13 +74,13 @@ namespace Content.Server.Hands.Components if (ActiveHand != null && Drop(ActiveHand, false)) { - source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", Name: _entities.GetComponent(source).EntityName), ("disarmed", Name: _entities.GetComponent(target).EntityName))); - source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", Name: _entities.GetComponent(target).EntityName))); + source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", _entities.GetComponent(source).EntityName), ("disarmed", _entities.GetComponent(target).EntityName))); + source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", _entities.GetComponent(target).EntityName))); } else { - source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", Name: _entities.GetComponent(source).EntityName), ("shoved", Name: _entities.GetComponent(target).EntityName))); - source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", Name: _entities.GetComponent(target).EntityName))); + source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", _entities.GetComponent(source).EntityName), ("shoved", _entities.GetComponent(target).EntityName))); + source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", _entities.GetComponent(target).EntityName))); } return true; diff --git a/Content.Server/Headset/HeadsetComponent.cs b/Content.Server/Headset/HeadsetComponent.cs index 7ebed04056..5c85c1acfa 100644 --- a/Content.Server/Headset/HeadsetComponent.cs +++ b/Content.Server/Headset/HeadsetComponent.cs @@ -70,7 +70,7 @@ namespace Content.Server.Headset msg.Channel = ChatChannel.Radio; msg.Message = message; //Square brackets are added here to avoid issues with escaping - msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: _entMan.GetComponent(source).EntityName)); + msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", _entMan.GetComponent(source).EntityName)); _netManager.ServerSendMessage(msg, playerChannel); } } diff --git a/Content.Server/Light/Components/LightBulbComponent.cs b/Content.Server/Light/Components/LightBulbComponent.cs index a50a0c49e6..ac21c2a4a2 100644 --- a/Content.Server/Light/Components/LightBulbComponent.cs +++ b/Content.Server/Light/Components/LightBulbComponent.cs @@ -30,13 +30,13 @@ namespace Content.Server.Light.Components public int BurningTemperature = 1400; [DataField("lightEnergy")] - public float lightEnergy = 0.8f; + public float LightEnergy = 0.8f; [DataField("lightRadius")] - public float lightRadius = 10; + public float LightRadius = 10; [DataField("lightSoftness")] - public float lightSoftness = 1; + public float LightSoftness = 1; [DataField("PowerUse")] public int PowerUse = 40; diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index e017f18d31..344b0ddb8b 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -251,7 +251,7 @@ namespace Content.Server.Light.EntitySystems case LightBulbState.Normal: if (powerReceiver.Powered && light.On) { - SetLight(uid, true, lightBulb.Color, light, lightBulb.lightRadius, lightBulb.lightEnergy, lightBulb.lightSoftness); + SetLight(uid, true, lightBulb.Color, light, lightBulb.LightRadius, lightBulb.LightEnergy, lightBulb.LightSoftness); appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.On); var time = _gameTiming.CurTime; if (time > light.LastThunk + ThunkDelay) diff --git a/Content.Server/Lock/LockSystem.cs b/Content.Server/Lock/LockSystem.cs index 0ea9399dd5..e70d63b5bb 100644 --- a/Content.Server/Lock/LockSystem.cs +++ b/Content.Server/Lock/LockSystem.cs @@ -66,7 +66,7 @@ namespace Content.Server.Lock args.PushText(Loc.GetString(lockComp.Locked ? "lock-comp-on-examined-is-locked" : "lock-comp-on-examined-is-unlocked", - ("entityName", Name: EntityManager.GetComponent(lockComp.Owner).EntityName))); + ("entityName", EntityManager.GetComponent(lockComp.Owner).EntityName))); } public bool TryLock(EntityUid uid, EntityUid user, LockComponent? lockComp = null) @@ -80,7 +80,7 @@ namespace Content.Server.Lock if (!HasUserAccess(uid, user, quiet: false)) return false; - lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName",Name: EntityManager.GetComponent(lockComp.Owner).EntityName))); + lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName", EntityManager.GetComponent(lockComp.Owner).EntityName))); lockComp.Locked = true; if(lockComp.LockSound != null) @@ -103,7 +103,7 @@ namespace Content.Server.Lock if (!Resolve(uid, ref lockComp)) return; - lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", Name: EntityManager.GetComponent(lockComp.Owner).EntityName))); + lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", EntityManager.GetComponent(lockComp.Owner).EntityName))); lockComp.Locked = false; if (lockComp.UnlockSound != null) diff --git a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs index d1b4362a68..bbfdd7bd69 100644 --- a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs @@ -263,7 +263,7 @@ namespace Content.Server.Nutrition.EntitySystems if (!drink.Opened) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open", - ("owner", Name: EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); + ("owner", EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); return true; } @@ -274,7 +274,7 @@ namespace Content.Server.Nutrition.EntitySystems drinkSolution.DrainAvailable <= 0) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", - ("entity", Name: EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); + ("entity", EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); return true; } @@ -345,7 +345,7 @@ namespace Content.Server.Nutrition.EntitySystems if (!drink.Opened) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open", - ("owner", Name: EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); + ("owner", EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); return true; } @@ -353,7 +353,7 @@ namespace Content.Server.Nutrition.EntitySystems drinkSolution.DrainAvailable <= 0) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", - ("entity", Name: EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); + ("entity", EntityManager.GetComponent(drink.Owner).EntityName)), uid, Filter.Entities(userUid)); return true; } diff --git a/Content.Server/Radio/Components/IRadio.cs b/Content.Server/Radio/Components/IRadio.cs index cb5077a8ca..cbabdcac4e 100644 --- a/Content.Server/Radio/Components/IRadio.cs +++ b/Content.Server/Radio/Components/IRadio.cs @@ -1,6 +1,5 @@ using Robust.Shared.GameObjects; using System.Collections.Generic; -using Robust.Shared.GameObjects; namespace Content.Server.Radio.Components { diff --git a/Content.Server/Suspicion/SuspicionRoleComponent.cs b/Content.Server/Suspicion/SuspicionRoleComponent.cs index 7fcfc01b2a..0f9e022603 100644 --- a/Content.Server/Suspicion/SuspicionRoleComponent.cs +++ b/Content.Server/Suspicion/SuspicionRoleComponent.cs @@ -160,7 +160,7 @@ namespace Content.Server.Suspicion continue; } - allies.Add((role.Role!.Mind.CharacterName, Uid: role.Owner)); + allies.Add((role.Role!.Mind.CharacterName, role.Owner)); } return new SuspicionRoleComponentState(Role?.Name, Role?.Antagonist, allies.ToArray()); diff --git a/Content.Server/Tabletop/TabletopBackgammonSetup.cs b/Content.Server/Tabletop/TabletopBackgammonSetup.cs index 06f7f16d8d..612cb7887d 100644 --- a/Content.Server/Tabletop/TabletopBackgammonSetup.cs +++ b/Content.Server/Tabletop/TabletopBackgammonSetup.cs @@ -25,19 +25,19 @@ namespace Content.Server.Tabletop const float boardDistanceX = 1.25f; const float pieceDistanceY = 0.80f; - float getXPosition(float distanceFromSide, bool isLeftSide) + float GetXPosition(float distanceFromSide, bool isLeftSide) { var pos = borderLengthX - (distanceFromSide * boardDistanceX); return isLeftSide ? -pos : pos; } - float getYPosition(float positionNumber, bool isTop) + float GetYPosition(float positionNumber, bool isTop) { var pos = borderLengthY - (pieceDistanceY * positionNumber); return isTop ? pos : -pos; } - void addPieces( + void AddPieces( float distanceFromSide, int numberOfPieces, bool isBlackPiece, @@ -46,26 +46,26 @@ namespace Content.Server.Tabletop { for (int i = 0; i < numberOfPieces; i++) { - session.Entities.Add(entityManager.SpawnEntity(isBlackPiece ? BlackPiecePrototype : WhitePiecePrototype, session.Position.Offset(getXPosition(distanceFromSide, isLeftSide), getYPosition(i, isTop)))); + session.Entities.Add(entityManager.SpawnEntity(isBlackPiece ? BlackPiecePrototype : WhitePiecePrototype, session.Position.Offset(GetXPosition(distanceFromSide, isLeftSide), GetYPosition(i, isTop)))); } } // Top left - addPieces(0, 5, true, true, true); + AddPieces(0, 5, true, true, true); // top middle left - addPieces(4, 3, false, true, true); + AddPieces(4, 3, false, true, true); // top middle right - addPieces(5, 5, false, true, false); + AddPieces(5, 5, false, true, false); // top far right - addPieces(0, 2, true, true, false); + AddPieces(0, 2, true, true, false); // bottom left - addPieces(0, 5, false, false, true); + AddPieces(0, 5, false, false, true); // bottom middle left - addPieces(4, 3, true, false, true); + AddPieces(4, 3, true, false, true); // bottom middle right - addPieces(5, 5, true, false, false); + AddPieces(5, 5, true, false, false); // bottom far right - addPieces(0, 2, false, false, false); + AddPieces(0, 2, false, false, false); } } } diff --git a/Content.Shared/Arcade/BlockGameMessages.cs b/Content.Shared/Arcade/BlockGameMessages.cs index 02b6da2fe8..a6f850add5 100644 --- a/Content.Shared/Arcade/BlockGameMessages.cs +++ b/Content.Shared/Arcade/BlockGameMessages.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -61,11 +61,11 @@ namespace Content.Shared.Arcade public class BlockGameSetScreenMessage : BoundUserInterfaceMessage { public readonly BlockGameScreen Screen; - public readonly bool isStarted; + public readonly bool IsStarted; public BlockGameSetScreenMessage(BlockGameScreen screen, bool isStarted = true) { Screen = screen; - this.isStarted = isStarted; + IsStarted = isStarted; } } diff --git a/Content.Shared/Body/Components/SharedBodyComponent.cs b/Content.Shared/Body/Components/SharedBodyComponent.cs index 812ad34a14..f92486fdea 100644 --- a/Content.Shared/Body/Components/SharedBodyComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyComponent.cs @@ -359,7 +359,7 @@ namespace Content.Shared.Body.Components var i = 0; foreach (var (part, slot) in SlotParts) { - parts[i] = (slot.Id, Owner: part.Owner); + parts[i] = (slot.Id, part.Owner); i++; } diff --git a/Content.Shared/Lathe/SharedLatheComponent.cs b/Content.Shared/Lathe/SharedLatheComponent.cs index e8a428b078..4c74399022 100644 --- a/Content.Shared/Lathe/SharedLatheComponent.cs +++ b/Content.Shared/Lathe/SharedLatheComponent.cs @@ -32,9 +32,9 @@ namespace Content.Shared.Lathe return true; } - public bool CanProduce(string ID, int quantity = 1) + public bool CanProduce(string id, int quantity = 1) { - return PrototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe) && CanProduce(recipe, quantity); + return PrototypeManager.TryIndex(id, out LatheRecipePrototype? recipe) && CanProduce(recipe, quantity); } /// diff --git a/Content.Shared/Lathe/SharedMaterialStorageComponent.cs b/Content.Shared/Lathe/SharedMaterialStorageComponent.cs index 509e7d55c9..f3d6e758a3 100644 --- a/Content.Shared/Lathe/SharedMaterialStorageComponent.cs +++ b/Content.Shared/Lathe/SharedMaterialStorageComponent.cs @@ -17,13 +17,13 @@ namespace Content.Shared.Lathe [ViewVariables] protected virtual Dictionary Storage { get; set; } = new(); - public int this[string ID] + public int this[string id] { get { - if (!Storage.ContainsKey(ID)) + if (!Storage.ContainsKey(id)) return 0; - return Storage[ID]; + return Storage[id]; } } @@ -31,10 +31,10 @@ namespace Content.Shared.Lathe { get { - var ID = material.ID; - if (!Storage.ContainsKey(ID)) + var id = material.ID; + if (!Storage.ContainsKey(id)) return 0; - return Storage[ID]; + return Storage[id]; } } diff --git a/Content.Tools/Map.cs b/Content.Tools/Map.cs index 6e6ed59297..116ae2608f 100644 --- a/Content.Tools/Map.cs +++ b/Content.Tools/Map.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -22,9 +22,9 @@ namespace Content.Tools Root = stream.Documents[0].RootNode; TilemapNode = (YamlMappingNode) Root["tilemap"]; GridsNode = (YamlSequenceNode) Root["grids"]; - _entitiesNode = (YamlSequenceNode) Root["entities"]; + EntitiesNode = (YamlSequenceNode) Root["entities"]; - foreach (var entity in _entitiesNode) + foreach (var entity in EntitiesNode) { var uid = uint.Parse(entity["uid"].AsString()); if (uid >= NextAvailableEntityId) @@ -47,7 +47,7 @@ namespace Content.Tools // Entities lookup - private YamlSequenceNode _entitiesNode { get; } + private YamlSequenceNode EntitiesNode { get; } public Dictionary Entities { get; } = new Dictionary(); @@ -60,9 +60,9 @@ namespace Content.Tools public void Save(string fileName) { // Update entities node - _entitiesNode.Children.Clear(); + EntitiesNode.Children.Clear(); foreach (var kvp in Entities) - _entitiesNode.Add(kvp.Value); + EntitiesNode.Add(kvp.Value); using var writer = new StreamWriter(fileName); var document = new YamlDocument(Root);