Inline TryGetComponent completely, for real
This commit is contained in:
@@ -8,6 +8,7 @@ using Robust.Shared.Utility;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Shared.Examine;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent(out AirlockComponent? airlock)) return false;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out AirlockComponent? airlock)) return false;
|
||||
|
||||
if (airlock.BoltsDown != Value)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Server.Containers;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -44,7 +45,7 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent(out ContainerManagerComponent? containerManager) ||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out ContainerManagerComponent? containerManager) ||
|
||||
!containerManager.TryGetContainer(Container, out var container)) return false;
|
||||
|
||||
if (container.ContainedEntities.Count == 0)
|
||||
|
||||
@@ -6,6 +6,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Server.Containers;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -37,7 +38,7 @@ namespace Content.Server.Construction.Conditions
|
||||
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent(out ContainerManagerComponent? containerManager) ||
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out ContainerManagerComponent? containerManager) ||
|
||||
!containerManager.TryGetContainer(Container, out var container)) return false;
|
||||
|
||||
if (container.ContainedEntities.Count != 0)
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Construction;
|
||||
using Content.Shared.Examine;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
@@ -28,7 +29,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent(out ServerDoorComponent? door)) return false;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out ServerDoorComponent? door)) return false;
|
||||
|
||||
if (door.IsWeldedShut != Welded)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using Content.Shared.Construction;
|
||||
using Content.Shared.Examine;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -37,7 +38,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent<MachineFrameComponent>(out var machineFrame))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<MachineFrameComponent?>(entity.Uid, out var machineFrame))
|
||||
return false;
|
||||
|
||||
if (!machineFrame.HasBoard)
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Construction;
|
||||
using Content.Shared.Examine;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
@@ -25,7 +26,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent(out ToiletComponent? toilet)) return false;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out ToiletComponent? toilet)) return false;
|
||||
if (!toilet.LidOpen) return false;
|
||||
|
||||
args.PushMarkup(Loc.GetString("construction-examine-condition-toilet-lid-closed") + "\n");
|
||||
|
||||
@@ -5,6 +5,7 @@ using Content.Shared.Construction;
|
||||
using Content.Shared.Examine;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -29,7 +30,7 @@ namespace Content.Server.Construction.Conditions
|
||||
{
|
||||
var entity = args.Examined;
|
||||
|
||||
if (!entity.TryGetComponent(out WiresComponent? wires)) return false;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out WiresComponent? wires)) return false;
|
||||
|
||||
switch (Open)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user