Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods (#1965)

* Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods

* Remove redundant code
This commit is contained in:
DrSmugleaf
2020-09-01 12:34:53 +02:00
committed by GitHub
parent 14259ed920
commit 8f9ed2f562
53 changed files with 247 additions and 375 deletions

View File

@@ -1,6 +1,7 @@
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces;
using Content.Server.Interfaces.Chat;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
@@ -13,7 +14,6 @@ namespace Content.Server.GameObjects.Components
class RadioComponent : Component, IUse, IListen
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
public override string Name => "Radio";
@@ -60,11 +60,11 @@ namespace Content.Server.GameObjects.Components
RadioOn = !RadioOn;
if(RadioOn)
{
_notifyManager.PopupMessage(Owner, eventArgs.User, "The radio is now on.");
Owner.PopupMessage(eventArgs.User, "The radio is now on.");
}
else
{
_notifyManager.PopupMessage(Owner, eventArgs.User, "The radio is now off.");
Owner.PopupMessage(eventArgs.User, "The radio is now off.");
}
return true;
}