Tests: the cramped and tiny stations carry the Facility row the quarters now need before their dock and heater faults
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
90253307a6
commit
0c5a46f776
2 changed files with 14 additions and 2 deletions
|
|
@ -327,12 +327,20 @@ public sealed partial class RunStartTests : IDisposable
|
|||
var sold = _cache.GetAll<FactionProductData>().Select(product => product.Design.Key).ToHashSet();
|
||||
var bay = _cache.GetAll<DockingBayData>().Where(design => sold.Contains(_cache.RefOf(design).Key))
|
||||
.OrderBy(design => design.Shape.Coordinates.Length).ThenBy(design => design.Name, StringComparer.Ordinal).First();
|
||||
var shape = new Shape(bay.Shape.Width + 2, bay.Shape.Height + 2);
|
||||
// Three columns wider than the bay's interior, for the Crew Quarters' Facility row at the right edge: the columns the bay leaves are too
|
||||
// narrow for a heater.
|
||||
var shape = new Shape(bay.Shape.Width + 5, bay.Shape.Height + 2);
|
||||
foreach (var cell in shape.AllCoordinates) shape[cell] = true;
|
||||
// A kind with no facilities: the shipped trade hub now seats a silo, which a hull this small has no Facility row for.
|
||||
var bare = new CultRecordRef<StationKindData>(StationKindData.KeyOf("cramped"));
|
||||
_cache.Commit(batch => batch.Upsert(typeof(StationKindData), new StationKindData { Name = "Cramped" }, bare.Key));
|
||||
var cramped = new HullData { Name = "Cramped Station", HullType = HullType.Station, Kind = bare, Shape = shape, Durability = 100, Mass = 1000, Price = 1 };
|
||||
var row = new Shape(2, 2);
|
||||
foreach (var cell in row.AllCoordinates) row[cell] = true;
|
||||
var cramped = new HullData
|
||||
{
|
||||
Name = "Cramped Station", HullType = HullType.Station, Kind = bare, Shape = shape, Durability = 100, Mass = 1000, Price = 1,
|
||||
Hardpoints = { new HardpointData { Type = HardpointType.Facility, Position = new CultMath.int2(shape.Width - 2, 0), Shape = row, Transform = "Fa.1" } }
|
||||
};
|
||||
_cache.Upsert(cramped);
|
||||
_cache.Upsert(new FactionProductData
|
||||
{
|
||||
|
|
|
|||
|
|
@ -133,6 +133,10 @@ public sealed class StationPackageTests : IDisposable
|
|||
tiny.Shape = new Shape(3, 3);
|
||||
foreach (var cell in tiny.Shape.AllCoordinates) tiny.Shape[cell] = true;
|
||||
tiny.Hardpoints.Clear();
|
||||
var row = new Shape(2, 2);
|
||||
foreach (var cell in row.AllCoordinates) row[cell] = true;
|
||||
// The one Facility row a depot's facilities and quarters ask for: the fault under test is the docking bay, which comes after them.
|
||||
tiny.Hardpoints.Add(new HardpointData { Type = HardpointType.Facility, Position = new CultMath.int2(1, 0), Shape = row, Transform = "Fa.1" });
|
||||
var tinyRef = cache.Upsert(tiny);
|
||||
var tinyProduct = MessagePackSerializer.Deserialize<FactionProductData>(MessagePackSerializer.Serialize(depotProduct, options), options);
|
||||
tinyProduct.Name = "Tiny Depot";
|
||||
|
|
|
|||
Loading…
Reference in a new issue