mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Axes the easy IMapManager references * Axes the references to unported (obsolete) IMapManager methods * Converts salvageruler command to a LocalizedEntityCommand so it can use SharedMapSystem * Removes IMapManager from GameTicker This required axing the map nuke during restart, but that should be fine? Maps are entities so EntityManager.FlushEntities should delete them all and that's the preceding line * submodule update(?) --------- Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using System.Numerics;
|
|
using Content.IntegrationTests.Fixtures;
|
|
using Content.Server.Shuttles.Components;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Physics;
|
|
using Robust.Shared.Physics.Components;
|
|
using Robust.Shared.Physics.Systems;
|
|
|
|
namespace Content.IntegrationTests.Tests
|
|
{
|
|
[TestFixture]
|
|
public sealed class ShuttleTest : GameTest
|
|
{
|
|
[Test]
|
|
public async Task Test()
|
|
{
|
|
var pair = Pair;
|
|
var server = pair.Server;
|
|
await server.WaitIdleAsync();
|
|
|
|
var entManager = server.ResolveDependency<IEntityManager>();
|
|
var physicsSystem = entManager.System<SharedPhysicsSystem>();
|
|
|
|
PhysicsComponent gridPhys = null;
|
|
|
|
var map = await pair.CreateTestMap();
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
var mapId = map.MapId;
|
|
var grid = map.Grid;
|
|
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(entManager.HasComponent<ShuttleComponent>(grid));
|
|
Assert.That(entManager.TryGetComponent(grid, out gridPhys));
|
|
});
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(gridPhys.BodyType, Is.EqualTo(BodyType.Dynamic));
|
|
Assert.That(entManager.GetComponent<TransformComponent>(grid).LocalPosition, Is.EqualTo(Vector2.Zero));
|
|
});
|
|
physicsSystem.ApplyLinearImpulse(grid, Vector2.One, body: gridPhys);
|
|
});
|
|
|
|
await server.WaitRunTicks(1);
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
Assert.That(entManager.GetComponent<TransformComponent>(map.Grid).LocalPosition, Is.Not.EqualTo(Vector2.Zero));
|
|
});
|
|
}
|
|
}
|
|
}
|