Tests that stage or generate without the demo entrance: ring arenas stage the player without the entrance's haul order; the cramped-hull heater test uses a kind with no facilities
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
768e07d278
commit
65f8eb8aec
2 changed files with 15 additions and 3 deletions
|
|
@ -278,7 +278,16 @@ public sealed partial class RunStartTests
|
|||
adjust?.Invoke(pack);
|
||||
var arena = new Zone(_items, _planetSettings, pack, zone, galaxy);
|
||||
var failures = new List<string>();
|
||||
var staged = RunStart.Stage(_items, arena, new DemoTerminus(), _startingHull, failures);
|
||||
// The demo's player and stances, without its entrance's haul order: a ring arena holds no Zenith or refinery to order between.
|
||||
var staged = RunStart.Stage(_items, arena, new Scripted(false, stage =>
|
||||
{
|
||||
stage.Galaxy.FactionRelationships[stage.Galaxy.ResolveFaction(DemoTerminus.Cast.ProtagonistFaction)] = FactionRelationship.Friendly;
|
||||
stage.Galaxy.FactionRelationships[stage.Galaxy.ResolveFaction(DemoTerminus.Cast.AntagonistFaction)] = FactionRelationship.Hated;
|
||||
stage.Galaxy.FactionRelationships[stage.Galaxy.ResolveFaction(DemoTerminus.Cast.BufferFaction)] = FactionRelationship.Neutral;
|
||||
foreach (var neutral in DemoTerminus.Cast.NeutralFactions)
|
||||
stage.Galaxy.FactionRelationships[stage.Galaxy.ResolveFaction(neutral)] = FactionRelationship.Neutral;
|
||||
stage.Player(stage.Generated("Longinus"), float2.zero);
|
||||
}), _startingHull, failures);
|
||||
Assert.True(failures.Count == 0, string.Join("; ", failures));
|
||||
arena.Update(0);
|
||||
return (arena, staged.Player);
|
||||
|
|
|
|||
|
|
@ -311,7 +311,10 @@ public sealed partial class RunStartTests : IDisposable
|
|||
.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);
|
||||
foreach (var cell in shape.AllCoordinates) shape[cell] = true;
|
||||
var cramped = new HullData { Name = "Cramped Station", HullType = HullType.Station, Kind = TestStationKinds.TradeHub, Shape = shape, Durability = 100, Mass = 1000, Price = 1 };
|
||||
// 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 };
|
||||
_cache.Upsert(cramped);
|
||||
_cache.Upsert(new FactionProductData
|
||||
{
|
||||
|
|
@ -321,7 +324,7 @@ public sealed partial class RunStartTests : IDisposable
|
|||
hull.Price = 0; // generation offers no zero-price design, so the cramped hull is the only station
|
||||
var generator = new LoadoutGenerator(ref _items.Random, _items, _galaxy, _galaxy.Entrance, _protagonist, .5f);
|
||||
|
||||
var failure = Assert.Throws<InvalidLoadoutException>(() => generator.GenerateStationLoadout(TestStationKinds.TradeHub));
|
||||
var failure = Assert.Throws<InvalidLoadoutException>(() => generator.GenerateStationLoadout(bare));
|
||||
Assert.Contains("heater", failure.Message);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue