BuildThrustedShip fills extra hardpoint types before activation; the vent test fits a radiator through it
A ship cannot be equipped once active, so the radiator has to be fitted inside the one builder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d577c64d8f
commit
b3b81007d5
2 changed files with 12 additions and 23 deletions
|
|
@ -123,22 +123,8 @@ public sealed class ConsumablesFirstSetTests
|
|||
|
||||
public Run()
|
||||
{
|
||||
Ship = RestoredHullsTests.BuildThrustedShip(Cache, "Djinni");
|
||||
Ship = RestoredHullsTests.BuildThrustedShip(Cache, "Djinni", HardpointType.Radiator);
|
||||
Zone = Ship.Zone;
|
||||
var hull = Cache.GetByName<HullData>("Djinni");
|
||||
// The first radiator hardpoint that takes a radiator design; a hull has several and not every pairing fits.
|
||||
var fitted = false;
|
||||
foreach (var hardpoint in hull.Hardpoints.Where(h => h.Type == HardpointType.Radiator).TakeWhile(_ => !fitted))
|
||||
foreach (var design in Cache.GetAll<GearData>().Where(g => hardpoint.IsFilledBy(g) && g.Behaviors.OfType<RadiatorData>().Any()))
|
||||
{
|
||||
var item = new EquippableItem
|
||||
{
|
||||
Data = Cache.RefOf<ItemData>(design), Durability = design.Durability,
|
||||
Lot = Ship.ItemManager.Lots.Add(new Lot { Design = Cache.RefOf<ItemData>(design), Origin = new Attributed(), Quality = .5f, Roles = new List<RoleFill>() })
|
||||
};
|
||||
if (fitted = Ship.TryEquip(item, hardpoint.Position)) break;
|
||||
}
|
||||
Assert.True(fitted, "no radiator fits the Djinni");
|
||||
Zone.Update(0f);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue