2023-07-08 14:08:32 +10:00
|
|
|
using System.Numerics;
|
2021-11-21 17:09:49 +11:00
|
|
|
using Content.Server.Shuttles.Components;
|
2021-07-21 21:15:12 +10:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
using Robust.Shared.Physics;
|
2022-09-14 17:26:26 +10:00
|
|
|
using Robust.Shared.Physics.Components;
|
2023-01-15 15:38:59 +11:00
|
|
|
using Robust.Shared.Physics.Systems;
|
2021-07-21 21:15:12 +10:00
|
|
|
|
|
|
|
|
namespace Content.IntegrationTests.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-06-19 20:22:28 -07:00
|
|
|
public sealed class ShuttleTest
|
2025-08-05 11:52:29 +03:00
|
|
|
{/*
|
2021-07-21 21:15:12 +10:00
|
|
|
[Test]
|
|
|
|
|
public async Task Test()
|
|
|
|
|
{
|
2023-08-25 02:56:51 +02:00
|
|
|
await using var pair = await PoolManager.GetServerClient();
|
|
|
|
|
var server = pair.Server;
|
2022-09-14 19:02:59 +10:00
|
|
|
await server.WaitIdleAsync();
|
2021-07-21 21:15:12 +10:00
|
|
|
|
|
|
|
|
var mapMan = server.ResolveDependency<IMapManager>();
|
2023-01-15 15:38:59 +11:00
|
|
|
var entManager = server.ResolveDependency<IEntityManager>();
|
|
|
|
|
var physicsSystem = entManager.System<SharedPhysicsSystem>();
|
2021-12-05 18:09:01 +01:00
|
|
|
|
2023-07-05 21:54:25 -07:00
|
|
|
PhysicsComponent gridPhys = null;
|
2021-07-21 21:15:12 +10:00
|
|
|
|
2024-07-02 20:01:37 -04:00
|
|
|
var map = await pair.CreateTestMap();
|
|
|
|
|
|
2021-07-21 21:15:12 +10:00
|
|
|
await server.WaitAssertion(() =>
|
|
|
|
|
{
|
2024-07-02 20:01:37 -04:00
|
|
|
var mapId = map.MapId;
|
|
|
|
|
var grid = map.Grid;
|
2021-07-21 21:15:12 +10:00
|
|
|
|
2023-07-05 21:54:25 -07:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
|
{
|
2024-07-02 20:01:37 -04:00
|
|
|
Assert.That(entManager.HasComponent<ShuttleComponent>(grid));
|
|
|
|
|
Assert.That(entManager.TryGetComponent(grid, out gridPhys));
|
2023-07-05 21:54:25 -07:00
|
|
|
});
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
|
{
|
|
|
|
|
Assert.That(gridPhys.BodyType, Is.EqualTo(BodyType.Dynamic));
|
2024-07-02 20:01:37 -04:00
|
|
|
Assert.That(entManager.GetComponent<TransformComponent>(grid).LocalPosition, Is.EqualTo(Vector2.Zero));
|
2023-07-05 21:54:25 -07:00
|
|
|
});
|
2024-07-02 20:01:37 -04:00
|
|
|
physicsSystem.ApplyLinearImpulse(grid, Vector2.One, body: gridPhys);
|
2021-07-21 21:15:12 +10:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await server.WaitRunTicks(1);
|
|
|
|
|
|
|
|
|
|
await server.WaitAssertion(() =>
|
|
|
|
|
{
|
2024-07-02 20:01:37 -04:00
|
|
|
Assert.That(entManager.GetComponent<TransformComponent>(map.Grid).LocalPosition, Is.Not.EqualTo(Vector2.Zero));
|
2021-07-21 21:15:12 +10:00
|
|
|
});
|
2023-08-25 02:56:51 +02:00
|
|
|
await pair.CleanReturnAsync();
|
2025-08-05 11:52:29 +03:00
|
|
|
}*/
|
2021-07-21 21:15:12 +10:00
|
|
|
}
|
|
|
|
|
}
|