Typo, redundant string interpolation, namespaces and imports cleanup (#2068)

* Readonly, typos and redundant string interpolations

* Namespaces

* Optimize imports

* Address reviews

* but actually

* Localize missing strings

* Remove redundant vars
This commit is contained in:
DrSmugleaf
2020-09-13 14:23:52 +02:00
committed by GitHub
parent 2e5838bb62
commit 74943a2770
213 changed files with 465 additions and 669 deletions

View File

@@ -7,7 +7,6 @@ using JetBrains.Annotations;
using Robust.Server.AI;
using Robust.Server.Interfaces.Console;
using Robust.Server.Interfaces.Player;
using Robust.Server.Interfaces.Timing;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;

View File

@@ -1,5 +1,4 @@
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Map;

View File

@@ -19,8 +19,8 @@ namespace Content.Server.GameObjects.EntitySystems
{
_lastUpdate += frameTime;
if (_lastUpdate < UpdateDelay) return;
var atmoSystem = EntitySystemManager.GetEntitySystem<AtmosphereSystem>();
// creadth: everything exposable by atmo should be updated as well
var atmosSystem = EntitySystemManager.GetEntitySystem<AtmosphereSystem>();
// creadth: everything exposable by atmos should be updated as well
foreach (var atmosExposedComponent in EntityManager.ComponentManager.EntityQuery<AtmosExposedComponent>())
{
var tile = atmosExposedComponent.Owner.Transform.Coordinates.GetTileAtmosphere(_entityManager);

View File

@@ -4,8 +4,6 @@ using System.Collections.Generic;
using System.Linq;
using Content.Server.Atmos;
using Content.Server.Atmos.Reactions;
using Content.Server.GameObjects.Components.Atmos;
using Content.Server.Interfaces;
using Content.Shared.GameObjects.EntitySystems.Atmos;
using JetBrains.Annotations;
using Robust.Server.Interfaces.Timing;

View File

@@ -2,10 +2,7 @@
using System.Linq;
using Content.Server.GameObjects.Components.Medical;
using Content.Server.Mobs;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Content.Shared.GameObjects.Components.Medical;
using Microsoft.AspNetCore.Server.Kestrel.Core;
namespace Content.Server.GameObjects.EntitySystems
{

View File

@@ -1,10 +1,8 @@
#nullable enable
using System;
using System.Threading;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Physics;
using Content.Shared.Utility;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
// ReSharper disable UnassignedReadonlyField

View File

@@ -1,7 +1,6 @@

using JetBrains.Annotations;
using Robust.Shared.GameObjects.Systems;
using Content.Server.GameObjects.Components.Interactable;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
{

View File

@@ -6,11 +6,9 @@ using Content.Server.GameObjects.Components.Stack;
using Content.Server.GameObjects.EntitySystems.Click;
using Content.Server.Interfaces.GameObjects.Components.Items;
using Content.Server.Throw;
using Content.Shared.GameObjects.Components.Inventory;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Input;
using Content.Shared.Interfaces;
using Content.Shared.Utility;
using JetBrains.Annotations;
using Robust.Server.GameObjects.EntitySystemMessages;
using Robust.Server.Interfaces.Player;
@@ -23,6 +21,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Players;
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
namespace Content.Server.GameObjects.EntitySystems
{
@@ -182,15 +181,15 @@ namespace Content.Server.GameObjects.EntitySystems
private void HandleSmartEquipBackpack(ICommonSession session)
{
HandleSmartEquip(session, EquipmentSlotDefines.Slots.BACKPACK);
HandleSmartEquip(session, Slots.BACKPACK);
}
private void HandleSmartEquipBelt(ICommonSession session)
{
HandleSmartEquip(session, EquipmentSlotDefines.Slots.BELT);
HandleSmartEquip(session, Slots.BELT);
}
private void HandleSmartEquip(ICommonSession session, EquipmentSlotDefines.Slots equipementSlot)
private void HandleSmartEquip(ICommonSession session, Slots equipmentSlot)
{
var plyEnt = ((IPlayerSession) session).AttachedEntity;
@@ -201,11 +200,11 @@ namespace Content.Server.GameObjects.EntitySystems
!plyEnt.TryGetComponent(out InventoryComponent inventoryComp))
return;
if (!inventoryComp.TryGetSlotItem(equipementSlot, out ItemComponent equipmentItem)
if (!inventoryComp.TryGetSlotItem(equipmentSlot, out ItemComponent equipmentItem)
|| !equipmentItem.Owner.TryGetComponent<ServerStorageComponent>(out var storageComponent))
{
plyEnt.PopupMessage(Loc.GetString("You have no {0} to take something out of!",
EquipmentSlotDefines.SlotNames[equipementSlot].ToLower()));
SlotNames[equipmentSlot].ToLower()));
return;
}
@@ -220,7 +219,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (storageComponent.StoredEntities.Count == 0)
{
plyEnt.PopupMessage(Loc.GetString("There's nothing in your {0} to take out!",
EquipmentSlotDefines.SlotNames[equipementSlot].ToLower()));
SlotNames[equipmentSlot].ToLower()));
}
else
{

View File

@@ -1,8 +1,6 @@
using Content.Server.GameObjects.Components;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Map;
namespace Content.Server.GameObjects.EntitySystems

View File

@@ -1,4 +1,5 @@
using Content.Server.GameObjects.Components.MachineLinking;
using System.Collections.Generic;
using Content.Server.GameObjects.Components.MachineLinking;
using Robust.Server.Interfaces.Console;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
@@ -10,7 +11,6 @@ using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Players;
using System.Collections.Generic;
namespace Content.Server.GameObjects.EntitySystems
{

View File

@@ -1,16 +1,12 @@
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Damage;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.StationEvents;
using Content.Shared.Damage;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Body;
using Content.Shared.GameObjects.Components.Damage;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.GameObjects.EntitySystems.StationEvents
{

View File

@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;
using Content.Server.StationEvents;
using Content.Server.GameTicking;
using Content.Server.Interfaces.GameTicking;
using Content.Server.StationEvents;
using JetBrains.Annotations;
using Robust.Server.Console;
using Robust.Server.Interfaces.Player;
@@ -196,7 +197,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
}
// Stop events from happening in lobby and force active event to end if the round ends
if (_gameTicker.RunLevel != GameTicking.GameRunLevel.InRound)
if (_gameTicker.RunLevel != GameRunLevel.InRound)
{
if (CurrentEvent != null)
{

View File

@@ -2,9 +2,7 @@
using System.Reflection;
using Content.Shared.GameObjects.Verbs;
using Robust.Server.Interfaces.Player;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;