Inline UID
This commit is contained in:
@@ -78,17 +78,17 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
chair = entityManager.SpawnEntity(StrapDummyId, coordinates);
|
||||
|
||||
// Default state, unbuckled
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human.Uid, out buckle));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human, out buckle));
|
||||
Assert.NotNull(buckle);
|
||||
Assert.Null(buckle.BuckledTo);
|
||||
Assert.False(buckle.Buckled);
|
||||
Assert.True(actionBlocker.CanMove(human.Uid));
|
||||
Assert.True(actionBlocker.CanChangeDirection(human.Uid));
|
||||
Assert.True(standingState.Down(human.Uid));
|
||||
Assert.True(standingState.Stand(human.Uid));
|
||||
Assert.True(actionBlocker.CanMove(human));
|
||||
Assert.True(actionBlocker.CanChangeDirection(human));
|
||||
Assert.True(standingState.Down((EntityUid) human));
|
||||
Assert.True(standingState.Stand((EntityUid) human));
|
||||
|
||||
// Default state, no buckled entities, strap
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(chair.Uid, out strap));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(chair, out strap));
|
||||
Assert.NotNull(strap);
|
||||
Assert.IsEmpty(strap.BuckledEntities);
|
||||
Assert.Zero(strap.OccupiedSize);
|
||||
@@ -100,10 +100,10 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
|
||||
var player = IoCManager.Resolve<IPlayerManager>().Sessions.Single();
|
||||
Assert.True(((BuckleComponentState) buckle.GetComponentState()).Buckled);
|
||||
Assert.False(actionBlocker.CanMove(human.Uid));
|
||||
Assert.False(actionBlocker.CanChangeDirection(human.Uid));
|
||||
Assert.False(standingState.Down(human.Uid));
|
||||
Assert.That((IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human.Uid).WorldPosition - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(chair.Uid).WorldPosition).Length, Is.LessThanOrEqualTo(buckle.BuckleOffset.Length));
|
||||
Assert.False(actionBlocker.CanMove(human));
|
||||
Assert.False(actionBlocker.CanChangeDirection(human));
|
||||
Assert.False(standingState.Down((EntityUid) human));
|
||||
Assert.That((IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human).WorldPosition - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(chair).WorldPosition).Length, Is.LessThanOrEqualTo(buckle.BuckleOffset.Length));
|
||||
|
||||
// Side effects of buckling for the strap
|
||||
Assert.That(strap.BuckledEntities, Does.Contain(human));
|
||||
@@ -134,9 +134,9 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
Assert.True(buckle.TryUnbuckle(human));
|
||||
Assert.Null(buckle.BuckledTo);
|
||||
Assert.False(buckle.Buckled);
|
||||
Assert.True(actionBlocker.CanMove(human.Uid));
|
||||
Assert.True(actionBlocker.CanChangeDirection(human.Uid));
|
||||
Assert.True(standingState.Down(human.Uid));
|
||||
Assert.True(actionBlocker.CanMove(human));
|
||||
Assert.True(actionBlocker.CanChangeDirection(human));
|
||||
Assert.True(standingState.Down((EntityUid) human));
|
||||
|
||||
// Unbuckle, strap
|
||||
Assert.IsEmpty(strap.BuckledEntities);
|
||||
@@ -171,7 +171,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
Assert.False(buckle.Buckled);
|
||||
|
||||
// Move away from the chair
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human.Uid).WorldPosition += (1000, 1000);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human).WorldPosition += (1000, 1000);
|
||||
|
||||
// Out of range
|
||||
Assert.False(buckle.TryBuckle(human, chair));
|
||||
@@ -179,7 +179,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
Assert.False(buckle.ToggleBuckle(human, chair));
|
||||
|
||||
// Move near the chair
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human.Uid).WorldPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(chair.Uid).WorldPosition + (0.5f, 0);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human).WorldPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(chair).WorldPosition + (0.5f, 0);
|
||||
|
||||
// In range
|
||||
Assert.True(buckle.TryBuckle(human, chair));
|
||||
@@ -192,15 +192,15 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
// Force unbuckle
|
||||
Assert.True(buckle.TryUnbuckle(human, true));
|
||||
Assert.False(buckle.Buckled);
|
||||
Assert.True(actionBlocker.CanMove(human.Uid));
|
||||
Assert.True(actionBlocker.CanChangeDirection(human.Uid));
|
||||
Assert.True(standingState.Down(human.Uid));
|
||||
Assert.True(actionBlocker.CanMove(human));
|
||||
Assert.True(actionBlocker.CanChangeDirection(human));
|
||||
Assert.True(standingState.Down((EntityUid) human));
|
||||
|
||||
// Re-buckle
|
||||
Assert.True(buckle.TryBuckle(human, chair));
|
||||
|
||||
// Move away from the chair
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human.Uid).WorldPosition += (1, 0);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human).WorldPosition += (1, 0);
|
||||
});
|
||||
|
||||
await server.WaitRunTicks(1);
|
||||
@@ -239,10 +239,10 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
IEntity chair = entityManager.SpawnEntity(StrapDummyId, coordinates);
|
||||
|
||||
// Component sanity check
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human.Uid, out buckle));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<StrapComponent>(chair.Uid));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human.Uid, out hands));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human.Uid, out body));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human, out buckle));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<StrapComponent>(chair));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human, out hands));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human, out body));
|
||||
|
||||
// Buckle
|
||||
Assert.True(buckle.TryBuckle(human, chair));
|
||||
@@ -255,7 +255,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
var akms = entityManager.SpawnEntity(ItemDummyId, coordinates);
|
||||
|
||||
// Equip items
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(akms.Uid, out ItemComponent item));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(akms, out ItemComponent item));
|
||||
Assert.True(hands.PutInHand(item));
|
||||
}
|
||||
});
|
||||
@@ -324,8 +324,8 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
chair = entityManager.SpawnEntity(StrapDummyId, coordinates);
|
||||
|
||||
// Component sanity check
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human.Uid, out buckle));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<StrapComponent>(chair.Uid));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().TryGetComponent(human, out buckle));
|
||||
Assert.True(IoCManager.Resolve<IEntityManager>().HasComponent<StrapComponent>(chair));
|
||||
|
||||
// Buckle
|
||||
Assert.True(buckle.TryBuckle(human, chair));
|
||||
@@ -333,7 +333,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
Assert.True(buckle.Buckled);
|
||||
|
||||
// Move the buckled entity away
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human.Uid).WorldPosition += (100, 0);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human).WorldPosition += (100, 0);
|
||||
});
|
||||
|
||||
await WaitUntil(server, () => !buckle.Buckled, 10);
|
||||
@@ -343,7 +343,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
// Move the now unbuckled entity back onto the chair
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human.Uid).WorldPosition -= (100, 0);
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(human).WorldPosition -= (100, 0);
|
||||
|
||||
// Buckle
|
||||
Assert.True(buckle.TryBuckle(human, chair));
|
||||
|
||||
Reference in New Issue
Block a user