Allow InteractionTests to load other maps (#41226)
* load maps and marker * cleanup * sneaky doc * sneaky doc2 --------- Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,7 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.UnitTesting;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Interaction;
|
||||
@@ -39,10 +40,20 @@ namespace Content.IntegrationTests.Tests.Interaction;
|
||||
[FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
|
||||
public abstract partial class InteractionTest
|
||||
{
|
||||
/// <summary>
|
||||
/// The prototype that will be spawned for the player entity at <see cref="PlayerCoords"/>.
|
||||
/// This is not a full humanoid and only has one hand by default.
|
||||
/// </summary>
|
||||
protected virtual string PlayerPrototype => "InteractionTestMob";
|
||||
|
||||
/// <summary>
|
||||
/// The map path to load for the integration test.
|
||||
/// If null an empty map with a single 1x1 plating grid will be generated.
|
||||
/// </summary>
|
||||
protected virtual ResPath? TestMapPath => null;
|
||||
|
||||
protected TestPair Pair = default!;
|
||||
protected TestMapData MapData => Pair.TestMap!;
|
||||
protected TestMapData MapData = default!;
|
||||
|
||||
protected RobustIntegrationTest.ServerIntegrationInstance Server => Pair.Server;
|
||||
protected RobustIntegrationTest.ClientIntegrationInstance Client => Pair.Client;
|
||||
@@ -199,7 +210,10 @@ public abstract partial class InteractionTest
|
||||
CUiSys = CEntMan.System<SharedUserInterfaceSystem>();
|
||||
|
||||
// Setup map.
|
||||
await Pair.CreateTestMap();
|
||||
if (TestMapPath == null)
|
||||
MapData = await Pair.CreateTestMap();
|
||||
else
|
||||
MapData = await Pair.LoadTestMap(TestMapPath.Value);
|
||||
|
||||
PlayerCoords = SEntMan.GetNetCoordinates(Transform.WithEntityId(MapData.GridCoords.Offset(new Vector2(0.5f, 0.5f)), MapData.MapUid));
|
||||
TargetCoords = SEntMan.GetNetCoordinates(Transform.WithEntityId(MapData.GridCoords.Offset(new Vector2(1.5f, 0.5f)), MapData.MapUid));
|
||||
|
||||
Reference in New Issue
Block a user