Converts the particle accelerator over to ECS + misc (#17075)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
TemporalOroboros
2023-06-07 23:25:59 -07:00
committed by GitHub
parent a3137cc0f0
commit d71b6c84e5
61 changed files with 1293 additions and 1169 deletions

View File

@@ -20,9 +20,9 @@ public sealed class MachineBoardTest
"MachineParticleAcceleratorFuelChamberCircuitboard",
"MachineParticleAcceleratorFuelChamberCircuitboard",
"MachineParticleAcceleratorPowerBoxCircuitboard",
"MachineParticleAcceleratorEmitterLeftCircuitboard",
"MachineParticleAcceleratorEmitterCenterCircuitboard",
"MachineParticleAcceleratorEmitterRightCircuitboard",
"MachineParticleAcceleratorEmitterStarboardCircuitboard",
"MachineParticleAcceleratorEmitterForeCircuitboard",
"MachineParticleAcceleratorEmitterPortCircuitboard",
"ParticleAcceleratorComputerCircuitboard"
};
@@ -33,7 +33,7 @@ public sealed class MachineBoardTest
[Test]
public async Task TestMachineBoardHasValidMachine()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true});
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings { NoClient = true });
var server = pairTracker.Pair.Server;
var protoMan = server.ResolveDependency<IPrototypeManager>();
@@ -46,13 +46,16 @@ public sealed class MachineBoardTest
continue;
var mId = mbc.Prototype;
Assert.That(mId, Is.Not.Null, $"Machine board {p.ID} does not have a corresponding machine.");
Assert.That(protoMan.TryIndex<EntityPrototype>(mId, out var mProto),
$"Machine board {p.ID}'s corresponding machine has an invalid prototype.");
Assert.That(mProto.TryGetComponent<MachineComponent>(out var mComp),
$"Machine board {p.ID}'s corresponding machine {mId} does not have MachineComponent");
Assert.That(mComp.BoardPrototype, Is.EqualTo(p.ID),
$"Machine {mId}'s BoardPrototype is not equal to it's corresponding machine board, {p.ID}");
Assert.Multiple(() =>
{
Assert.That(mId, Is.Not.Null, $"Machine board {p.ID} does not have a corresponding machine.");
Assert.That(protoMan.TryIndex<EntityPrototype>(mId, out var mProto),
$"Machine board {p.ID}'s corresponding machine has an invalid prototype.");
Assert.That(mProto.TryGetComponent<MachineComponent>(out var mComp),
$"Machine board {p.ID}'s corresponding machine {mId} does not have MachineComponent");
Assert.That(mComp.BoardPrototype, Is.EqualTo(p.ID),
$"Machine {mId}'s BoardPrototype is not equal to it's corresponding machine board, {p.ID}");
});
}
});
@@ -66,7 +69,7 @@ public sealed class MachineBoardTest
[Test]
public async Task TestComputerBoardHasValidComputer()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true});
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings { NoClient = true });
var server = pairTracker.Pair.Server;
var protoMan = server.ResolveDependency<IPrototypeManager>();
@@ -79,13 +82,16 @@ public sealed class MachineBoardTest
continue;
var cId = cbc.Prototype;
Assert.That(cId, Is.Not.Null, $"Computer board \"{p.ID}\" does not have a corresponding computer.");
Assert.That(protoMan.TryIndex<EntityPrototype>(cId, out var cProto),
$"Computer board \"{p.ID}\"'s corresponding computer has an invalid prototype.");
Assert.That(cProto.TryGetComponent<ComputerComponent>(out var cComp),
$"Computer board {p.ID}'s corresponding computer \"{cId}\" does not have ComputerComponent");
Assert.That(cComp.BoardPrototype, Is.EqualTo(p.ID),
$"Computer \"{cId}\"'s BoardPrototype is not equal to it's corresponding computer board, \"{p.ID}\"");
Assert.Multiple(() =>
{
Assert.That(cId, Is.Not.Null, $"Computer board \"{p.ID}\" does not have a corresponding computer.");
Assert.That(protoMan.TryIndex<EntityPrototype>(cId, out var cProto),
$"Computer board \"{p.ID}\"'s corresponding computer has an invalid prototype.");
Assert.That(cProto.TryGetComponent<ComputerComponent>(out var cComp),
$"Computer board {p.ID}'s corresponding computer \"{cId}\" does not have ComputerComponent");
Assert.That(cComp.BoardPrototype, Is.EqualTo(p.ID),
$"Computer \"{cId}\"'s BoardPrototype is not equal to it's corresponding computer board, \"{p.ID}\"");
});
}
});