Inline HasComponent entirely
This commit is contained in:
@@ -171,7 +171,7 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
var coordinates = new EntityCoordinates(grid.GridEntityId, center);
|
||||
human = entityManager.SpawnEntity("HumanBodyAndBloodstreamDummy", coordinates);
|
||||
|
||||
Assert.True(human.HasComponent<SharedBodyComponent>());
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(human.Uid));
|
||||
Assert.True(human.TryGetComponent(out respirator));
|
||||
Assert.False(respirator.Suffocating);
|
||||
});
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
|
||||
// Component sanity check
|
||||
Assert.True(human.TryGetComponent(out buckle));
|
||||
Assert.True(chair.HasComponent<StrapComponent>());
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<StrapComponent>(chair.Uid));
|
||||
Assert.True(human.TryGetComponent(out hands));
|
||||
Assert.True(human.TryGetComponent(out body));
|
||||
|
||||
@@ -325,7 +325,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
|
||||
// Component sanity check
|
||||
Assert.True(human.TryGetComponent(out buckle));
|
||||
Assert.True(chair.HasComponent<StrapComponent>());
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<StrapComponent>(chair.Uid));
|
||||
|
||||
// Buckle
|
||||
Assert.True(buckle.TryBuckle(human, chair));
|
||||
|
||||
@@ -7,6 +7,7 @@ using Content.Server.Power.Components;
|
||||
using Content.Shared.Disposal;
|
||||
using NUnit.Framework;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Reflection;
|
||||
|
||||
@@ -146,7 +147,7 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
|
||||
// Test for components existing
|
||||
Assert.True(disposalUnit.TryGetComponent(out unit!));
|
||||
Assert.True(disposalTrunk.HasComponent<DisposalEntryComponent>());
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<DisposalEntryComponent>(disposalTrunk.Uid));
|
||||
|
||||
// Can't insert, unanchored and unpowered
|
||||
unit.Owner.Transform.Anchored = false;
|
||||
|
||||
@@ -50,8 +50,8 @@ namespace Content.IntegrationTests.Tests
|
||||
var entityMan = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
generator = entityMan.SpawnEntity("GravityGeneratorDummy", grid2.ToCoordinates());
|
||||
Assert.That(generator.HasComponent<GravityGeneratorComponent>());
|
||||
Assert.That(generator.HasComponent<ApcPowerReceiverComponent>());
|
||||
Assert.That(IoCManager.Resolve<IEntityManager>().HasComponent<GravityGeneratorComponent>(generator.Uid));
|
||||
Assert.That(IoCManager.Resolve<IEntityManager>().HasComponent<ApcPowerReceiverComponent>(generator.Uid));
|
||||
|
||||
var powerComponent = IoCManager.Resolve<IEntityManager>().GetComponent<ApcPowerReceiverComponent>(generator.Uid);
|
||||
powerComponent.NeedsPower = false;
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Content.IntegrationTests.Tests.PDA
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.Owner.HasComponent<PDAComponent>())
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<PDAComponent>(item.Owner.Uid))
|
||||
{
|
||||
inventory.ForceUnequip(slot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user