From b1b5031e4b9d6c15036352e2b21962cfa3f96015 Mon Sep 17 00:00:00 2001 From: soul Date: Fri, 23 Oct 2026 17:23:26 +0200 Subject: [PATCH] Economy batch 1 (munitions): apply Munitions to the shipped catalog; re-pin what the catalog stales economy author Munitions apply: 49 added, 4 changed. The pins that name the shipped catalog's contents follow it: the kind list gains munitions-works, the simple commodity count, the retirement check counts only its own stand-in, the stand-in liveness check exempts a faction awaiting its first station model (Zhestokost), and generated stations draw from the fieldable kinds. Co-Authored-By: Claude Sonnet 5.5 --- GameData/Aetheria.cc | 4 ++-- .../CommodityRecordsTests.cs | 2 +- tests/Aetheria.Shared.Tests/StationKindTests.cs | 17 ++++++++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index 55da2e5e9..7a7b99f5c 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf937f0b1ef1c0f732ccfd14728ecb786601b1ebf50699bcd7bc47cd81716fcc -size 195939 +oid sha256:68b37cb55c012c9d1df97bbf0de5c0a56d1804ce5f16f498738cd4de51c88e4b +size 214588 diff --git a/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs b/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs index 7f1c376c3..21e2995de 100644 --- a/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs +++ b/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs @@ -13,7 +13,7 @@ public sealed class CommodityRecordsTests public void ShippedCatalogOpensWithTheRetiredKeysGone() { using var cache = RestoredHullsTests.OpenCatalog(); - Assert.Equal(13, cache.GetAll().Count()); + Assert.Equal(22, cache.GetAll().Count()); Assert.Equal(51, cache.GetAll().Count()); Assert.Contains(cache.GetAll(), c => c.Name == "Ammo"); Assert.All(cache.GetAll(), c => Assert.False(string.IsNullOrEmpty(c.Name))); diff --git a/tests/Aetheria.Shared.Tests/StationKindTests.cs b/tests/Aetheria.Shared.Tests/StationKindTests.cs index 23d72e4e7..e8c7164eb 100644 --- a/tests/Aetheria.Shared.Tests/StationKindTests.cs +++ b/tests/Aetheria.Shared.Tests/StationKindTests.cs @@ -401,7 +401,7 @@ public sealed class StationKindTests : IDisposable Assert.True(station.Kind.IsSet(), "a placed station has a kind"); Assert.Equal(station.Kind.Key, w.HullOf(station).Kind.Key); var faction = w.Cache.Get(station.Faction); - var kinds = StationKinds.KindsOf(w.Cache, faction); + var kinds = StationKinds.FieldableKindsOf(w.Cache, faction); if (kinds.Length > 0) Assert.Contains(station.Kind.Key.Value, kinds.Select(kind => kind.Key.Value)); } } @@ -433,19 +433,30 @@ public sealed class StationKindTests : IDisposable var ids = new[] { "mining", "volatiles", "agriculture", "processing", "fabrication", "shipyard", "depot", "trade-hub", "residential", - "habitat-support", "urban", "administrative", "power", "research", "salvage", "black-market", "waystation" + "habitat-support", "urban", "administrative", "power", "research", "salvage", "black-market", "waystation", "munitions-works" }; Assert.Equal(ids.Select(id => StationKindData.KeyOf(id).Value).OrderBy(key => key, StringComparer.Ordinal), cache.GetAll().Select(kind => cache.RefOf(kind).Key.Value).OrderBy(key => key, StringComparer.Ordinal)); Assert.Equal(StationKindData.KeyOf("trade-hub").Value, cache.GetAll().Single(h => h.Name == "Zenith").Kind.Key.Value); } + // Factions whose first station model has not landed (ruling faction-station-models): their stand-ins name the kind that model + // will be and are not yet live. The generator seats such a faction by the any-maker fallback (StationKinds.Choose). Each is + // checked to still own no station hull, so the exemption ends the day a model lands. + private static readonly string[] AwaitingFirstModel = { "Zhestokost" }; + private static void AssertStandInsLive(CultCache cache) { foreach (var kind in cache.GetAll()) foreach (var standIn in kind.StandIns) { var faction = cache.Get(standIn.Faction); + if (AwaitingFirstModel.Contains(faction.Name)) + { + Assert.DoesNotContain(cache.GetAll(), p => cache.Get(p.Manufacturer) == faction && LoadoutGenerator.IsOffered(cache, p) + && cache.Get(p.Design) is HullData { HullType: HullType.Station }); + continue; + } var models = StationKinds.KindsOf(cache, faction); var own = cache.GetAll().Where(p => cache.Get(p.Manufacturer) == faction && LoadoutGenerator.IsOffered(cache, p)) .Select(p => cache.Get(p.Design) as HullData).Where(h => h != null && h.HullType == HullType.Station).Select(h => h.Kind.Key).ToArray(); @@ -470,7 +481,7 @@ public sealed class StationKindTests : IDisposable var live = World.Make(this, zenithOffered: false); live.Sell(live.Au, "mining"); live.StandIn("shipyard", live.Au, "mining"); - Assert.Single(live.Cache.GetAll().SelectMany(kind => kind.StandIns)); + Assert.Single(live.Cache.GetAll().SelectMany(kind => kind.StandIns), standIn => live.Cache.Get(standIn.Faction) == live.Au); AssertStandInsLive(live.Cache); var retired = World.Make(this, zenithOffered: false);