LootTests: the pickup taker is an unstocked two-bay station, as the StationServices fixture builds one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c34f72e3d5
commit
ca19deab68
1 changed files with 10 additions and 7 deletions
|
|
@ -139,15 +139,18 @@ public sealed class LootTests : IDisposable
|
|||
return ship;
|
||||
}
|
||||
|
||||
private static Entity Station(Lab lab, float3 at)
|
||||
private static Entity Station(Lab lab, float3 at, bool stocked = true)
|
||||
{
|
||||
var hull = lab.Items.ItemData.RefOf<ItemData>(lab.Items.ItemData.GetByName<HullData>("Hub"));
|
||||
var station = new OrbitalEntity(lab.Items, lab.Zone, new EquippableItem { Data = hull, Durability = 1000000, Lot = lab.Lot++ }, default, new EntitySettings());
|
||||
Assert.True(station.TryEquip(lab.Make("Crate"), new int2(1, 1)));
|
||||
var spare = lab.Make("Spare");
|
||||
Assert.True(station.TryFindSpace(spare, out var pos));
|
||||
Assert.True(station.TryEquip(spare, pos));
|
||||
Assert.True(station.CargoBays.Single().TryStore(lab.Ore(3)));
|
||||
if (stocked)
|
||||
{
|
||||
var spare = lab.Make("Spare");
|
||||
Assert.True(station.TryFindSpace(spare, out var pos));
|
||||
Assert.True(station.TryEquip(spare, pos));
|
||||
Assert.True(station.CargoBays.Single().TryStore(lab.Ore(3)));
|
||||
}
|
||||
lab.Zone.Entities.Add(station);
|
||||
station.Activate();
|
||||
station.Position = at;
|
||||
|
|
@ -322,8 +325,8 @@ public sealed class LootTests : IDisposable
|
|||
public void TryPickUpStoresAndRemoves()
|
||||
{
|
||||
var lab = Build();
|
||||
var taker = Station(lab, float3(0, 0, 0));
|
||||
Assert.Contains(Solid(5, 5).AllCoordinates, cell => taker.TryEquip(lab.Make("Crate"), cell));
|
||||
var taker = Station(lab, float3(0, 0, 0), stocked: false);
|
||||
Assert.True(taker.TryEquip(lab.Make("Crate"), new int2(2, 2)));
|
||||
Assert.Equal(2, taker.CargoBays.Count);
|
||||
// The first bay is full, so the first bay that accepts the item is the second.
|
||||
while (taker.CargoBays[0].TryStore(lab.Make("Spare"))) { }
|
||||
|
|
|
|||
Loading…
Reference in a new issue