Airlock / firelock code refactor, pseudo-prediction implementation (#3037)
* splits off airlocks, firelocks * adds airlock prediction. anims broken though * fixes animation weirdness * removes opacity prediction because it looked odd * Now firelocks don't visually start open. Argh. * Fixes firelock weirdness, saneifies _state var. * Documentation changes, code shuffle. * Lets firelocks crush people. * Stops open-hand opening/closing firelocks. * updates serializable, netserializable attributes * Addresses reviews... hopefully. * updates submodule? * nullability * fuck fuck fuck fuck * fucking finally
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.GameObjects.Components.Doors;
|
||||
using Content.Shared.GameObjects.Components.Doors;
|
||||
using NUnit.Framework;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
@@ -29,6 +30,7 @@ namespace Content.IntegrationTests.Tests.Doors
|
||||
name: AirlockDummy
|
||||
id: AirlockDummy
|
||||
components:
|
||||
- type: Door
|
||||
- type: Airlock
|
||||
- type: Physics
|
||||
shapes:
|
||||
@@ -49,7 +51,7 @@ namespace Content.IntegrationTests.Tests.Doors
|
||||
var entityManager = server.ResolveDependency<IEntityManager>();
|
||||
|
||||
IEntity airlock = null;
|
||||
AirlockComponent airlockComponent = null;
|
||||
ServerDoorComponent doorComponent = null;
|
||||
|
||||
server.Assert(() =>
|
||||
{
|
||||
@@ -57,33 +59,33 @@ namespace Content.IntegrationTests.Tests.Doors
|
||||
|
||||
airlock = entityManager.SpawnEntity("AirlockDummy", MapCoordinates.Nullspace);
|
||||
|
||||
Assert.True(airlock.TryGetComponent(out airlockComponent));
|
||||
Assert.That(airlockComponent.State, Is.EqualTo(DoorState.Closed));
|
||||
Assert.True(airlock.TryGetComponent(out doorComponent));
|
||||
Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Closed));
|
||||
});
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
server.Assert(() =>
|
||||
{
|
||||
airlockComponent.Open();
|
||||
Assert.That(airlockComponent.State, Is.EqualTo(DoorState.Opening));
|
||||
doorComponent.Open();
|
||||
Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Opening));
|
||||
});
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
await WaitUntil(server, () => airlockComponent.State == DoorState.Open);
|
||||
await WaitUntil(server, () => doorComponent.State == SharedDoorComponent.DoorState.Open);
|
||||
|
||||
Assert.That(airlockComponent.State, Is.EqualTo(DoorState.Open));
|
||||
Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Open));
|
||||
|
||||
server.Assert(() =>
|
||||
{
|
||||
airlockComponent.Close();
|
||||
Assert.That(airlockComponent.State, Is.EqualTo(DoorState.Closing));
|
||||
doorComponent.Close();
|
||||
Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Closing));
|
||||
});
|
||||
|
||||
await WaitUntil(server, () => airlockComponent.State == DoorState.Closed);
|
||||
await WaitUntil(server, () => doorComponent.State == SharedDoorComponent.DoorState.Closed);
|
||||
|
||||
Assert.That(airlockComponent.State, Is.EqualTo(DoorState.Closed));
|
||||
Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Closed));
|
||||
|
||||
server.Assert(() =>
|
||||
{
|
||||
@@ -112,7 +114,7 @@ namespace Content.IntegrationTests.Tests.Doors
|
||||
IEntity physicsDummy = null;
|
||||
IEntity airlock = null;
|
||||
TestController controller = null;
|
||||
AirlockComponent airlockComponent = null;
|
||||
ServerDoorComponent doorComponent = null;
|
||||
|
||||
var physicsDummyStartingX = -1;
|
||||
|
||||
@@ -130,8 +132,8 @@ namespace Content.IntegrationTests.Tests.Doors
|
||||
|
||||
controller = physics.EnsureController<TestController>();
|
||||
|
||||
Assert.True(airlock.TryGetComponent(out airlockComponent));
|
||||
Assert.That(airlockComponent.State, Is.EqualTo(DoorState.Closed));
|
||||
Assert.True(airlock.TryGetComponent(out doorComponent));
|
||||
Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Closed));
|
||||
});
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
@@ -145,7 +147,7 @@ namespace Content.IntegrationTests.Tests.Doors
|
||||
airlock.GetComponent<IPhysicsComponent>().WakeBody();
|
||||
|
||||
// Ensure that it is still closed
|
||||
Assert.That(airlockComponent.State, Is.EqualTo(DoorState.Closed));
|
||||
Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Closed));
|
||||
|
||||
await server.WaitRunTicks(10);
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
Reference in New Issue
Block a user