Fix compiler warnings

This commit is contained in:
Pieter-Jan Briers
2020-05-28 17:44:34 +02:00
parent 7573eb7863
commit 94917a63a6
22 changed files with 23 additions and 71 deletions

View File

@@ -14,7 +14,9 @@ namespace Content.Client.GameObjects.Components.Command
[ViewVariables]
private CommunicationsConsoleMenu _menu;
#pragma warning disable 649
[Dependency] private IGameTiming _gameTiming;
#pragma warning restore 649
public bool CountdownStarted { get; private set; }
@@ -55,13 +57,6 @@ namespace Content.Client.GameObjects.Components.Command
SendMessage(new CommunicationsConsoleRecallEmergencyShuttleMessage());
}
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
{
switch (message)
{
}
}
protected override void UpdateState(BoundUserInterfaceState state)
{
if (!(state is CommunicationsConsoleInterfaceState commsState))

View File

@@ -32,7 +32,6 @@ namespace Content.Client.GameObjects.Components.Instruments
#pragma warning disable 649
[Dependency] private IMidiManager _midiManager;
[Dependency] private readonly IGameTiming _gameTiming;
#pragma warning restore 649
[CanBeNull]

View File

@@ -28,8 +28,6 @@ namespace Content.Client.GameObjects.EntitySystems
#pragma warning disable 649
[Dependency] private readonly IGameHud _gameHud;
[Dependency] private readonly IPlayerManager _playerManager;
[Dependency] private readonly IInputManager _inputManager;
[Dependency] private readonly IOverlayManager _overlayManager;
[Dependency] private readonly IGameTiming _gameTiming;
#pragma warning restore 649

View File

@@ -46,7 +46,6 @@ namespace Content.Client.GameObjects.EntitySystems
[Dependency] private readonly IItemSlotManager _itemSlotManager;
[Dependency] private readonly IGameTiming _gameTiming;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager;
[Dependency] private readonly IResourceCache _resourceCache;
#pragma warning restore 649
private EntityList _currentEntityList;

View File

@@ -48,7 +48,6 @@ namespace Content.Client.State
var address = _gameController.LaunchState.Ss14Address ?? _gameController.LaunchState.ConnectAddress;
VBoxContainer disconnected;
_control = new Control
{
Stylesheet = _stylesheetManager.SheetSpace,

View File

@@ -28,7 +28,6 @@ namespace Content.Server.GameObjects.Components.Chemistry
#pragma warning disable 649
[Dependency] private readonly IServerNotifyManager _notifyManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
#pragma warning restore 649
public override string Name => "Pourable";

View File

@@ -20,9 +20,6 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.ViewVariables;
using static Content.Shared.Construction.ConstructionStepMaterial;
using static Content.Shared.Construction.ConstructionStepTool;
using Robust.Shared.Utility;
using Robust.Shared.Utility;
namespace Content.Server.GameObjects.Components.Construction
{
@@ -38,12 +35,6 @@ namespace Content.Server.GameObjects.Components.Construction
SpriteComponent Sprite;
ITransformComponent Transform;
#pragma warning disable 649
[Dependency] private IRobustRandom _random;
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
[Dependency] private readonly IServerNotifyManager _notifyManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
#pragma warning restore 649
public override void Initialize()
{

View File

@@ -30,8 +30,6 @@ namespace Content.Server.GameObjects.Components.Construction
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IServerEntityManager _serverEntityManager;
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
[Dependency] private readonly ISharedNotifyManager _notifyManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
#pragma warning restore 649
public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession session = null)

View File

@@ -26,10 +26,6 @@ namespace Content.Server.GameObjects.Components.Doors
{
public override string Name => "Airlock";
#pragma warning disable 649
[Dependency] private readonly ILocalizationManager _localizationMgr;
#pragma warning restore 649
/// <summary>
/// Duration for which power will be disabled after pulsing either power wire.
/// </summary>

View File

@@ -18,7 +18,6 @@ using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
using Timer = Robust.Shared.Timers.Timer;
using Robust.Shared.Utility;
namespace Content.Server.GameObjects.Components.Fluids
{

View File

@@ -29,7 +29,9 @@ namespace Content.Server.GameObjects.Components.Instruments
public class InstrumentComponent : SharedInstrumentComponent,
IDropped, IHandSelected, IHandDeselected, IActivate, IUse, IThrown
{
#pragma warning disable 649
[Dependency] private IServerNotifyManager _notifyManager;
#pragma warning restore 649
// These 2 values are quite high for now, and this could be easily abused. Change this if people are abusing it.
public const int MaxMidiEventsPerSecond = 20;
@@ -98,7 +100,7 @@ namespace Content.Server.GameObjects.Components.Instruments
}
}
private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
private void OnPlayerStatusChanged(object sender, SessionStatusEventArgs e)
{
if (e.NewStatus == SessionStatus.Disconnected)
InstrumentPlayer = null;

View File

@@ -16,11 +16,9 @@ namespace Content.Server.GameObjects.Components.Interactable
public class TilePryingComponent : Component, IAfterInteract
{
#pragma warning disable 649
[Dependency] private IEntitySystemManager _entitySystemManager;
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IPrototypeManager _prototypeManager;
[Dependency] private readonly IRobustRandom _robustRandom;
#pragma warning restore 649
public override string Name => "TilePrying";

View File

@@ -36,9 +36,7 @@ namespace Content.Server.GameObjects.Components.Interactable
public class ToolComponent : SharedToolComponent
{
#pragma warning disable 649
[Dependency] private IEntitySystemManager _entitySystemManager;
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
[Dependency] private readonly IPrototypeManager _prototypeManager;
[Dependency] private readonly IRobustRandom _robustRandom;
#pragma warning restore 649

View File

@@ -195,7 +195,7 @@ namespace Content.Server.GameObjects.Components.Research
break;
}
Timer.Spawn(InsertionTime, async () =>
Timer.Spawn(InsertionTime, () =>
{
State = LatheState.Base;
SetAppearance(LatheVisualState.Idle);

View File

@@ -25,10 +25,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
[RegisterComponent]
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing
{
#pragma warning disable 649
[Dependency] private IRobustRandom _robustRandom;
[Dependency] private IEntitySystemManager _entitySystemManager;
[Dependency] private readonly ISharedNotifyManager _notifyManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
#pragma warning restore 649
public override string Name => "Stunbaton";

View File

@@ -315,13 +315,8 @@ namespace Content.Server.GameObjects.EntitySystems
{
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IPhysicsManager _physicsManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
#pragma warning restore 649
public const float InteractionRange = 2;
public const float InteractionRangeSquared = InteractionRange * InteractionRange;
public override void Initialize()
{
var inputSys = EntitySystemManager.GetEntitySystem<InputSystem>();

View File

@@ -27,7 +27,6 @@ namespace Content.Server.GameObjects.EntitySystems
{
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
[Dependency] private readonly IServerNotifyManager _notifyManager;
#pragma warning restore 649

View File

@@ -19,7 +19,6 @@ namespace Content.Server.GameTicking.GamePresets
public class PresetSuspicion : GamePreset
{
#pragma warning disable 649
[Dependency] private readonly ISandboxManager _sandboxManager;
[Dependency] private readonly IChatManager _chatManager;
[Dependency] private readonly IGameTicker _gameTicker;
[Dependency] private readonly IRobustRandom _random;

View File

@@ -13,16 +13,10 @@ namespace Content.Server.BodySystem {
/// <summary>
/// Component containing the data for a dropped Mechanism entity.
/// </summary>
/// </summary>
[RegisterComponent]
public class DroppedMechanismComponent : Component
{
#pragma warning disable CS0649
[Dependency]
private IPrototypeManager _prototypeManager;
#pragma warning restore
public sealed override string Name => "DroppedMechanism";
[ViewVariables]

View File

@@ -30,12 +30,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
[RegisterComponent]
public class ServerSurgeryToolComponent : SharedSurgeryToolComponent, IAfterInteract
{
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
[Dependency] private readonly IPhysicsManager _physicsManager;
#pragma warning restore 649
public HashSet<IPlayerSession> SubscribedSessions = new HashSet<IPlayerSession>();
private Dictionary<string, BodyPart> _surgeryOptionsCache = new Dictionary<string, BodyPart>();
private BodyManagerComponent _targetCache;

View File

@@ -19,7 +19,6 @@ namespace Content.Server.GameObjects.EntitySystems
public class SharedInteractionSystem : EntitySystem
{
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly IPhysicsManager _physicsManager;
#pragma warning restore 649

View File

@@ -12,7 +12,7 @@ namespace Content.Shared.BodySystem {
/// <summary>
/// Prototype for the Mechanism class.
/// </summary>
/// </summary>
[Prototype("mechanism")]
[NetSerializable, Serializable]
public class MechanismPrototype : IPrototype, IIndexedPrototype {
@@ -20,7 +20,6 @@ namespace Content.Shared.BodySystem {
private string _name;
private string _description;
private string _examineMessage;
private string _spritePath;
private string _rsiPath;
private string _rsiState;
private int _durability;
@@ -34,10 +33,10 @@ namespace Content.Shared.BodySystem {
[ViewVariables]
public string Name => _name;
[ViewVariables]
public string Description => _description;
public string Description => _description;
[ViewVariables]
public string ExamineMessage => _examineMessage;
@@ -49,19 +48,19 @@ namespace Content.Shared.BodySystem {
[ViewVariables]
public int Durability => _durability;
[ViewVariables]
public int DestroyThreshold => _destroyThreshold;
public int DestroyThreshold => _destroyThreshold;
[ViewVariables]
public int Resistance => _resistance;
[ViewVariables]
public int Size => _size;
[ViewVariables]
public BodyPartCompatibility Compatibility => _compatibility;
public BodyPartCompatibility Compatibility => _compatibility;
public virtual void LoadFrom(YamlMappingNode mapping){
var serializer = YamlObjectSerializer.NewReader(mapping);
@@ -74,9 +73,9 @@ namespace Content.Shared.BodySystem {
serializer.DataField(ref _durability, "durability", 0);
serializer.DataField(ref _destroyThreshold, "destroyThreshold", 0);
serializer.DataField(ref _resistance, "resistance", 0);
serializer.DataField(ref _size, "size", 2);
serializer.DataField(ref _size, "size", 2);
serializer.DataField(ref _compatibility, "compatibility", BodyPartCompatibility.Universal);
}
}
}
}