Cut C: delete ItemData.Manufacturer, derive census makers from products
The manufacturer does not belong to a design (operator ruling); it lives on FactionProductData and branding is derived, never stored on the design. - Delete ItemData.cs key 3 (Manufacturer), with a retired-key comment. - AetherDb census now attributes a design's maker to the first product (in record-key order) that sells it, matching ItemManager.Brand's rule; a design no product sells shows "(none)". - AetheriaStoresTests' catalog fixture moves its Manufacturer reference onto a FactionProductData selling the design, and FactionIsASingletonInstance reads it from there. - mutation_tests.py gets a paired mutation for that fixture wiring. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
976e80d782
commit
333a73709a
4 changed files with 35 additions and 8 deletions
|
|
@ -40,7 +40,17 @@ public static class Program
|
|||
{
|
||||
var db = AetherDb.Open();
|
||||
var items = db.Cache.GetAll<EquippableItemData>().ToArray();
|
||||
var products = db.Cache.GetAll<FactionProductData>().ToArray();
|
||||
var products = db.Cache.GetAll<FactionProductData>()
|
||||
.OrderBy(p => db.Cache.RefOf(p).Key.Value, StringComparer.Ordinal).ToArray();
|
||||
|
||||
// The manufacturer no longer lives on the design: it is derived the way Brand() derives it, from the
|
||||
// first product in record-key order that sells the design. A design no product sells shows "(none)".
|
||||
string MakerOf(EquippableItemData item)
|
||||
{
|
||||
var design = db.Cache.RefOf(item).Key;
|
||||
var product = products.FirstOrDefault(p => p.Design.Key.Equals(design));
|
||||
return product == null ? "(none)" : db.Cache.Get(product.Manufacturer)?.ShortName ?? "(none)";
|
||||
}
|
||||
|
||||
var kinds = new Dictionary<string, List<string>>();
|
||||
foreach (var item in items)
|
||||
|
|
@ -51,7 +61,7 @@ public static class Program
|
|||
: item is WeaponItemData weapon ? $"Weapon/{weapon.HardpointType}"
|
||||
: item.HardpointType.ToString();
|
||||
if (!kinds.TryGetValue(kind, out var makers)) kinds[kind] = makers = new List<string>();
|
||||
makers.Add(db.Cache.Get(item.Manufacturer)?.ShortName ?? "(none)");
|
||||
makers.Add(MakerOf(item));
|
||||
}
|
||||
|
||||
Console.WriteLine($"{items.Length} designs, {products.Length} products\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue